Handle MostRecentlyPublished channel rule strategy in release create#608
Merged
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.
Contributor
Author
|
Will fail until other related PRs in Server are merged... |
Follow-on to PR #608 to match OctopusDeploy #44073: VersionRange, Tag and VersionTagRegex are now always applied together; VersioningStrategy only changes ordering (publish-date vs SemVer), not which versions satisfy the rule. Replace the earlier either/or branching that dropped Tag/VersionRange under MostRecentlyPublished and never sent VersionTagRegex under SemVer. Update the test to assert all four params are sent together, and correct the expected query-param order to match uritemplates expansion (template order). go.mod still pins the client that lacks these fields, so this does not yet compile; bump pending the go-octopusdeploy release (see TODO). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
zentron
approved these changes
Jul 14, 2026
v2.112.1 adds VersioningStrategy and VersionTagRegex to channels.ChannelRule and feeds.SearchPackageVersionsQuery (go-octopusdeploy#421), which BuildPackageVersionBaselineForChannel already consumes. Removes the go.mod TODO now that the release exists. Corrects the expected query string in create_test.go: the client emits query params alphabetically, confirmed against the real client build. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
NickJosevski
added a commit
that referenced
this pull request
Jul 15, 2026
Follow-on to PR #608 to match OctopusDeploy #44073: VersionRange, Tag and VersionTagRegex are now always applied together; VersioningStrategy only changes ordering (publish-date vs SemVer), not which versions satisfy the rule. Replace the earlier either/or branching that dropped Tag/VersionRange under MostRecentlyPublished and never sent VersionTagRegex under SemVer. Update the test to assert all four params are sent together, and correct the expected query-param order to match uritemplates expansion (template order). go.mod still pins the client that lacks these fields, so this does not yet compile; bump pending the go-octopusdeploy release (see TODO). Co-Authored-By: Claude Opus 4.8 <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.
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