Skip to content

Relax version requirements to allow patch version mismatch #4080

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 14, 2025

Conversation

nikola-jokic
Copy link
Collaborator

This change reduces the version requirements to allow for a patch version mismatch. Previously, the resource version of each AutoscalingRunnerSet had to match the build version.

This change allows the patch version mismatch.

@nikola-jokic nikola-jokic changed the title Reduce version requirements to allow patch version mismatch Relax version requirements to allow patch version mismatch May 8, 2025
@nikola-jokic nikola-jokic marked this pull request as ready for review May 8, 2025 19:53
@Copilot Copilot AI review requested due to automatic review settings May 8, 2025 19:53
@nikola-jokic nikola-jokic requested review from mumoshu, toast-gear, rentziass and a team as code owners May 8, 2025 19:53
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request relaxes the strict version matching requirement to allow patch version mismatches when reconciling AutoscalingRunnerSet resources.

  • Updates the reconciliation logic to use a semver comparison that ignores patch differences.
  • Introduces a new helper function, IsVersionAllowed, along with an accompanying test suite.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
go.mod Added an extra newline (likely for formatting consistency).
controllers/actions.github.com/autoscalingrunnerset_controller.go Replaced strict equality check with IsVersionAllowed to allow patch version mismatches.
apis/actions.github.com/v1alpha1/version_test.go Added test cases to validate the relaxed semver matching logic.
apis/actions.github.com/v1alpha1/version.go Introduced the IsVersionAllowed function and supporting semver parsing logic.

bv, ok := parseSemver(buildVersion)
if !ok {
return false
}
Copy link
Preview

Copilot AI May 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider adding a comment here to clarify that patch version differences are intentionally ignored.

Suggested change
}
}
// Intentionally ignore patch version differences; only compare major and minor versions.

Copilot uses AI. Check for mistakes.

@nikola-jokic nikola-jokic added the gha-runner-scale-set Related to the gha-runner-scale-set mode label May 12, 2025
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
}{
"dev should always be allowed": {
resourceVersion: "0.11.0",
buildVersion: "dev",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably need to accept canary-sha here as well:

build-args: VERSION=canary-${{ steps.resolve_parameters.outputs.short_sha }}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I thought this one was covered by the exact match, but I guess I can add HasPrefix on canary- to allow mismatches in canary deployments

@nikola-jokic nikola-jokic merged commit 389d842 into master May 14, 2025
17 checks passed
@nikola-jokic nikola-jokic deleted the nikola-jokic/version-requirements branch May 14, 2025 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gha-runner-scale-set Related to the gha-runner-scale-set mode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants