From 0f4bf6ed5b6a96f6047186d608ca157a7b77e888 Mon Sep 17 00:00:00 2001 From: Joe Tannenbaum Date: Thu, 12 Nov 2026 13:40:20 -0500 Subject: [PATCH] gh link in cloud new callout --- app/Commands/NewApplication.php | 3 +- tests/Feature/NewApplicationTest.php | 17 +++++++++ .../InteractiveNewApplicationCommand.php | 36 +++++++++++++++++++ 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 tests/Fixtures/InteractiveNewApplicationCommand.php diff --git a/app/Commands/NewApplication.php b/app/Commands/NewApplication.php index ef25f4f7..594f1d84 100644 --- a/app/Commands/NewApplication.php +++ b/app/Commands/NewApplication.php @@ -135,8 +135,9 @@ public function handle(Git $git) callout("{$application->name} is ready", [ Element::keyValueList([ 'URL' => Element::link($environment->url).($isReady ? '' : ' (still starting)'), - 'Local' => $this->tildePath($this->path), 'Dashboard' => Element::link($result['dashboard_url']), + 'Repository' => Element::link((new GitHubProvider)->repositoryUrl($application->repositoryFullName ?? $this->form()->get('repository'))), + 'Local' => $this->tildePath($this->path), ]), ]); } diff --git a/tests/Feature/NewApplicationTest.php b/tests/Feature/NewApplicationTest.php index ad048cea..34da6b90 100644 --- a/tests/Feature/NewApplicationTest.php +++ b/tests/Feature/NewApplicationTest.php @@ -30,6 +30,7 @@ use Saloon\Http\Faking\MockClient; use Saloon\Http\Faking\MockResponse; use Saloon\Http\PendingRequest; +use Tests\Fixtures\InteractiveNewApplicationCommand; beforeEach(function () { Sleep::fake(); @@ -425,3 +426,19 @@ function newApplicationDefaultPath(string $home, string $cwd): string putenv('HOME='.$originalHome); } }); + +it('links the dashboard and repository when the application is ready', function () { + Artisan::registerCommand(new InteractiveNewApplicationCommand); + + $exitCode = Artisan::call('test:interactive-new', [ + '--starter-kit' => 'go', + '--repository' => 'user/new-app', + '--name' => 'new-app', + '--region' => 'us-east-1', + '--path' => $this->clonePath, + ]); + + expect($exitCode)->toBe(0) + ->and(Artisan::output()) + ->toMatch('/URL.*\n.*Dashboard.*\n.*Repository.*https:\/\/github\.com\/user\/new-app.*\n.*Local/'); +}); diff --git a/tests/Fixtures/InteractiveNewApplicationCommand.php b/tests/Fixtures/InteractiveNewApplicationCommand.php new file mode 100644 index 00000000..0a5cb9b3 --- /dev/null +++ b/tests/Fixtures/InteractiveNewApplicationCommand.php @@ -0,0 +1,36 @@ +signature = preg_replace('/^new/', 'test:interactive-new', $this->signature); + + parent::__construct(); + } + + protected function isInteractive(): bool + { + return true; + } + + protected function configurePrompts(InputInterface $input): void + { + Renderer::$suppressOutput = false; + + parent::configurePrompts($input); + + Prompt::interactive(true); + } +}