-
Notifications
You must be signed in to change notification settings - Fork 91
Auto-nominate for backport a pull request fixing a regression #2092
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
7a37ed9
to
9167286
Compare
2484587
to
eb5b382
Compare
dc9450f
to
4f7b659
Compare
4f7b659
to
9682868
Compare
src/handlers/backport.rs
Outdated
for caps in CLOSES_ISSUE_REGEXP.captures_iter(&event.issue.body) { | ||
let id = caps | ||
.name("issue_num") | ||
.expect("Failed to cast issue_num to string") |
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.
.expect("Failed to cast issue_num to string") | |
.with_context(|| format!("failed to get issue_num from {caps:?}"))? |
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.
Does this change actually compile for you? I can't make it compile and it seems to be a bit fiddly to make it work.
Details
error[E0277]: `?` couldn't convert the error to `std::string::String`
--> src/handlers/backport.rs:106:79
|
106 | .with_context(|| format!("failed to get issue_num from {caps:?}"))?;
| -----------------------------------------------------------------^ the trait `From<anyhow::Error>` is not implemented for `std::string::String`
| |
| this can't be annotated with `?` because it has type `Result<_, anyhow::Error>`
|
= note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
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.
I didn't try it locally but I'm surprised it doesn't work.
Looking around, I think it's due to handle_input
not returning anyhow::Result
but std-Result
.
9682868
to
bcb1667
Compare
Co-authored-by: mibac138 <[email protected]>
bcb1667
to
18cd1ce
Compare
From #1184:
We should nominate PRs for backport if any of the following are true:
This patch implements point (1) and adds a check when a new PR is opened. The new
backport.rs
handler tries to figure to out if a PR should be nominated for backport.This handler is enabled by adding a new
[backport]
config item. The format allows multiple instances of the config so teams can handle backports as they wish.The workflow that models the decision to add the backport label is:
#123
, with a t-label (ex. "T-compiler")#456
, adds comment "Fixes#123
"3a. checks if PR has the required team labels (reads from
required_pr_labels
), loads the appropriate config3b. checks if issue has a
regression-from-*
label (reads fromrequired_issue_labels
)3c. checks the P-label of the regression, discard P-low and P-medium regressions
prioritize
command #456 (reads fromadd_labels
)TODOs
Situations not yet handled where this handler should trigger as well:
This work supersedes #1380 (Important: before merge this commit should be Co-authored1)
r?
Footnotes
Not doing now to avoid spamming the original author with multiple forced git push 🙂 ↩