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

Cirrus: Fix gate task + make lint|validate #5066

Merged

Conversation

cevich
Copy link
Member

@cevich cevich commented Feb 3, 2020

Fixes #5063

@cevich cevich changed the title Fix gate wrong commit WIP: Fix gate wrong commit Feb 3, 2020
@openshift-ci-robot openshift-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L labels Feb 3, 2020
@cevich cevich force-pushed the fix_gate_wrong_commit branch 23 times, most recently from f17ac9f to 2efe315 Compare February 3, 2020 21:01
A recent Makefile change (4ec893a) removed a side-effect necessary
for 'make validation' to pass under automation.  Making things worse,
change 12bd7e9 was found upon investigation to always point at
the latest upstream HEAD.  However, this is rarely a fork-point for
pull-requests.  Further investigation showed the built-in Cirrus-CI,
golang-based git does not obtain sufficient data for the Makefile
command `git merge-base HEAD $${DEST_BRANCH:-master}` to function
properly (in the context of the gate container).

Fix this by customizing the clone operation and slightly adjust the
Makefile command to function as intended in the gate container.  Also
add checks to the validate and lint targets which validate the
variable EPOCH_TEST_COMMIT value is never an empty string or whitespace.

Signed-off-by: Chris Evich <cevich@redhat.com>
@cevich cevich changed the title WIP: Fix gate wrong commit Fix gate wrong commit Feb 3, 2020
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 3, 2020
@cevich cevich changed the title Fix gate wrong commit Cirrus: Fix gate task + make lint|validate Feb 3, 2020
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.

Filing as comment, not blocker. If this is truly urgent, I will accept someone else's LGTM with a promise that these issues will be fixed soon.

@@ -146,6 +149,7 @@ endif

.PHONY: lint
lint: golangci-lint
@echo "Linting vs commit '$(call err_if_empty,EPOCH_TEST_COMMIT)'"
Copy link
Member

Choose a reason for hiding this comment

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

I don't think EPOCH_TEST_COMMIT is actually used here, is it?

Copy link
Member Author

Choose a reason for hiding this comment

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

TBH I'm not sure if it's used by the underlying linting tool or not. I'm not opposed to removing it.

Copy link
Member

Choose a reason for hiding this comment

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

lint acts on a snapshot, i.e. the current source tree. It should not know or care about git history.

@@ -3,7 +3,7 @@ export GOPROXY=https://proxy.golang.org

GO ?= go
DESTDIR ?=
EPOCH_TEST_COMMIT ?= $(shell git merge-base HEAD $${DEST_BRANCH:-master})
EPOCH_TEST_COMMIT ?= $(shell git merge-base $${DEST_BRANCH:-master} HEAD)
Copy link
Member

Choose a reason for hiding this comment

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

What is the etymology of this variable name? Since it doesn't seem to be used anywhere else, could it be called GIT_MERGE_BASE instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

My best guess is it's used in other containers/* repos. and that was copy-pasted over here when it was eventually needed. Though arguably a bad name, we might consider keeping it to preserve consistency with the other projects.

Copy link
Member

Choose a reason for hiding this comment

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

I see it used in buildah also. OK, keep it, I can hold my nose.

@@ -93,7 +93,6 @@ gating_task:
CIRRUS_WORKING_DIR: "/usr/src/libpod"
GOPATH: "/go"
GOSRC: "/go/src/github.com/containers/libpod"
EPOCH_TEST_COMMIT: "${CIRRUS_BASE_SHA}"
Copy link
Member

Choose a reason for hiding this comment

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

This now leaves a dangling instance of EPOCH_TEST_COMMIT in a comment in this file; that will confuse future maintainers

Copy link
Member Author

Choose a reason for hiding this comment

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

don't worry, both past and future maintainers are already confused. It's a job requirement 😄

joking aside, I think #5039 will make the situation slightly better.

Copy link
Member Author

Choose a reason for hiding this comment

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

better meaning: I added some comments

@edsantiago
Copy link
Member

/lgtm
/hold

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 3, 2020
@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 3, 2020
@edsantiago
Copy link
Member

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 3, 2020
@rhatdan
Copy link
Member

rhatdan commented Feb 3, 2020

/approve

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cevich, rhatdan

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-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 3, 2020
@openshift-merge-robot openshift-merge-robot merged commit c4f6d56 into containers:master Feb 4, 2020
@cevich cevich deleted the fix_gate_wrong_commit branch June 30, 2021 18:04
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cirrus-CI: Gate job lint/validation fails with error 128
5 participants