Skip to content

Commit 3103a7e

Browse files
author
Niko Matsakis
committed
normalize the asks to a fixed set
The set of legal team asks is defined by a global configuration file. The intent is eventually to render them more nicely.
1 parent 867534e commit 3103a7e

32 files changed

+448
-341
lines changed

Cargo.lock

Lines changed: 58 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

book.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ command = "cargo run -p mdbook-goals --"
2323
[preprocessor.goals.users]
2424
"@Nadrieril" = "@Nadrieril"
2525

26+
2627
[output.html]
2728
git-repository-url = "https://github.com/rust-lang/rust-project-goals"
2829
edit-url-template = "https://github.com/rust-lang/rust-project-goals/edit/main/{path}"

crates/rust-project-goals/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ serde_json = "1.0.133"
1515
walkdir = "2.5.0"
1616
rust_team_data = { git = "https://github.com/rust-lang/team" }
1717
rust-project-goals-json = { version = "0.1.0", path = "../rust-project-goals-json" }
18+
toml = "0.8.19"
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
use std::{collections::BTreeMap, path::PathBuf};
2+
3+
use anyhow::Context;
4+
use serde::Deserialize;
5+
6+
#[derive(Deserialize)]
7+
pub struct Configuration {
8+
pub team_asks: BTreeMap<String, String>,
9+
}
10+
11+
impl Configuration {
12+
pub fn get() -> &'static Configuration {
13+
lazy_static::lazy_static! {
14+
static ref CONFIG: Configuration = Configuration::load().unwrap();
15+
}
16+
&*CONFIG
17+
}
18+
19+
fn load() -> anyhow::Result<Configuration> {
20+
let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
21+
let toml_file = manifest_dir.join("../../rust-project-goals.toml");
22+
let toml_string = std::fs::read_to_string(&toml_file).with_context(|| format!("loading configuration from {}", toml_file.display()))?;
23+
Ok(toml::from_str(&toml_string)?)
24+
}
25+
}

crates/rust-project-goals/src/goal.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ use std::path::Path;
33
use std::sync::Arc;
44
use std::{collections::BTreeSet, path::PathBuf};
55

6-
use anyhow::Context;
6+
use anyhow::{bail, Context};
77
use regex::Regex;
88

