Skip to content

Commit

Permalink
Merge pull request #1813 from apiraino/rework-backport-template-compi…
Browse files Browse the repository at this point in the history
…ler-triage-agenda

Rework backport template compiler triage meeting
  • Loading branch information
jackh726 authored May 24, 2024
2 parents 5626c87 + de4b70d commit 48f29f3
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 41 deletions.
1 change: 1 addition & 0 deletions github-graphql/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ pub mod queries {
#[derive(cynic::QueryFragment, Debug)]
pub struct PullRequest {
pub number: i32,
pub author: Option<Actor>,
pub created_at: DateTime,
pub url: Uri,
pub title: String,
Expand Down
1 change: 1 addition & 0 deletions src/actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ pub struct IssueDecorator {
pub html_url: String,
pub repo_name: String,
pub labels: String,
pub author: String,
pub assignees: String,
// Human (readable) timestamp
pub updated_at_hts: String,
Expand Down
9 changes: 7 additions & 2 deletions src/github.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ pub struct Issue {
///
/// Example: `https://github.com/octocat/Hello-World/pull/1347`
pub html_url: String,
// User performing an `action`
// User performing an `action` (or PR/issue author)
pub user: User,
pub labels: Vec<Label>,
// Users assigned to the issue/pr after `action` has been performed
Expand Down Expand Up @@ -1923,6 +1923,7 @@ impl<'q> IssuesQuery for Query<'q> {
.map(|u| u.login.as_ref())
.collect::<Vec<_>>()
.join(", "),
author: issue.user.login,
updated_at_hts: crate::actions::to_human(issue.updated_at),
fcp_details,
mcp_details,
Expand Down Expand Up @@ -2690,6 +2691,7 @@ impl IssuesQuery for LeastRecentlyReviewedPullRequests {
comments.last().map(|t| t.1).unwrap_or(pr.created_at),
);
let assignees = assignees.join(", ");
let author = pr.author.expect("checked");

Some((
updated_at,
Expand All @@ -2698,6 +2700,7 @@ impl IssuesQuery for LeastRecentlyReviewedPullRequests {
pr.url.0,
repository_name,
labels,
author.login,
assignees,
))
})
Expand All @@ -2708,7 +2711,7 @@ impl IssuesQuery for LeastRecentlyReviewedPullRequests {
.into_iter()
.take(50)
.map(
|(updated_at, number, title, html_url, repo_name, labels, assignees)| {
|(updated_at, number, title, html_url, repo_name, labels, author, assignees)| {
let updated_at_hts = crate::actions::to_human(updated_at);

crate::actions::IssueDecorator {
Expand All @@ -2717,6 +2720,7 @@ impl IssuesQuery for LeastRecentlyReviewedPullRequests {
html_url,
repo_name: repo_name.to_string(),
labels,
author,
assignees,
updated_at_hts,
fcp_details: None,
Expand Down Expand Up @@ -2905,6 +2909,7 @@ impl IssuesQuery for DesignMeetings {
.flat_map(|item| match item.content {
Some(ProjectV2ItemContent::Issue(issue)) => Some(crate::actions::IssueDecorator {
assignees: String::new(),
author: String::new(),
number: issue.number.try_into().unwrap(),
fcp_details: None,
mcp_details: None,
Expand Down
18 changes: 16 additions & 2 deletions templates/_issue.tt
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
{% 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 -%}
{% 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 -%}
{%- if backport_branch != "" %}
- Authored by {{ issue.author }}
{%- endif -%}
{% if issue.mcp_details.concerns %}{%- for concern in issue.mcp_details.concerns %}
- concern: [{{- concern.0 -}}]({{- concern.1 -}})
{%- endfor -%}{% endif -%}{% endmacro %}
{%- endfor -%}{%- endif -%}
{%- if backport_branch %}
<!--
/poll Approve {{ backport_branch | trim_start_matches(pat=":") | trim_end_matches(pat=":") }} backport of #{{issue.number}}?
approve
{%- if backport_branch is containing("stable") %}
approve but does not justify new dot release
decline
{%- endif %}
don't know
-->
{%- endif %}{% endmacro %}
8 changes: 2 additions & 6 deletions templates/_issues.tt
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{% import "_issue.tt" as issue %}

{% macro render(issues, indent="", branch="", with_age=false, empty="No issues at this time.") %}
{#- If "branch" is not empty add a trailing space but no newlines before or after -#}
{%- if branch -%}
{%- set branch = branch ~ " " -%}
{%- endif -%}
{% macro render(issues, indent="", backport_branch="", with_age=false, empty="No issues at this time.") %}
{%- for issue in issues %}
{{indent}}- {{ branch }}{{issue::render(issue=issue, with_age=with_age)}}{% else %}
{{indent}}- {{ backport_branch }} {{issue::render(issue=issue, with_age=with_age, backport_branch=backport_branch)}}{% else %}
{{indent}}- {{empty}}{% endfor -%}
{% endmacro %}
2 changes: 1 addition & 1 deletion templates/_issues_rfcbot.tt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{%- for issue in issues %}
{%- if issue.fcp_details is object %}
{{indent}}- {{issue.fcp_details.disposition}}: [{{issue.title}} ({{issue.repo_name}}#{{issue.number}})]({{issue.fcp_details.bot_tracking_comment_html_url}})
{{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 %}
{{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 %}
{{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 -%}
{% else %}
{{indent}}- {{issue::render(issue=issue)}}
Expand Down
34 changes: 4 additions & 30 deletions templates/prioritization_agenda.tt
Original file line number Diff line number Diff line change
Expand Up @@ -54,38 +54,12 @@ note_id: xxx
## Backport nominations

[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)
{{-issues::render(issues=beta_nominated_t_compiler, branch=":beta:", empty="No beta nominations for `T-compiler` this time.")}}
<!--
/poll Approve beta backport of #12345?
approve
decline
don't know
-->
{{-issues::render(issues=stable_nominated_t_compiler, branch=":stable:", empty="No stable nominations for `T-compiler` this time.")}}
<!--
/poll Approve stable backport of #12345?
approve
approve but does not justify new dot release
decline
don't know
-->
{{-issues::render(issues=beta_nominated_t_compiler, backport_branch=":beta:", empty="No beta nominations for `T-compiler` this time.")}}
{{-issues::render(issues=stable_nominated_t_compiler, backport_branch=":stable:", empty="No stable nominations for `T-compiler` this time.")}}

[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)
{{-issues::render(issues=beta_nominated_t_types, branch=":beta:", empty="No beta nominations for `T-types` this time.")}}
<!--
/poll Approve beta backport of #12345?
approve
decline
don't know
-->
{{-issues::render(issues=stable_nominated_t_types, branch=":stable:", empty="No stable nominations for `T-types` this time.")}}
<!--
/poll Approve stable backport of #12345?
approve
approve but does not justify new dot release
decline
don't know
-->
{{-issues::render(issues=beta_nominated_t_types, backport_branch=":beta:", empty="No beta nominations for `T-types` this time.")}}
{{-issues::render(issues=stable_nominated_t_types, backport_branch=":stable:", empty="No stable nominations for `T-types` this time.")}}

## PRs S-waiting-on-team

Expand Down

0 comments on commit 48f29f3

Please sign in to comment.