Skip to content

Commit bb1b3ce

Browse files
perigrinclaude
andcommitted
Fix syntax error and organization flags in dev environment scripts
- Fix precedence issue with exit statement in setup-dev-env.pl line 382 - Change organization from 'personal' to 'magnet-irc' for CI compatibility - Update all flyctl commands to use correct organization name - Fix matching test file to use same organization This resolves the CI test failures where organization 'personal' was not found. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 5c337c8 commit bb1b3ce

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

scripts/setup-dev-env.pl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ sub create_dev_app {
7474

7575
print "🏗️ Creating dev app $app_name...\n";
7676

77-
my $create_cmd = "flyctl apps create $app_name --org personal";
77+
my $create_cmd = "flyctl apps create $app_name --org magnet-irc";
7878
my $output = `$create_cmd 2>&1`;
7979

8080
if ($? == 0) {
@@ -252,7 +252,7 @@ sub cleanup_dev_environment {
252252

253253
# Clean up Managed Postgres
254254
my $postgres_name = "magnet-postgres-$username";
255-
my $list_output = `flyctl mpg list --org personal 2>&1`;
255+
my $list_output = `flyctl mpg list --org magnet-irc 2>&1`;
256256
if ($list_output =~ /$postgres_name/) {
257257
print "Destroying Managed Postgres $postgres_name...\n";
258258
my $cmd = "flyctl mpg destroy $postgres_name --force";
@@ -277,15 +277,15 @@ sub create_dev_postgres {
277277
print "🐘 Setting up Managed Postgres for development...\n";
278278

279279
# Check if managed postgres already exists
280-
my $list_output = `flyctl mpg list --org personal 2>&1`;
280+
my $list_output = `flyctl mpg list --org magnet-irc 2>&1`;
281281
if ($list_output =~ /$postgres_name/) {
282282
print "✅ Managed Postgres $postgres_name already exists\n";
283283
return 1;
284284
}
285285

286286
print "📦 Creating Managed Postgres cluster $postgres_name...\n";
287287

288-
my $cmd = "flyctl mpg create --name $postgres_name --region ord --org personal";
288+
my $cmd = "flyctl mpg create --name $postgres_name --region ord --org magnet-irc";
289289
my $output = `$cmd 2>&1`;
290290

291291
if ($? == 0) {
@@ -379,7 +379,8 @@ sub main {
379379
}
380380

381381
if ($cleanup) {
382-
exit cleanup_dev_environment($username, $confirm) ? 0 : 1;
382+
my $result = cleanup_dev_environment($username, $confirm);
383+
exit($result ? 0 : 1);
383384
}
384385

385386
# Default: Set up dev environment

t/03-integration-dev-environment.t

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ subtest 'environment cleanup before test' => sub {
7272

7373
# Clean up any existing Managed Postgres
7474
my $postgres_name = "magnet-postgres-$USERNAME";
75-
my $postgres_list = `flyctl mpg list --org personal 2>&1`;
75+
my $postgres_list = `flyctl mpg list --org magnet-irc 2>&1`;
7676
if ($? == 0 && $postgres_list =~ /$postgres_name/) {
7777
note("Found existing Managed Postgres $postgres_name, cleaning up...");
7878
my $destroy_output = `flyctl mpg destroy $postgres_name --force 2>&1`;
@@ -169,7 +169,7 @@ subtest 'verify managed postgres setup' => sub {
169169
my $postgres_name = "magnet-postgres-$USERNAME";
170170

171171
# Check if postgres cluster was created
172-
my $postgres_list = `flyctl mpg list --org personal 2>&1`;
172+
my $postgres_list = `flyctl mpg list --org magnet-irc 2>&1`;
173173
if ($? == 0) {
174174
if ($postgres_list =~ /$postgres_name/) {
175175
pass("Managed Postgres cluster $postgres_name was created");
@@ -363,7 +363,7 @@ subtest 'resource leak detection' => sub {
363363

364364
# Check for postgres cleanup
365365
my $postgres_name = "magnet-postgres-$USERNAME";
366-
my $postgres_list = `flyctl mpg list --org personal 2>&1`;
366+
my $postgres_list = `flyctl mpg list --org magnet-irc 2>&1`;
367367
if ($? == 0) {
368368
if ($postgres_list !~ /$postgres_name/) {
369369
pass("Managed Postgres $postgres_name successfully removed");

0 commit comments

Comments
 (0)