FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

build: use purple merge instead of close on CQ by mmarchini · Pull Request #35001 · nodejs/node · GitHub

/ node Public

build: use purple merge instead of close on CQ - #35001

Closed
mmarchini wants to merge 1 commit into
nodejs:masterfrom
mmarchini:purple-cq-lets-goooo
Closed

build: use purple merge instead of close on CQ#35001
mmarchini wants to merge 1 commit into
nodejs:masterfrom
mmarchini:purple-cq-lets-goooo

Conversation

Copy link
Copy Markdown
Contributor

If the bot can make modifications to the head branch, force push to the
head branch so it lands with the purple icon on GitHub instead of the
red icon when the PR is closed. Let's gooooooooo!

Ref: nodejs/node-core-utils#264

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

If the bot can make modifications to the head branch, force push to the
head branch so it lands with the purple icon on GitHub instead of the
red icon when the PR is closed. Let's gooooooooo!

Ref: nodejs/node-core-utils#264
nodejs-github-bot added the tools Issues and PRs related to the tools directory. label Aug 31, 2020

Copy link
Copy Markdown
Contributor Author

I most definitely have not tested it yet 🙃

lundibundi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Should work 😄 , great idea 👍

git node land --abort --yes
else
rm output
head=$(gitHubCurl "$(prUrl "$pr")" GET | jq '{ ref: .head.ref, remote: .head.repo.ssh_url, can_modify: .maintainer_can_modify }')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Could we split the value right here to avoid the "$(echo "$head" .. below so that it will be a bit cleaner. Perhaps like:

head=$(gitHubCurl "$(prUrl "$pr")" GET)
head_ref="$(echo "$head" | jq -r '.head.ref')"
remote_url="$(echo "$head" | jq -r '.head.repo.ssh_url')"
can_modify="$(echo "$head" | jq -r '.maintainer_can_modify')"

if [ "$(echo "$head" | jq -r .can_modify)" == "true" ]; then
git push --force "$(echo "$head" | jq -r .remote)" master:"$(echo "$head" | jq -r .ref)"
# Give GitHub time to sync before pushing to master
sleep 5s

mmarchini Sep 3, 2020
edited
Loading

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I might increase this to a whole minute or something, I just did this manually with a 15 seconds gap between push to PR branch and push to nodejs/node and I still got a race condition.

Note how even though I pushed to the PR branch first, GitHub only registered the event after I pushed to nodejs/node, which lead to the PR getting automatically closed and losing the commits and file changes in the UI

If that's a propagation issue on GitHub (which is what it seems like), an API call to confirm if the push propagated probably wouldn't work :/, so long sleep might be the way to go.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

You have to wait until the origin/pull/123 ref has updated, which a git fetch can verify.

Copy link
Copy Markdown
Member

I think this has been superseded by #40666?

Mesteery closed this Mar 5, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tools Issues and PRs related to the tools directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL