Skip to content

Commit de4b70d

Browse files
committed
Rework backport template compiler triage meeting
1 parent 5626c87 commit de4b70d

File tree

7 files changed

+32
-41
lines changed

7 files changed

+32
-41
lines changed

github-graphql/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ pub mod queries {
5353
#[derive(cynic::QueryFragment, Debug)]
5454
pub struct PullRequest {
5555
pub number: i32,
56+
pub author: Option<Actor>,
5657
pub created_at: DateTime,
5758
pub url: Uri,
5859
pub title: String,

src/actions.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ pub struct IssueDecorator {
4343
pub html_url: String,
4444
pub repo_name: String,
4545
pub labels: String,
46+
pub author: String,
4647
pub assignees: String,
4748
// Human (readable) timestamp
4849
pub updated_at_hts: String,

src/github.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ pub struct Issue {
288288
///
289289
/// Example: `https://github.com/octocat/Hello-World/pull/1347`
290290
pub html_url: String,
291-
// User performing an `action`
291+
// User performing an `action` (or PR/issue author)
292292
pub user: User,
293293
pub labels: Vec<Label>,
294294
// Users assigned to the issue/pr after `action` has been performed
@@ -1923,6 +1923,7 @@ impl<'q> IssuesQuery for Query<'q> {
19231923
.map(|u| u.login.as_ref())
19241924
.collect::<Vec<_>>()
19251925
.join(", "),
1926+
author: issue.user.login,
19261927
updated_at_hts: crate::actions::to_human(issue.updated_at),
19271928
fcp_details,
19281929
mcp_details,
@@ -2690,6 +2691,7 @@ impl IssuesQuery for LeastRecentlyReviewedPullRequests {
26902691
comments.last().map(|t| t.1).unwrap_or(pr.created_at),
26912692
);
26922693
let assignees = assignees.join(", ");
2694+
let author = pr.author.expect("checked");
26932695

26942696
Some((
26952697
updated_at,
@@ -2698,6 +2700,7 @@ impl IssuesQuery for LeastRecentlyReviewedPullRequests {
26982700
pr.url.0,
26992701
repository_name,
27002702
labels,
2703+
author.login,
27012704
assignees,
27022705
))
27032706
})
@@ -2708,7 +2711,7 @@ impl IssuesQuery for LeastRecentlyReviewedPullRequests {
27082711
.into_iter()
27092712
.take(50)
27102713
.map(
2711-
|(updated_at, number, title, html_url, repo_name, labels, assignees)| {
2714+
|(updated_at, number, title, html_url, repo_name, labels, author, assignees)| {
27122715
let updated_at_hts = crate::actions::to_human(updated_at);
27132716

27142717
crate::actions::IssueDecorator {
@@ -2717,6 +2720,7 @@ impl IssuesQuery for LeastRecentlyReviewedPullRequests {
27172720
html_url,
27182721
repo_name: repo_name.to_string(),
27192722
labels,
2723+
author,
27202724
assignees,
27212725
updated_at_hts,
27222726
fcp_details: None,
@@ -2905,6 +2909,7 @@ impl IssuesQuery for DesignMeetings {
29052909
.flat_map(|item| match item.content {
29062910
Some(ProjectV2ItemContent::Issue(issue)) => Some(crate::actions::IssueDecorator {
29072911
assignees: String::new(),
2912+
author: String::new(),
29082913
number: issue.number.try_into().unwrap(),
29092914
fcp_details: None,
29102915
mcp_details: None,

templates/_issue.tt

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1-
{% macro render(issue, with_age="") %}"{{issue.title}}" [{{issue.repo_name}}#{{issue.number}}]({{issue.html_url}}){% if issue.mcp_details.zulip_link %} ([Zulip]({{issue.mcp_details.zulip_link}})){% endif %}{% if with_age %} (last review activity: {{issue.updated_at_hts}}){%- endif -%}
1+
{% macro render(issue, with_age="", backport_branch="") %}"{{issue.title}}" [{{issue.repo_name}}#{{issue.number}}]({{issue.html_url}}){% if issue.mcp_details.zulip_link %} ([Zulip]({{issue.mcp_details.zulip_link}})){% endif %}{% if with_age %} (last review activity: {{issue.updated_at_hts}}){%- endif -%}
2+
{%- if backport_branch != "" %}
3+
- Authored by {{ issue.author }}
4+
{%- endif -%}
25
{% if issue.mcp_details.concerns %}{%- for concern in issue.mcp_details.concerns %}
36
- concern: [{{- concern.0 -}}]({{- concern.1 -}})
4-
{%- endfor -%}{% endif -%}{% endmacro %}
7+
{%- endfor -%}{%- endif -%}
8+
{%- if backport_branch %}
9+
<!--
10+
/poll Approve {{ backport_branch | trim_start_matches(pat=":") | trim_end_matches(pat=":") }} backport of #{{issue.number}}?
11+
approve
12+
{%- if backport_branch is containing("stable") %}
13+
approve but does not justify new dot release
14+
decline
15+
{%- endif %}
16+
don't know
17+
-->
18+
{%- endif %}{% endmacro %}

templates/_issues.tt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
{% import "_issue.tt" as issue %}
22

3-
{% macro render(issues, indent="", branch="", with_age=false, empty="No issues at this time.") %}
4-
{#- If "branch" is not empty add a trailing space but no newlines before or after -#}
5-
{%- if branch -%}
6-
{%- set branch = branch ~ " " -%}
7-
{%- endif -%}
3+
{% macro render(issues, indent="", backport_branch="", with_age=false, empty="No issues at this time.") %}
84
{%- for issue in issues %}
9-
{{indent}}- {{ branch }}{{issue::render(issue=issue, with_age=with_age)}}{% else %}
5+
{{indent}}- {{ backport_branch }} {{issue::render(issue=issue, with_age=with_age, backport_branch=backport_branch)}}{% else %}
106
{{indent}}- {{empty}}{% endfor -%}
117
{% endmacro %}

templates/_issues_rfcbot.tt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{%- for issue in issues %}
55
{%- if issue.fcp_details is object %}
66
{{indent}}- {{issue.fcp_details.disposition}}: [{{issue.title}} ({{issue.repo_name}}#{{issue.number}})]({{issue.fcp_details.bot_tracking_comment_html_url}})
7-
{{indent}}{{indent}}-{% for reviewer in issue.fcp_details.pending_reviewers %} @{% if issue.fcp_details.should_mention %}{% else %}_{% endif %}**|{{reviewer.zulip_id}}**{%else%} no pending checkboxs{% endfor %}
7+
{{indent}}{{indent}}-{% for reviewer in issue.fcp_details.pending_reviewers %} @{% if issue.fcp_details.should_mention %}{% else %}_{% endif %}**|{{reviewer.zulip_id}}**{%else%} no pending checkboxes{% endfor %}
88
{{indent}}{{indent}}-{% if issue.fcp_details.concerns|length > 0 %} concerns:{% endif %}{% for concern in issue.fcp_details.concerns %} [{{concern.name}} (by {{concern.reviewer_login}})]({{concern.concern_url}}){%else%} no pending concerns{% endfor -%}
99
{% else %}
1010
{{indent}}- {{issue::render(issue=issue)}}

templates/prioritization_agenda.tt

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -54,38 +54,12 @@ note_id: xxx
5454
## Backport nominations
5555

5656
[T-compiler beta](https://github.com/rust-lang/rust/issues?q=is%3Aall+label%3Abeta-nominated+-label%3Abeta-accepted+label%3AT-compiler) / [T-compiler stable](https://github.com/rust-lang/rust/issues?q=is%3Aall+label%3Astable-nominated+-label%3Astable-accepted+label%3AT-compiler)
57-
{{-issues::render(issues=beta_nominated_t_compiler, branch=":beta:", empty="No beta nominations for `T-compiler` this time.")}}
58-
<!--
59-
/poll Approve beta backport of #12345?
60-
approve
61-
decline
62-
don't know
63-
-->
64-
{{-issues::render(issues=stable_nominated_t_compiler, branch=":stable:", empty="No stable nominations for `T-compiler` this time.")}}
65-
<!--
66-
/poll Approve stable backport of #12345?
67-
approve
68-
approve but does not justify new dot release
69-
decline
70-
don't know
71-
-->
57+
{{-issues::render(issues=beta_nominated_t_compiler, backport_branch=":beta:", empty="No beta nominations for `T-compiler` this time.")}}
58+
{{-issues::render(issues=stable_nominated_t_compiler, backport_branch=":stable:", empty="No stable nominations for `T-compiler` this time.")}}
7259

7360
[T-types stable](https://github.com/rust-lang/rust/issues?q=is%3Aall+label%3Abeta-nominated+-label%3Abeta-accepted+label%3AT-types) / [T-types beta](https://github.com/rust-lang/rust/issues?q=is%3Aall+label%3Astable-nominated+-label%3Astable-accepted+label%3AT-types)
74-
{{-issues::render(issues=beta_nominated_t_types, branch=":beta:", empty="No beta nominations for `T-types` this time.")}}
75-
<!--
76-
/poll Approve beta backport of #12345?
77-
approve
78-
decline
79-
don't know
80-
-->
81-
{{-issues::render(issues=stable_nominated_t_types, branch=":stable:", empty="No stable nominations for `T-types` this time.")}}
82-
<!--
83-
/poll Approve stable backport of #12345?
84-
approve
85-
approve but does not justify new dot release
86-
decline
87-
don't know
88-
-->
61+
{{-issues::render(issues=beta_nominated_t_types, backport_branch=":beta:", empty="No beta nominations for `T-types` this time.")}}
62+
{{-issues::render(issues=stable_nominated_t_types, backport_branch=":stable:", empty="No stable nominations for `T-types` this time.")}}
8963

9064
## PRs S-waiting-on-team
9165

0 commit comments

Comments
 (0)