diff --git a/CHANGELOG.md b/CHANGELOG.md index 608f0cb00..6426ff287 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Change Log All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org) +## 4.0.4-dev + ## 4.0.3 - 2025-09-11 ### Added diff --git a/config/constants.yml b/config/constants.yml index 92c19886d..b2cebc1c7 100644 --- a/config/constants.yml +++ b/config/constants.yml @@ -7,7 +7,7 @@ --- # App -TERMINUS_VERSION: '4.0.3' +TERMINUS_VERSION: '4.0.4-dev' # Connectivity TERMINUS_HOST: 'terminus.pantheon.io' diff --git a/src/Commands/Upstream/ListCommand.php b/src/Commands/Upstream/ListCommand.php index cf5461046..1e8c4407c 100644 --- a/src/Commands/Upstream/ListCommand.php +++ b/src/Commands/Upstream/ListCommand.php @@ -31,7 +31,9 @@ class ListCommand extends TerminusCommand * category: Category * type: Type * framework: Framework + * repository_url: Repository URL * organization: Organization + * @default-fields id,label,machine_name,category,type,framework,organization * @option all Show all upstreams * @option framework DEPRECATED Framework filter * @option name DEPRECATED Name filter diff --git a/tests/Functional/UpstreamCommandsTest.php b/tests/Functional/UpstreamCommandsTest.php index 67af25d34..087ede211 100644 --- a/tests/Functional/UpstreamCommandsTest.php +++ b/tests/Functional/UpstreamCommandsTest.php @@ -27,6 +27,34 @@ public function testUpstreamListCommand() $this->assertArrayHasKey('label', $upstreamInfo, 'An upstream should have "label" field.'); $this->assertArrayHasKey('machine_name', $upstreamInfo, 'An upstream should have "machine_name" field.'); $this->assertArrayHasKey('type', $upstreamInfo, 'An upstream should have "type" field.'); + $this->assertArrayNotHasKey( + 'repository_url', + $upstreamInfo, + 'An upstream should not have "repository_url" field by default.' + ); + } + + /** + * Test UpstreamListCommand with repository_url field + * + * @test + * @covers \Pantheon\Terminus\Commands\Upstream\ListCommand + * + * @group upstream + * @group short + */ + public function testUpstreamListCommandWithRepositoryUrl() + { + $upstreamList = $this->terminusJsonResponse('upstream:list --fields=id,label,repository_url'); + $this->assertIsArray($upstreamList); + $upstreamInfo = array_shift($upstreamList); + $this->assertArrayHasKey('id', $upstreamInfo, 'An upstream should have "id" field.'); + $this->assertArrayHasKey('label', $upstreamInfo, 'An upstream should have "label" field.'); + $this->assertArrayHasKey( + 'repository_url', + $upstreamInfo, + 'An upstream should have "repository_url" field when explicitly requested.' + ); } /**