review-classifier: skip draft prs, classify once when they leave draft
This commit is contained in:
parent
65d75da8db
commit
49ef93a19e
1 changed files with 280 additions and 34 deletions
|
|
@ -157,6 +157,9 @@ pub struct PullForReview {
|
|||
/// Why `diff` is the forge's `.diff`, with 3 lines of context, rather
|
||||
/// than [`pull_diff::wide`]'s. `None` when it is the wide one.
|
||||
pub narrowed: Option<String>,
|
||||
/// The forge calls the PR a draft (a title starting with a
|
||||
/// work-in-progress prefix).
|
||||
pub draft: bool,
|
||||
}
|
||||
|
||||
/// Files on a repo's branch, as [`Client::default_branch_files`] and
|
||||
|
|
@ -1382,6 +1385,7 @@ impl Client {
|
|||
.await
|
||||
.with_context(|| format!("read PR {number} of {owner}/{repo}"))?;
|
||||
let changed_files = pull.changed_files;
|
||||
let draft = pull.draft.unwrap_or(false);
|
||||
let head_sha = pull
|
||||
.head
|
||||
.and_then(|h| h.sha)
|
||||
|
|
@ -1443,6 +1447,7 @@ impl Client {
|
|||
commits,
|
||||
diff,
|
||||
narrowed,
|
||||
draft,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue