Handle MostRecentlyPublished channel rule strategy in release create#608
Open
NickJosevski wants to merge 1 commit into
Open
Handle MostRecentlyPublished channel rule strategy in release create#608NickJosevski wants to merge 1 commit into
NickJosevski wants to merge 1 commit into
Conversation
…sionBaselineForChannel When a channel version rule has VersioningStrategy "MostRecentlyPublished", send versioningStrategy and versionTagRegex query parameters to the package feed instead of preReleaseTag and versionRange. This ensures the server uses publish-date ordering to suggest the latest package version, supporting non-SemVer versioning schemes. Depends on go-octopusdeploy PR #421 (VersioningStrategy/VersionTagRegex fields on ChannelRule and SearchPackageVersionsQuery). go.mod will be updated to the new go-octopusdeploy release once that PR is merged and tagged.
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
When a channel version rule has
VersioningStrategy: "MostRecentlyPublished", the CLI now sendsversioningStrategyandversionTagRegexquery parameters to the package feed instead ofpreReleaseTagandversionRange. This ensures the server uses publish-date ordering to suggest the latest package version duringrelease create, supporting non-SemVer versioning schemes such as Docker image tags, date-stamps, and feature branch names.Before: a channel rule with
MostRecentlyPublishedstrategy would have itsVersionRange(empty) andTag(empty) sent — the server would fall back to SemVer ordering, returning the wrong package suggestion.After:
versioningStrategy=MostRecentlyPublishedandversionTagRegex=<pattern>are sent, the server applies publish-date ordering and the correct regex filter.Dependency
Requires go-octopusdeploy PR #421 to be merged first, which adds
VersioningStrategy/VersionTagRegexfields toChannelRuleandSearchPackageVersionsQuery. Thego.modversion bump will be done in a follow-up commit once that PR is tagged.Related
Server-side implementation: OctopusDeploy/OctopusDeploy PR #43750
Test plan
TestReleaseCreate_BuildPackageVersionBaselinetests all pass (9 cases)uses_versioningStrategy_and_versionTagRegex_query_params_when_channel_rule_has_MostRecentlyPublished_strategy— verifies correct query params are sent andpreReleaseTag/versionRangeare absent