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

jobs: exit ci-k8sio-audit early #22239

Merged
merged 1 commit into from
May 19, 2021

Conversation

spiffxp
Copy link
Member

@spiffxp spiffxp commented May 19, 2021

Two reasons to exit this job early.

First, like any good bash script, exit when there's been an error
or attempt to use an unset variable. This will prevent the job from
opening a mass-deletion PR if the audit script fails. Instead, the job
will fail, which will eventually fire an alert via prow's reporters or
testgrid's alerter.

Second, exit if there are no new changes in the audit/ directory to
push. This should prevent the job from continually rebasing an open PR
without modifying any files in audit/, which will make GitHub
notifications for the PR more meaningful.

This should address the second part of kubernetes/k8s.io#2055

Two reasons to exit this job early.

First, like any good bash script, exit when there's been an error
or attempt to use an unset variable.  This will prevent the job from
opening a mass-deletion PR if the audit script fails. Instead, the job
will fail, which will eventually fire an alert via prow's reporters or
testgrid's alerter.

Second, exit if there are no new changes in the audit/ directory to
push. This should prevent the job from continually rebasing an open PR
without modifying any files in audit/, which will make GitHub
notifications for the PR more meaningful.
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 19, 2021
@k8s-ci-robot k8s-ci-robot requested review from dims and thockin May 19, 2021 06:33
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: spiffxp

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 19, 2021
git push -f "https://${GH_USER}:${GH_TOKEN}@github.com/${GH_USER}/${FORK_GH_REPO}" "HEAD:${FORK_GH_BRANCH}" 2>/dev/null

echo "Creating PR to merge ${GH_USER}:${FORK_GH_BRANCH} into k8s.io:main..." >&2
echo "Creating or updating PR to merge ${GH_USER}:${FORK_GH_BRANCH} into kubernetes:main..." >&2
Copy link
Member

@ameukam ameukam May 19, 2021

Choose a reason for hiding this comment

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

Not blocking but you mean:

Suggested change
echo "Creating or updating PR to merge ${GH_USER}:${FORK_GH_BRANCH} into kubernetes:main..." >&2
echo "Creating or updating PR to merge ${GH_USER}:${FORK_GH_BRANCH} into k8s.io:main..." >&2

?

I would have preferred something like github.com/kubernetes/k8s.io:main.

Copy link
Member Author

Choose a reason for hiding this comment

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

The original message was inconsistent. This brings it into parity with what GitHub shows on PRs:
Screen Shot 2021-05-19 at 1 42 09 PM

That said, I like your message better, will address in followup.

Though honestly I sorta feel like this should be pr-creator's job. The closest it gets is

time="2021-05-19T13:10:22Z" level=info msg="PR kubernetes/k8s.io#2011 will merge cncf-ci:autoaudit-prow into main: audit: update as of 2021-05-19"

@ameukam
Copy link
Member

ameukam commented May 19, 2021

/lgtm
/hold
Remove hold when ready to deploy.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 19, 2021
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 19, 2021
@spiffxp
Copy link
Member Author

spiffxp commented May 19, 2021

/hold cancel
Just missed the most recent audit run, I'll look into triggering another one once that's done

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 19, 2021
@k8s-ci-robot k8s-ci-robot merged commit d50a608 into kubernetes:master May 19, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.22 milestone May 19, 2021
@k8s-ci-robot
Copy link
Contributor

@spiffxp: Updated the job-config configmap in namespace default at cluster test-infra-trusted using the following files:

  • key wg-k8s-infra-trusted.yaml using file config/jobs/kubernetes/wg-k8s-infra/trusted/wg-k8s-infra-trusted.yaml

In response to this:

Two reasons to exit this job early.

First, like any good bash script, exit when there's been an error
or attempt to use an unset variable. This will prevent the job from
opening a mass-deletion PR if the audit script fails. Instead, the job
will fail, which will eventually fire an alert via prow's reporters or
testgrid's alerter.

Second, exit if there are no new changes in the audit/ directory to
push. This should prevent the job from continually rebasing an open PR
without modifying any files in audit/, which will make GitHub
notifications for the PR more meaningful.

This should address the second part of kubernetes/k8s.io#2055

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/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants