Skip to content
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

Merged
merged 1 commit into from
Feb 12, 2024

Conversation

qmonnet
Copy link
Member

@qmonnet qmonnet commented Jan 30, 2024

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")

@qmonnet qmonnet added kind/bug/CI This is a bug in the testing code. release-note/ci This PR makes changes to the CI. needs-backport/1.12 needs-backport/1.13 This PR / issue needs backporting to the v1.13 branch needs-backport/1.14 This PR / issue needs backporting to the v1.14 branch feature/ipsec Relates to Cilium's IPsec feature needs-backport/1.15 This PR / issue needs backporting to the v1.15 branch labels Jan 30, 2024
@qmonnet qmonnet requested review from a team as code owners January 30, 2024 16:25
@maintainer-s-little-helper maintainer-s-little-helper bot added this to Needs backport from main in 1.13.12 Jan 30, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot added this to Needs backport from main in v1.15.0-rc.1 Jan 30, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot added this to Needs backport from main in 1.12.19 Jan 30, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot added this to Needs backport from main in 1.14.7 Jan 30, 2024
@qmonnet
Copy link
Member Author

qmonnet commented Jan 30, 2024

/test

@qmonnet qmonnet marked this pull request as draft January 30, 2024 17:54
@qmonnet qmonnet force-pushed the pr/qmonnet/ipsec/patch-release-downgrade-fix branch 2 times, most recently from 772ee53 to fe446ba Compare January 30, 2024 18:10
@qmonnet qmonnet marked this pull request as ready for review January 30, 2024 18:10
@qmonnet qmonnet added release-blocker/1.12 This issue will prevent the release of the next version of Cilium. release-blocker/1.13 This issue will prevent the release of the next version of Cilium. release-blocker/1.14 This issue will prevent the release of the next version of Cilium. labels Jan 30, 2024
@qmonnet
Copy link
Member Author

qmonnet commented Jan 30, 2024

/test

@julianwiedmann
Copy link
Member

Just to brain-storm on less-hacky alternatives a bit more. Would a checkout with fetch-tags: true help us? And instead of comparing VERSION, testing whether the expected tag exists?

@aanm aanm added this to Needs backport from main in 1.15.1 Jan 31, 2024
@aanm aanm removed this from Needs backport from main in v1.15.0-rc.1 Jan 31, 2024
@qmonnet qmonnet added backport-pending/1.12 backport-pending/1.13 The backport for Cilium 1.13.x for this PR is in progress. backport-pending/1.14 The backport for Cilium 1.14.x for this PR is in progress. backport-pending/1.15 The backport for Cilium 1.15.x for this PR is in progress. and removed needs-backport/1.12 needs-backport/1.13 This PR / issue needs backporting to the v1.13 branch needs-backport/1.14 This PR / issue needs backporting to the v1.14 branch needs-backport/1.15 This PR / issue needs backporting to the v1.15 branch labels Feb 12, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Needs backport from main to Backport pending to v1.14 in 1.14.7 Feb 12, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Needs backport from main to Backport pending to v1.13 in 1.13.12 Feb 12, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Needs backport from main to Backport pending to v1.12 in 1.12.19 Feb 12, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Needs backport from main to Backport pending to v1.12 in 1.12.19 Feb 12, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Needs backport from main to Backport pending to v1.15 in 1.15.1 Feb 12, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Needs backport from main to Backport pending to v1.15 in 1.15.1 Feb 12, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Needs backport from main to Backport pending to v1.15 in 1.15.1 Feb 12, 2024
@michi-covalent michi-covalent moved this from Backport pending to v1.12 to Backport done to v1.12 in 1.12.19 Feb 12, 2024
@michi-covalent michi-covalent moved this from Backport pending to v1.13 to Backport done to v1.13 in 1.13.12 Feb 12, 2024
@michi-covalent michi-covalent moved this from Backport pending to v1.14 to Backport done to v1.14 in 1.14.7 Feb 12, 2024
@michi-covalent michi-covalent moved this from Backport pending to v1.15 to Backport done to v1.15 in 1.15.1 Feb 12, 2024
@michi-covalent michi-covalent added backport-done/1.12 The backport for Cilium 1.12.x for this PR is done. backport-done/1.13 The backport for Cilium 1.13.x for this PR is done. backport-done/1.14 The backport for Cilium 1.14.x for this PR is done. backport-done/1.15 The backport for Cilium 1.15.x for this PR is done. release-blocker/1.15 This issue will prevent the release of the next version of Cilium. and removed backport-pending/1.12 backport-pending/1.13 The backport for Cilium 1.13.x for this PR is in progress. backport-pending/1.14 The backport for Cilium 1.14.x for this PR is in progress. backport-pending/1.15 The backport for Cilium 1.15.x for this PR is in progress. labels Feb 12, 2024
@qmonnet
Copy link
Member Author

qmonnet commented Feb 13, 2024

Ha! So as it turns out, fetch-tags: true doesn't work with fetch-depth: 0, we don't retrieve any tags (presumably because we don't have the commits to associate them with). I'll send a fix to the fix to the fix 🙃, switch back to the VERSION-update based check.

[EDIT: And this will be in #30742.]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-done/1.12 The backport for Cilium 1.12.x for this PR is done. backport-done/1.13 The backport for Cilium 1.13.x for this PR is done. backport-done/1.14 The backport for Cilium 1.14.x for this PR is done. backport-done/1.15 The backport for Cilium 1.15.x for this PR is done. feature/ipsec Relates to Cilium's IPsec feature kind/bug/CI This is a bug in the testing code. release-blocker/1.12 This issue will prevent the release of the next version of Cilium. release-blocker/1.13 This issue will prevent the release of the next version of Cilium. release-blocker/1.14 This issue will prevent the release of the next version of Cilium. release-blocker/1.15 This issue will prevent the release of the next version of Cilium. release-note/ci This PR makes changes to the CI.
Projects
No open projects
1.12.19
Backport done to v1.12
1.13.12
Backport done to v1.13
1.14.7
Backport done to v1.14
1.15.1
Backport done to v1.15
Development

Successfully merging this pull request may close these issues.

None yet

4 participants