-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Conversation
There was a problem hiding this 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 | ||
} |
There was a problem hiding this comment.
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.
} | |
} | |
// Intentionally ignore patch version differences; only compare major and minor versions. |
Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
}{ | ||
"dev should always be allowed": { | ||
resourceVersion: "0.11.0", | ||
buildVersion: "dev", |
There was a problem hiding this comment.
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 }} |
There was a problem hiding this comment.
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
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.