-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
ci/ipsec: Fix downgrade version for release preparation commits #30532
ci/ipsec: Fix downgrade version for release preparation commits #30532
Conversation
/test |
772ee53
to
fe446ba
Compare
/test |
Just to brain-storm on less-hacky alternatives a bit more. Would a checkout with |
Ha! So as it turns out, [EDIT: And this will be in #30742.] |
For the IPsec upgrade/downgrade CI test, for the jobs where we upgrade/downgrade to the closest patch release, the script print-downgrade-version.sh determines the patch release by picking up the value in file VERSION. This works most of the time.
For release preparation commits, however, this approach fails because the reference in VERSION points to a release that has not been tagged or published yet. We need to pick the previous patch release in that case.
However, it's non-trivial to figure out whether we're on a release preparation commit, in particular because the CI workflow does a shallow Git clone and we don't have access to the Git history. I couldn't find an ideal solution, so this commit changes the shallow-clone into a clone with 2 commits (one for the last commit, which is the one we're interested in, and another one squashing all the rest of the history). And we add a hack in the script to account for this last commit and check whether it modifies the VERSION file. If it does, we decrement the version found in VERSION before computing the patch release to downgrade to.
Fixes: 5581963 ("ci/ipsec: Fix version retrieval for downgrades to closest patch release")