9+
use crate::config::Configuration;
910
use crate::gh::issue_id::{IssueId, Repository};
1011
use crate::markwaydown::{self, Section, Table};
1112
use crate::re::USERNAME;
@@ -353,7 +354,7 @@ fn extract_metadata(sections: &[Section]) -> anyhow::Result<Option<Metadata>> {
353354
else {
354355
anyhow::bail!("metadata table has no `Owner(s)` row")
355356
};
356-
357+
357358
let Some(status_row) = first_table.rows.iter().find(|row| row[0] == "Status") else {
358359
anyhow::bail!("metadata table has no `Status` row")
359360
};
@@ -524,6 +525,16 @@ impl PlanItem {
524525

525526
let teams = self.teams_being_asked()?;
526527
if !teams.is_empty() {
528+
let config = Configuration::get();
529+
if !config.team_asks.contains_key(&self.text) {
530+
bail!("unrecognized team ask {:?}, team asks must be one of the following:\n{}",
531+
self.text,
532+
config.team_asks.iter().map(|(ask, explanation)| {
533+
format!("* {ask:?}, meaning team should {explanation}")
534+
}).collect::<Vec<_>>().join("\n"),
535+
);
536+
}
537+
527538
asks.push(TeamAsk {
528539
link_path: link_path.clone(),
529540
ask_description: self.text.clone(),

crates/rust-project-goals/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ pub mod markwaydown;
44
pub mod re;
55
pub mod team;
66
pub mod util;
7+
pub mod config;

rust-project-goals.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Configuration for the project-goals code
2+
3+
[team_asks]
4+
"Allocate funds" = "allocate funding"
5+
"Discussion and moral support" = "approve of this direction and be prepared for light discussion on Zulip or elsewhere"
6+
"Design meeting" = "hold a synchronous meeting to review a proposal and provide feedback (no decision expected)"
7+
"Stabilization decision" = "reach a decision on a stabilization proposal"
8+
"Prioritized nominations" = "prioritize discussion and resolution of nominated issues"
9+
"Deploy to production" = "deploy code to production (e.g., on crates.io"
10+
"Standard reviews" = "review PRs (PRs are not expected to be unduly large or complicated)"
11+
"Dedicated reviewer" = "assign a specific person (or people) to review a series of PRs, appropriate for large or complex asks"
12+
"Lang-team experiment" = "begin a [lang-team experiment](https://lang-team.rust-lang.org/how_to/experiment.html) authorizing experimental impl of lang changes before an RFC is written; limited to trusted contributors"
13+
"RFC decision" = "review an RFC and deciding whether to accept"
14+
"RFC secondary review" = "briefly review an RFC without need of a formal decision"
15+
"Org decision" = "reach a decision on an organizational or policy matter"
16+
"MCP decision" = "accept a [Major Change Proposal](https://forge.rust-lang.org/compiler/mcp.html)"
17+
"ACP decision" = "accept an [API Change Proposal](https://std-dev-guide.rust-lang.org/development/feature-lifecycle.html)"
18+
"Policy decision" = "make a decision related to team policy"
19+
"FCP decision(s)" = "make formal decision(s) that require 'checkboxes' and a FCP (Final Comment Period)"
20+
"Blog post approval" = "approve of posting about this on the main Rust blog"
21+
"Miscellaneous" = "do some one-off action as described in the notes"

src/2024h2/ATPIT.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Associated type position impl trait
22

33
| Metadata | |
4-
| --- | --- |
4+
|----------------|------------------------------------|
55
| Owner(s) | @oli-obk |
66
| Teams | [types], [lang] |
77
| Status | Accepted |
@@ -61,9 +61,9 @@ None.
6161
**Owner:** oli-obk owns this goal.
6262

6363
| Subgoal | Owner(s) or team(s) | Notes |
64-
| ---------------------- | ------------------------ | ----- |
64+
|------------------------|--------------------------|-------|
6565
| Implementation | @oli-obk | |
66-
| FCP decisions | ![Team][] [types] | |
66+
| FCP decision(s) | ![Team][] [types] | |
6767
| Stabilization decision | ![Team][] [types] [lang] | |
6868

6969
## Frequently asked questions

src/2024h2/annotate-snippets.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ This section defines the specific work items that are planned and who is expecte
7676
| ↳ switch default rustc output | | |
7777
| ↳ release notes | | |
7878
| ↳ switch ui tests to only check new output | | |
79-
|dedicated reviewer | ![Team][] [compiler] | @estebank will be the reviewer |
79+
|Dedicated reviewer | ![Team][] [compiler] | @estebank will be the reviewer |
8080
| Standard reviews | ![Team][] [compiler] | |
8181
| Top-level Rust blog post inviting feedback |
8282

src/2024h2/rustdoc-search.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Make Rustdoc Search easier to learn
22

33
| Metadata | |
4-
| --- | --- |
4+
|----------------|------------------------------------|
55
| Owner(s) | @notriddle |
66
| Teams | [rustdoc], [rustdoc-frontend] |
77
| Status | Accepted |
@@ -67,17 +67,17 @@ The goal is to reach this point *without trying to be a better Google than Googl
6767

6868
*This section defines the specific work items that are planned and who is expected to do them. It should also include what will be needed from Rust teams. The table below shows some common sets of asks and work, but feel free to adjust it as needed. Every row in the table should either correspond to something done by a contributor or something asked of a team. For items done by a contributor, list the contributor, or ![Heap wanted][] if you don't yet know who will do it. For things asked of teams, list ![Team][] and the name of the team. The things typically asked of teams are defined in the [Definitions](#definitions) section below.*
6969

70-
| Subgoal | Owner(s) or team(s) | Notes |
71-
| --------------------------------------------- | ------------------------------ | ----- |
72-
| Discussion and moral support | ![Team][] [rustdoc] | |
73-
| Improve on any discovered weaknesses | | |
74-
| ↳ Implementation: show type signature in SERP | @notriddle | |
75-
| ↳ Implementation: tweak search algo | @notriddle | |
76-
| ↳ Standard reviews | ![Team][] [rustdoc-frontend] | |
77-
| ↳ Design meeting | ![Team][] [rustdoc-frontend] | |
78-
| ↳ FCP review | ![Team][] [rustdoc-frontend] | |
79-
| Feedback and testing | | |
80-
| ↳ Inside Rust blog post inviting feedback | | |
70+
| Subgoal | Owner(s) or team(s) | Notes |
71+
|-----------------------------------------------|------------------------------|-------|
72+
| Discussion and moral support | ![Team][] [rustdoc] | |
73+
| Improve on any discovered weaknesses | | |
74+
| ↳ Implementation: show type signature in SERP | @notriddle | |
75+
| ↳ Implementation: tweak search algo | @notriddle | |
76+
| ↳ Standard reviews | ![Team][] [rustdoc-frontend] | |
77+
| ↳ Design meeting | ![Team][] [rustdoc-frontend] | |
78+
| ↳ FCP decision(s) | ![Team][] [rustdoc-frontend] | |
79+
| Feedback and testing | | |
80+
| ↳ Inside Rust blog post inviting feedback | | |
8181

8282
### Definitions
8383

0 commit comments

Comments
 (0)