Skip to content

Commit

Permalink
Only create a relnotes tracking issue for finished FCPs if they have …
Browse files Browse the repository at this point in the history
…disposition merge
  • Loading branch information
fmease committed Feb 16, 2025
1 parent 5cc4c25 commit e72f53c
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/handlers/relnotes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ struct RelnotesState {
relnotes_issue: Option<u64>,
}

const TITLE_PREFIX: &str = "Tracking issue for release notes";

pub async fn handle(ctx: &Context, event: &Event) -> anyhow::Result<()> {
let Event::Issue(e) = event else {
return Ok(());
Expand All @@ -37,10 +39,7 @@ pub async fn handle(ctx: &Context, event: &Event) -> anyhow::Result<()> {
return Ok(());
}

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

if let IssuesAction::Labeled { label } = &e.action {
if ["relnotes", "relnotes-perf", "finished-final-comment-period"]
.contains(&label.name.as_str())
{
let title = format!(
"Tracking issue for release notes of #{}: {}",
e.issue.number, e.issue.title
);
let is_fcp_merge = label.name == "finished-final-comment-period"
&& e.issue
.labels
.iter()
.any(|label| label.name == "disposition-merge");

if label.name == "relnotes" || label.name == "relnotes-perf" || is_fcp_merge {
let title = format!("{TITLE_PREFIX} of #{}: {}", e.issue.number, e.issue.title);
let body = format!(
"
This issue tracks the release notes text for #{}.
Expand Down

0 comments on commit e72f53c

Please sign in to comment.