fix(ci): make git describe robust against shallow checkouts#3922
fix(ci): make git describe robust against shallow checkouts#3922shreyaabaranwal wants to merge 1 commit into
Conversation
actions/checkout defaults to a shallow clone without tags, so git describe --tags exits 128 and the version ends up empty. This produces malformed image tags and causes e2e image lookups (e.g. TestCore_PythonUserDepsRemote) to fail with image not found. - Set fetch-depth: 0 on all checkout steps so tags are available - Fall back gracefully in Makefile and hack/release.sh when no matching tag is found Signed-off-by: shreyaabaranwal <shreyabaranwal229@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: shreyaabaranwal The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @shreyaabaranwal. Thanks for your PR. I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
this one fixes a CI issue that's currently failing e2e on unrelated PRs (like #3913). Would a maintainer mind dropping /ok-to-test so the checks can run? Thanks! |
Changes
git describeresilient to shallow checkouts so the version string is never emptyWhile working on #3913 I noticed the
E2E - Core, Metadata, and Remotecheck kept failing on a change that was completely unrelated to it (just an extension map iteration cleanup). Digging into the logs of the failing run (job 83049870138), the actual cause turned out to be in CI itself, not the PR.actions/checkoutdoes a shallow clone by default and doesn't fetch tags. Because of that,git describe --tags --match 'v*'exits with status 128 and the version ends up empty. That empty version flows into the image tags, so the e2e tests later fail looking up an image that was never built under the expected name — which is whyTestCore_PythonUserDepsRemotereports "image not found".This PR fixes the root cause rather than the symptom:
fetch-depth: 0on allactions/checkout@v4steps so tags are actually available whengit describeruns.Makefileandhack/release.shso the version degrades to a commit SHA (or a placeholder) instead of being empty if no matching tag is found.This should unblock e2e on PRs like #3913 that don't touch CI but were failing because of it.
/kind bug
Relates to #3913
Release Note
Docs