Skip to content

Handle MostRecentlyPublished channel rule strategy in release create#608

Open
NickJosevski wants to merge 1 commit into
mainfrom
nj/non-semver-ordering
Open

Handle MostRecentlyPublished channel rule strategy in release create#608
NickJosevski wants to merge 1 commit into
mainfrom
nj/non-semver-ordering

Conversation

@NickJosevski
Copy link
Copy Markdown
Contributor

Summary

When a channel version rule has VersioningStrategy: "MostRecentlyPublished", the CLI now sends 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 during release create, supporting non-SemVer versioning schemes such as Docker image tags, date-stamps, and feature branch names.

Before: a channel rule with MostRecentlyPublished strategy would have its VersionRange (empty) and Tag (empty) sent — the server would fall back to SemVer ordering, returning the wrong package suggestion.

After: versioningStrategy=MostRecentlyPublished and versionTagRegex=<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/VersionTagRegex fields to ChannelRule and SearchPackageVersionsQuery. The go.mod version bump will be done in a follow-up commit once that PR is tagged.

Related

Server-side implementation: OctopusDeploy/OctopusDeploy PR #43750

Test plan

  • Existing TestReleaseCreate_BuildPackageVersionBaseline tests all pass (9 cases)
  • New test case: uses_versioningStrategy_and_versionTagRegex_query_params_when_channel_rule_has_MostRecentlyPublished_strategy — verifies correct query params are sent and preReleaseTag/versionRange are absent

…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant