Skip to content

Commit 646091b

Browse files
Merge pull request #1904 from fmease/relnotes-tracking-must-be-disposition-merge
Only create a relnotes tracking issue for finished FCPs if they have disposition merge
2 parents 5cc4c25 + e72f53c commit 646091b

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/handlers/relnotes.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ struct RelnotesState {
2727
relnotes_issue: Option<u64>,
2828
}
2929

30+
const TITLE_PREFIX: &str = "Tracking issue for release notes";
31+
3032
pub async fn handle(ctx: &Context, event: &Event) -> anyhow::Result<()> {
3133
let Event::Issue(e) = event else {
3234
return Ok(());
@@ -37,10 +39,7 @@ pub async fn handle(ctx: &Context, event: &Event) -> anyhow::Result<()> {
3739
return Ok(());
3840
}
3941

40-
if e.issue
41-
.title
42-
.starts_with("Tracking issue for release notes")
43-
{
42+
if e.issue.title.starts_with(TITLE_PREFIX) {
4443
// Ignore these issues -- they're otherwise potentially self-recursive.
4544
return Ok(());
4645
}
@@ -64,13 +63,14 @@ pub async fn handle(ctx: &Context, event: &Event) -> anyhow::Result<()> {
6463
}
6564

6665
if let IssuesAction::Labeled { label } = &e.action {
67-
if ["relnotes", "relnotes-perf", "finished-final-comment-period"]
68-
.contains(&label.name.as_str())
69-
{
70-
let title = format!(
71-
"Tracking issue for release notes of #{}: {}",
72-
e.issue.number, e.issue.title
73-
);
66+
let is_fcp_merge = label.name == "finished-final-comment-period"
67+
&& e.issue
68+
.labels
69+
.iter()
70+
.any(|label| label.name == "disposition-merge");
71+
72+
if label.name == "relnotes" || label.name == "relnotes-perf" || is_fcp_merge {
73+
let title = format!("{TITLE_PREFIX} of #{}: {}", e.issue.number, e.issue.title);
7474
let body = format!(
7575
"
7676
This issue tracks the release notes text for #{}.

0 commit comments

Comments
 (0)