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

[bots] Add ciflow/trunk to PRs that get imported #5795

Merged
merged 5 commits into from
Oct 23, 2024
Merged

Conversation

clee2000
Copy link
Contributor

@clee2000 clee2000 commented Oct 21, 2024

This should help reduce failures from shipit when a PR is merged internally but waiting for jobs externally.

One of the causes of shipit failing with PR merge is taking a long time (it was still pending after 300 seconds). This will be retried on the next run. is that ciflow/trunk gets added when the merge command gets issued, so the PR waits for trunk to finish before merging the PR to main. Previously, the bot would add ciflow/trunk if the PR was already imported/exported and then got an approval.

This PR changes the bot so that it also adds the label when a PR gets imported.

Also remove comment that assumes author is a metamate that doesn't have write permissions because we can't tell if the author is actually a metamate or if the PR was imported by a metamate on behalf of someone else

Security/workflow running concerns:

  • Bot checks for canRunWorkflows, which requires either write permissions or an already approved workflow run, so even if someone spoofs their PR by adding the magic Differential Revision: string, it should still be ok

Change looks big but most of it is moving the codev ciflow/trunk logic and tests into new files from the previous location in autoLabelBot for easier testing, and moving some functions into utils files

Copy link

vercel bot commented Oct 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
torchci ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 23, 2024 4:38pm

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 21, 2024
@clee2000 clee2000 marked this pull request as ready for review October 21, 2024 23:30
@clee2000 clee2000 requested a review from a team October 21, 2024 23:30
@clee2000 clee2000 merged commit cda8858 into main Oct 23, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants