get latest release should not include demoted#723
Merged
Conversation
NoaheCampbell
previously approved these changes
May 17, 2026
divolgin
reviewed
May 18, 2026
| return nil, "", errors.Errorf("unknown app type %q", appType) | ||
| } | ||
|
|
||
| func currentChannelRelease(releases []types.ChannelRelease) *types.ChannelRelease { |
Member
There was a problem hiding this comment.
This doesn't account for semver sorting, but I also believe the API should be sorting releases already. There should also be current release fields set on the channel response: https://replicated-vendor-api.readme.io/reference/getchannelproperties-1 (I see latestChannelSequence, releaseSequence and currentVersion fields)
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
52f5b9b to
ec732e0
Compare
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
divolgin
approved these changes
May 18, 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.
problem: GetCurrentChannelRelease defines current as the release with the highest channel sequence in both the embedded-release and fallback paths. ChannelRelease explicitly carries demotion state, but neither path excludes IsDemoted releases. If the latest promoted release was demoted, commands that ask for the current channel release can operate on the demoted release instead of the active one, returning stale or intentionally removed release data such as image lists and proxy metadata.
solution:
When selecting the current release, skip releases with IsDemoted set. If all releases are demoted, return a clear no active release error. Keep the same filtering in both the kotsChannel.Releases path and the ListChannelReleases fallback path.