-
Notifications
You must be signed in to change notification settings - Fork 85
Do not apply labels in autolabel when opening a draft PR #1968
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
base: master
Are you sure you want to change the base?
Conversation
Actually, this won't work on its own, because when a draft PR is opened, it won't get Maybe we should modify autolabel to treat both "opened as non draft" and "converted from draft" as triggering |
I'm thinking if it makes sense applying any kind of post-processing to draft PRs. Is there anything the triagebot needs to do on drafts? Would it be too radical to set a global |
We might go in that direction, yeah. In theory we could just ignore draft PRs completely, and the first time they are converted from draft to open, we could treat it in triagebot as them opening at that very moment. But that would probably require some larger changes. |
Make sense to me. |
Ok, I changed the logic, let me know what do you think. |
src/handlers/autolabel.rs
Outdated
#[derive(Debug, Default, serde::Deserialize, serde::Serialize)] | ||
struct AutolabelState { | ||
new_pr_labels_applied: bool, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#[derive(Debug, Default, serde::Deserialize, serde::Serialize)] | |
struct AutolabelState { | |
new_pr_labels_applied: bool, | |
} | |
#[derive(Debug, Default, serde::Deserialize, serde::Serialize)] | |
struct AutolabelState { | |
has_new_labels: bool, | |
} |
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds a bit confusing/not fully accurate to me, because these labels might not necessarily exist on the PR right now, we just remember that we have already tried to apply the new_pr
labels already. I added a comment to explain this, let me know what you think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we just remember that we have already tried to apply the new_pr labels already
I see. So in plain English it would be:
This flag registers if a PR was previously labeled with the predefined set of labels we apply to all new PRs"
Is that correct? Then maybe already_autolabeled
(or similar)? But I agree, a bit hard to summarize in a short variable name.
(btw, this flag purpose would be more clearer if named is_new_pr
or similar)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new_pr_already_autolabeled
have_new_pr_labels_been_applied
Do you like any of these? 😆 I think that the comment is enough, we probably can't find a completely perfect name for this flag.
After #1963, it doesn't make sense to apply
S-waiting-on-review
to PRs opened as a draft. According to https://github.com/search?type=code&q=org%3Arust-lang+%22new_pr+%3D+true%22, this option is only ever used for addingS-waiting-on-review
in the rust-lang org, so I don't think that we need to complicate the settings by adding some "new_nondraft_pr" setting or something like that.