feat: add channel list, view, and delete commands - #609
Open
NickJosevski wants to merge 2 commits into
Open
Conversation
NickJosevski
force-pushed
the
nj/channel-list-view-delete
branch
from
August 6, 2026 02:11
e441a43 to
02416c8
Compare
Adds three subcommands to `octopus channel`: - `list` — list a project's channels, with `--filter`/`-q` name filtering. Takes the project positionally or via `-p/--project`. - `view` — view a channel by name or ID, resolving the lifecycle name and surfacing version rules, Git reference/resource rules, tenant tags, custom field definitions and ephemeral-environment settings. Supports `--web`. - `delete` — delete a channel by name or ID, with a confirmation prompt in interactive mode and `-y/--confirm` for automation. All three support the standard table/json/basic output formats, prompt for the project when it isn't supplied, and resolve the channel through a shared helper that keeps lookups scoped to the requested project. `delete` warns in interactive mode when the project is version-controlled, since the server does not guard against deleting a channel referenced by OCL deployments. `view` is read-only and deliberately shows fields `channel create` cannot yet set; extending create (and adding update) is left to a follow-up. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
NickJosevski
force-pushed
the
nj/channel-list-view-delete
branch
from
August 6, 2026 05:22
02416c8 to
f999359
Compare
Nine commands hand-rolled the same "prompt for the project when it wasn't named, look it up when it was, error out in automation mode" block. It was copy-paste rather than parallel evolution — the comment "project name is already provided, fetch the object because it's needed for further questions" appeared verbatim eight times. They now call selectors.ResolveProject. Behaviour is unchanged: callers that echo the resolved project still do so on the same condition (the project came from the command line, so no prompt was shown), and automation-mode validation still runs before any API call — release delete in particular must reject a missing --version before looking the project up. release-progression allow and prevent are deliberately left alone. They have no lookup branch at all, so adopting the helper there would change behaviour rather than just deduplicate; they are separately buggy and want their own fix. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds three subcommands to
octopus channel:list— list a project's channels. Takes the project positionally or via-p/--project, with--filter/-qfor name filtering.view— view a channel by name or ID. Resolves the lifecycle name and shows version rules, Git reference/resource rules, tenant tags, custom field definitions and ephemeral-environment settings. Supports--web.delete— delete a channel by name or ID. Confirmation prompt in interactive mode,-y/--confirmfor automation.All three support
table/json/basicoutput and prompt for the project when it isn't supplied.Notes
deletewarns in interactive mode when the project is version-controlled — the server does not guard against deleting a channel an OCL deployment references.viewanddeleteresolve the channel through a shared helper that falls back to a project-scoped lookup, so an ID belonging to another project is never used.go-octopusdeployv2.108.0 doesn't exposeSlugonchannels.Channel. Both commands accept name or ID only; surfacing slugs needs an SDK bump.viewvscreate:viewis read-only and shows fieldschannel createcannot yet set. Extendingcreate(and addingupdate) is a follow-up, not part of this PR.@NickJosevski tested against local instance