[bots] Add ciflow/trunk to PRs that get imported #5795
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 thatciflow/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 addciflow/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:
canRunWorkflows
, which requires either write permissions or an already approved workflow run, so even if someone spoofs their PR by adding the magicDifferential Revision:
string, it should still be okChange 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