feat: wire up channel releases for KOTS apps#720
Merged
Justiceleeg merged 6 commits intomainfrom May 8, 2026
Merged
Conversation
Un-hides the previously KOTS-disabled `channel releases` command and wires it to the existing `KotsClient.ListChannelReleases` endpoint so customers and agents have a CLI equivalent of the Vendor Portal Release History page. - Accept channel ID or name (resolved via GetChannelByName, mirroring rm) - `history` alias matches Vendor Portal wording - `-o json` for agent consumption; `--page` / `--page-size` for pagination - New STATE column surfaces active vs. demoted (adds isDemoted/demotedAt to ChannelRelease type) - release inspect now renders the Channels list that was always in the wire response but never exposed Refs sc-136325
The previous `page > 0` guard silently dropped `--page 0` because Go's zero-value collides with the valid 0-indexed first page. Result: the help example `--page 0 --page-size 50` sent only `pageSize`, relying on implicit API defaults instead of an explicit request. Gate both params on `pageSize > 0` (pagination is opt-in via page-size), then always send `currentPage` alongside it. Matches the explicit `currentPage=0&pageSize=20` pattern already used by ListReleases. Reported by Cursor Bugbot on PR #720.
Adds pkg/integration/channel_test.go covering the new command end-to-end against an httptest.Server, including the platform/Helm branch which couldn't be exercised against any available real-world environment. Cases: - KOTS table with active + demoted state rendering - KOTS JSON includes isDemoted/demotedAt - Pagination sends currentPage=0 explicitly (regression guard for the previously-fixed page-zero bug) - Empty channel renders the "No releases in channel" message - Platform/Helm legacy branch produces unchanged column layout
- Error early when --page is set without --page-size, instead of silently
no-op'ing. Prevents footgun where `--page 2` looks like it's working
but the API never sees the param.
- Use strconv.Itoa instead of fmt.Sprintf("%d", ...) for page params,
matching network_list.go and cluster_list.go.
- Update help example to use `--page 1 --page-size 50` (page 0 is the
default and didn't illustrate pagination semantics).
- Add integration test for by-name channel resolution (exercises the
ListChannels fallthrough that was previously implicit).
- Add integration test guarding the new --page/--page-size validation.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3b163c0. Configure here.
Go's omitempty drops bool fields when false, so non-demoted releases were missing isDemoted entirely. Agents checking `release.isDemoted === false` saw undefined instead. Drop omitempty from both IsDemoted and DemotedAt so non-demoted releases serialize as `"isDemoted": false, "demotedAt": null` — explicitly distinguishable from absent.
alicenstar
previously approved these changes
May 8, 2026
No other command in this CLI has a concept-rename alias; existing aliases are all pure short/long synonyms (ls↔list, rm↔delete). Per PR review, dropping `history` keeps `channel releases` consistent with that convention.
alicenstar
approved these changes
May 8, 2026
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.

Summary
Un-hides
replicated channel releasesfor KOTS apps. The command existed but was hidden and explicitly errored for KOTS — the modern path. Wires it to the existingKotsClient.ListChannelReleasesendpoint and exposes the data agents and customers expect from a "release history" lookup.Reported by Dreadnode: their agent looked for a CLI equivalent of the Vendor Portal Release History page and had to call the Vendor API directly. Closes sc-136325.
What changed
channel releases(andchannel historyalias)CHANNEL_ID_OR_NAME(resolved viaGetChannelByName, mirroring PR Support lookup by channel name or ID for channel delete command #717'schannel rm)-o table|jsonfor agent consumption--page/--page-sizefor pagination (0-indexed, opt-in via--page-size)STATEcolumn surfacesactive/demoted; JSON includesisDemoted+demotedAtrelease inspectChannelslist that has been on the wire for years but was dropped by the 2023 type refactor. Table gets aCHANNELS:row; JSON getschannels.Out of scope (per the spec)
--include-installer-imagesflag (defer; not what was asked for)release historycommand (agents composechannel ls+channel releases)isDemoted+demotedAtcover the 90% case)Test plan
channel releasesandrelease inspectchannelshistoryalias, JSON, pagination across pages, demote/un-demote round-trip surfaces correctly inSTATEand JSON,release inspectrenders/omitsCHANNELS:correctlychannel releasesagainst a legacy app should produce the same output as before, plus-o jsonnow worksNotes
37bf901f.replicated-cli-channel-releases.md,replicated-cli-release-inspect.md) regenerate via the dagger pipeline, not by hand.Refs sc-136325