Skip to content

Commit 057fa3d

Browse files
authored
Merge pull request #190 from nikomatsakis/normalize-team-asks
Normalize team asks
2 parents 452f943 + 3103a7e commit 057fa3d

36 files changed

+450
-343
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;

gh-cache/@tautschnig.bincode

27 Bytes
Binary file not shown.

gh-cache/@walterhpearce.bincode

1 Byte
Binary file not shown.

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

0 commit comments

Comments
 (0)