Skip to content

fix: require an Octopus space instead of falling back to Default - #287

Merged
matt-richardson merged 25 commits into
mainfrom
mr/go-cli-default-space
Nov 9, 2026
Merged

matt-richardson merged 25 commits into
mainfrom
mr/go-cli-default-space

Conversation

@matt-richardson

@matt-richardson matt-richardson commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Merges into #276.

A step with no space, on the step or its connection, sent --space Default. The legacy CLI left --space out and used the server's real default space. An instance whose default space was renamed or deleted would fail, or act on the wrong space. The Go CLI can't leave the flag out: run non-interactively, it errors with "space must be specified when not running interactively". So the space is now required, rather than guessed.

Notes:

  • A step that doesn't use a connection can't be saved without a space.
  • A connection's space stays optional, so one connection can serve steps in different spaces. The step form can't see the connection's settings when it validates. A step whose connection has no space, and that names no space itself, fails at build time with "No Octopus space is set" before any CLI command runs.
  • TeamCity runs the same check when it matches a build to an agent. A saved step with no space and no connection makes every agent incompatible, so the build stays queued. The agent's compatibility details show "Space must be specified". feat!: Remove legacy CLI and default new Go CLI #276's release notes should mention this.
  • The pack step doesn't talk to Octopus and doesn't need a space.
  • The e2e tests that ran builds against a connection with a blank space now set Default.

🤖 Generated with Claude Code

APErebus and others added 9 commits October 20, 2026 12:21
The Go CLI archives are now downloaded at build time (#282). Drop the
committed cli/ archives and point downloadOctopusCli at resources/cli/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bring in the per-architecture Go CLI archives (#283). Port the
architecture lookup into cli/OctopusOsUtils and move its test into the
cli package.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the fix label Oct 27, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@matt-richardson
matt-richardson marked this pull request as draft October 27, 2026 03:02
matt-richardson and others added 5 commits October 30, 2026 10:06
…o-cli-default-space

# Conflicts:
#	e2e/src/test/java/octopus/teamcity/e2e/test/OctopusConnectionBuildInformationE2ETest.java
#	e2e/src/test/java/octopus/teamcity/e2e/test/OctopusPromoteReleaseNewCliE2ETest.java
#	e2e/src/test/java/octopus/teamcity/e2e/test/OctopusPushPackageE2ETest.java
#	octopus-agent/src/main/java/octopus/teamcity/agent/cli/CLIBuildProcess.java
#	octopus-agent/src/test/java/octopus/teamcity/agent/cli/CLIBuildProcessTest.java
#	octopus-common/src/main/java/octopus/teamcity/common/SpaceSelection.java
#	octopus-server/src/main/java/octopus/teamcity/server/PropertiesValidator.java
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Additional command line arguments reach the Go CLI unchanged. Steps
written for the legacy octo CLI can carry arguments the Go CLI rejects
with only "unknown flag"; the build log now says where the argument
came from.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The Go CLI is bundled for amd64 and arm64 only. Every runner reported
every agent as compatible, so a build could be sent to an agent whose
JVM architecture has no bundled CLI and fail when the step started.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…o-cli-default-space

# Conflicts:
#	octopus-agent/src/main/java/octopus/teamcity/agent/cli/CLIBuildProcess.java
Base automatically changed from ap/default-to-new-cli to main November 5, 2026 04:10
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@matt-richardson
matt-richardson marked this pull request as ready for review November 5, 2026 04:30

@APErebus APErebus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

# Conflicts:
#	octopus-agent/src/test/java/octopus/teamcity/agent/cli/CLIBuildProcessTest.java
#	octopus-server/src/main/java/octopus/teamcity/server/OctopusDeployReleaseRunType.java
#	octopus-server/src/main/java/octopus/teamcity/server/PropertiesValidator.java
@matt-richardson
matt-richardson enabled auto-merge (squash) November 9, 2026 03:14
@matt-richardson matt-richardson self-assigned this Nov 9, 2026
@matt-richardson
matt-richardson merged commit b95c949 into main Nov 9, 2026
5 checks passed
@matt-richardson
matt-richardson deleted the mr/go-cli-default-space branch November 9, 2026 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants