Skip to content

Commit d07dff8

Browse files
Skip including unsorted contents
1 parent c18709f commit d07dff8

File tree

2 files changed

+24
-47
lines changed

2 files changed

+24
-47
lines changed

src/main.rs

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,7 @@ use chrono::Duration;
99
use reqwest::header::HeaderMap;
1010
use serde_json as json;
1111

12-
const SKIP_LABELS: &[&str] = &[
13-
"beta-nominated",
14-
"beta-accepted",
15-
"stable-nominated",
16-
"stable-accepted",
17-
"rollup",
18-
];
12+
const SKIP_LABELS: &[&str] = &["rollup"];
1913

2014
const RELNOTES_LABELS: &[&str] = &[
2115
"relnotes",
@@ -65,8 +59,7 @@ fn main() {
6559
let issues = get_issues_by_milestone(&version, "rust");
6660
let mut tracking_rust = TrackingIssues::collect(&issues);
6761

68-
// Skips `beta-accepted` as those PRs were backported onto the
69-
// previous stable.
62+
// Skips some PRs that aren't themselves interesting.
7063
let in_release = issues.iter().filter(|v| {
7164
!v["labels"]["nodes"]
7265
.as_array()
@@ -131,6 +124,22 @@ fn main() {
131124

132125
for issue in tracking_rust.issues.values() {
133126
for (section, (used, _)) in issue.sections.iter() {
127+
if issue.raw["labels"]["nodes"]
128+
.as_array()
129+
.unwrap()
130+
.iter()
131+
.any(|l| l["name"] == "relnotes-tracking-issue")
132+
&& issue.raw["state"] == "CLOSED"
133+
{
134+
assert!(
135+
!*used,
136+
"{} <{}> used despite tracking issue being closed",
137+
issue.raw["title"].as_str().unwrap(),
138+
issue.raw["url"].as_str().unwrap()
139+
);
140+
continue;
141+
}
142+
134143
if *used {
135144
continue;
136145
}
@@ -207,6 +216,7 @@ fn get_issues_by_milestone_inner(
207216
title
208217
url
209218
body
219+
state
210220
labels(last: 100) {{
211221
nodes {{
212222
name
@@ -362,6 +372,11 @@ fn map_to_line_items<'a>(
362372
let number = o["number"].as_u64().unwrap();
363373

364374
if let Some(issue) = tracking_issues.issues.get_mut(&number) {
375+
// If the tracking issue is closed, skip.
376+
if issue.raw["state"] == "CLOSED" {
377+
continue;
378+
}
379+
365380
for (section, (used, lines)) in issue.sections.iter_mut() {
366381
if let Some(contents) = by_section.get_mut(section.as_str()) {
367382
*used = true;

templates/relnotes.md

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,20 @@ Version {{version}} ({{date}})
55

66
Language
77
--------
8-
**relnotes**
98
{{language_relnotes}}
109

11-
**other**
12-
{{language_unsorted}}
13-
1410
<a id="{{version}}-Compiler"></a>
1511

1612
Compiler
1713
--------
18-
**relnotes**
1914
{{compiler_relnotes}}
2015

21-
**other**
22-
{{compiler_unsorted}}
23-
2416
<a id="{{version}}-Libraries"></a>
2517

2618
Libraries
2719
---------
28-
**relnotes**
2920
{{libraries_relnotes}}
3021

31-
**other**
32-
{{libraries_unsorted}}
33-
3422
<a id="{{version}}-Stabilized-APIs"></a>
3523

3624
Stabilized APIs
@@ -40,27 +28,14 @@ Stabilized APIs
4028

4129
Cargo
4230
-----
43-
**relnotes**
4431
{{cargo_relnotes}}
4532

46-
**other**
47-
{{cargo_unsorted}}
48-
49-
<a id="{{version}}-Misc"></a>
50-
51-
Misc
52-
----
53-
5433
<a id="{{version}}-Compatibility-Notes"></a>
5534

5635
Compatibility Notes
5736
-------------------
58-
**relnotes**
5937
{{compat_relnotes}}
6038

61-
**other**
62-
{{compat_unsorted}}
63-
6439
<a id="{{version}}-Internal-Changes"></a>
6540

6641
Internal Changes
@@ -70,17 +45,4 @@ These changes do not affect any public interfaces of Rust, but they represent
7045
significant improvements to the performance or internals of rustc and related
7146
tools.
7247

73-
**relnotes**
7448
{{internal_changes_relnotes}}
75-
76-
**other**
77-
{{internal_changes_unsorted}}
78-
79-
UNSORTED
80-
--------
81-
**relnotes**
82-
{{unsorted_relnotes}}
83-
84-
**other**
85-
{{unsorted}}
86-

0 commit comments

Comments
 (0)