Skip to content

feat: store a space id and prefer it over the space name - #261

Merged
matt-richardson merged 2 commits into
mainfrom
mr/space-id-storage
Oct 14, 2026
Merged

matt-richardson merged 2 commits into
mainfrom
mr/space-id-storage

Conversation

@matt-richardson

Copy link
Copy Markdown
Contributor

Part of DPT-3630 (Renaming an Octopus space breaks TeamCity configurations that name it). First of a stack split out of #239.

Why

A space name goes stale when the space is renamed in Octopus; its id does not. This adds an octopus_space_id property on steps and connections and makes it win over the name when both are set.

No UI writes the id yet — the picker follows in a later PR — but a Kotlin DSL configuration can set octopus_space_id directly.

Backwards compatible by construction

Both CLIs the agent drives already resolve --space by name or id, so the id goes on the wire unchanged:

  • Legacy octo: ApiCommand.cs declares --space as "The name or ID of a space" and calls Spaces.FindByNameOrIdOrFail.
  • Go CLI: client_factory.go's SpaceNameOrID, name first then id (cli#30).

Existing configurations store only a name and keep resolving exactly as before.

Precedence

A step that identifies a space — by id or by name — keeps its own selection, and the connection's id and name are inherited together. Inheriting the connection's id alongside a name the step set deliberately would let the id win and silently retarget the step at the connection's space. There is a test for each direction.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@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.

Approved, but there is a couple of minor things probably worth fixing imo

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@matt-richardson
matt-richardson enabled auto-merge (squash) October 14, 2026 00:40
@matt-richardson
matt-richardson merged commit b0760b2 into main Oct 14, 2026
5 checks passed
@matt-richardson
matt-richardson deleted the mr/space-id-storage branch October 14, 2026 00:42
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