Repository navigation
feat: suggest a connection's spaces in the space field and store the chosen id - #263
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…API key Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…chosen id Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ackage Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
APErebus
left a comment
There was a problem hiding this comment.
This one I found a lot harder to review due to all the spacePicker.js.
I'm going to approve because I trust it's been checked
Yeah - that This is after i made it refactor to attempt to make it readable. |
…ection from TeamCity Switching a step's connection clears the stored space id, since an id only identifies a space on one Octopus server. The connection form now gets the connection being edited from TeamCity's oauthConnectionBean instead of trying request parameter names. The picker's loader copes with missing markup and a script that fails to load. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
For completeness sake - I ran another code review on it, and it found a few edges and cleanups, which i've committed |
Part of DPT-3630 (Renaming an Octopus space breaks TeamCity configurations that name it).
Why
This is where the space id becomes something an admin can set from the UI. The space field on the connection form and on all six step forms now suggests the connection's spaces as you type. Choosing one, or typing a space's exact name, stores its id alongside the name.
It stays a text field
The field is still free text, deliberately. Listing spaces needs credentials at edit time, and not every setup has them: inline step credentials, an unsaved connection, and (until the follow-up PRs) parameter-held and OIDC keys. In those cases the field explains why nothing was suggested, and typing the name works as before. A plain
<select>would have broken exactly those setups.Anything typed that isn't an exact space name, including a
%parameter%reference that TeamCity resolves at build time, is stored as the name alone, with no id.Screenshots
Taken from a step form against the e2e Octopus container, whose licence allows only the Default space.
Entering the field suggests the connection's spaces:
A typed name that matches no space:
A saved space id that Octopus no longer has:
Spaces can't be listed; the reason is in the tooltip:
Inline credentials, with no connection to list spaces through:
Notes
spacePickerConnectionIdtries each plausible name. It only accepts a value that resolves to an Octopus connection in the project; otherwise the picker asks the admin to save the connection first.%reference is being typed and spaces otherwise. It still offers spaces if TeamCity's completion fails (there is an e2e test for this).OctopusSpacePickerUiTest(4 cases) andOctopusConnectionUiTestpass locally against the real TeamCity and Octopus containers.🤖 Generated with Claude Code