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

tools: avoid crashing CQ when git push fails #36861

Closed
wants to merge 2 commits into from

Conversation

aduh95
Copy link
Contributor

@aduh95 aduh95 commented Jan 10, 2021

This is useful in case someone pushed to the master branch while the CQ was trying to land a PR, or if the CQ bot doesn't have the correct credentials. Currently it silently crashes, without adding a commit-queue-failed label on the PRs; with this PR, it should always add a label and comment on the PR.

/cc @mmarchini

@nodejs-github-bot nodejs-github-bot added the tools Issues and PRs related to the tools directory. label Jan 10, 2021
@aduh95
Copy link
Contributor Author

aduh95 commented Jun 10, 2021

Ping @mmarchini

Copy link
Contributor

@mmarchini mmarchini left a comment

Choose a reason for hiding this comment

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

LGTM. I assume this was not tested, correct? If that's the case I'd suggest whoever lands this to keep an eye on the CQ right after landing to ensure it doesn't break anything, and if it does be ready to open a revert and fast-track it.

Copy link
Contributor

@bl-ue bl-ue left a comment

Choose a reason for hiding this comment

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

Minor typo (not even added in this PR)


rm output output.json
if ! grep -q '. Post "Landed in .*/pull/'"${pr}" output; then
commit_queue_failed "$pr"
# If `git node land --abort` fails, we're in unknown state. Better to stop
# the script here, current PR was removed from the queue so it shouldn't
# interfer again in the future
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# interfer again in the future
# interfere again in the future

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This can be fixed in another PR, this PR may need an immediate revert if it breaks the CQ.

gitHubCurl "$(commentsUrl "${1}")" POST --data @output.json

rm output output.json
}

# TODO(mmarchini): should this be set with whoever added the label for each PR?
git config --local user.email "[email protected]"
Copy link
Contributor

Choose a reason for hiding this comment

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

Still iojs.org?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes

Copy link
Contributor

Choose a reason for hiding this comment

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

Out of curiosity, why? Just haven't gotten around to changing it?

Copy link
Contributor

Choose a reason for hiding this comment

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

Probably. I don't have context on it tbh.

@aduh95 aduh95 added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jun 10, 2021
@aduh95 aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 11, 2021
@github-actions github-actions bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 11, 2021
@github-actions
Copy link
Contributor

Landed in 864195b...240c8bc

@github-actions github-actions bot closed this Jun 11, 2021
nodejs-github-bot pushed a commit that referenced this pull request Jun 11, 2021
@aduh95 aduh95 deleted the cq-recover branch June 11, 2021 08:15
@aduh95
Copy link
Contributor Author

aduh95 commented Jun 11, 2021

CQ just landed #38870 (comment), seems like everything is working as expected 🚀

danielleadams pushed a commit that referenced this pull request Jun 13, 2021
@danielleadams danielleadams mentioned this pull request Jun 14, 2021
danielleadams pushed a commit that referenced this pull request Jun 17, 2021
richardlau pushed a commit that referenced this pull request Jul 19, 2021
richardlau pushed a commit that referenced this pull request Jul 20, 2021
@richardlau richardlau mentioned this pull request Jul 20, 2021
foxxyz pushed a commit to foxxyz/node that referenced this pull request Oct 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. review wanted PRs that need reviews. tools Issues and PRs related to the tools directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants