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: Fix git-validation.sh #2121

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

Honny1
Copy link
Member

@Honny1 Honny1 commented Oct 1, 2024

This PR fixes git-validation.sh, failing in Cirrus CI. The problem was caused by the missing main branch. Cirrus CI performs a clone of a single branch with full Git history and no tags.

Fixes: #2067

@Honny1 Honny1 force-pushed the git-validation branch 9 times, most recently from c19aa4e to 48dc9a7 Compare October 2, 2024 08:23
@Honny1 Honny1 changed the title CI: Fix git-validation CI: Fix git-validation.sh Oct 2, 2024
@Honny1 Honny1 marked this pull request as ready for review October 2, 2024 08:40
@rhatdan
Copy link
Member

rhatdan commented Oct 2, 2024

LGTM
@cevich @edsantiago @lsm5 PTAL

@lsm5
Copy link
Member

lsm5 commented Oct 2, 2024

lgtm. I'll defer to Ed and Chris (if he still bothers with PRs here) :D for final review and merge.

@kwilczynski
Copy link
Member

/approve
/lgtm

Copy link
Contributor

openshift-ci bot commented Oct 2, 2024

@kwilczynski: changing LGTM is restricted to collaborators

In response to this:

/approve
/lgtm

Instructions 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.

Copy link
Member

@edsantiago edsantiago left a comment

Choose a reason for hiding this comment

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

("Request changes" is unfair because I don't yet know what those changes are. Sorry)

Comment on lines 9 to 10
EPOCH_TEST_COMMIT=$CIRRUS_BASE_SHA
if [ -z "${CIRRUS_CI}" ]; then
Copy link
Member

Choose a reason for hiding this comment

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

CIRRUS_BASE_SHA is, as we determined earlier this year, worthless.

I need to understand a lot more of this, like, what happened, what changed, why is main missing, what's the deal with DEST_BRANCH, and it's gonna take me a long time because I'm not familiar with this repo. Blocking until I get some time to understand.

Copy link
Member

Choose a reason for hiding this comment

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

What a rabbit hole! TL;DR this appears to have been broken from the very beginning, and was only caught by happenstance because the error was not (and still is not) causing a CI failure.

Furthermore, the reason this works in podman is because of superconvoluted clone_script and other setup that has presumably been fine-tuned and tested over the years. We no longer have local expertise in such arcana.

Proper solution is too complicated to get into here. It'll involve doing a git clone with proper branch tags for the given branch, and testing it under different branches, and under different conditions (CIRRUS_PR vs TAG vs MERGE vs PURPLEBUTTERFLIES or whatever) and different merge bases. I don't see a good ROI.

Good-enough solution: this approach, but please change as follows:

- if -z CIRRUS_CI
+ if -z EPOCH_TEST_COMMIT

Reason: yes, there's an implicit connection between CIRRUS_BASE_SHA and CIRRUS_CI, but it's much cleaner safer better to just actually test the actual actual, not some sort of distant cousin.

Copy link
Member

Choose a reason for hiding this comment

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

Nice find!

Verified

This commit was signed with the committer’s verified signature.
Honny1 Jan Rodák
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
@Honny1 Honny1 requested a review from edsantiago October 2, 2024 16:06
Copy link
Member

@edsantiago edsantiago left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

Copy link
Contributor

openshift-ci bot commented Oct 2, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: edsantiago, Honny1, kwilczynski

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label Oct 2, 2024
@rhatdan
Copy link
Member

rhatdan commented Oct 8, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Oct 8, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 6c1c6d2 into containers:main Oct 8, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI: hack/git-validation.sh fail
5 participants