Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove github caches #301

Merged
merged 7 commits into from
Feb 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 0 additions & 54 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ command = "cargo run -p mdbook-goals --"
[preprocessor.goals.users]
"@Nadrieril" = "@Nadrieril"

preprocessor.goals.ignore_users = [
"@triagebot",
]


[output.html]
git-repository-url = "https://github.com/rust-lang/rust-project-goals"
Expand Down
23 changes: 23 additions & 0 deletions crates/mdbook-goals/src/mdbook_preprocessor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use rust_project_goals::{
const LINKS: &str = "links";
const LINKIFIERS: &str = "linkifiers";
const USERS: &str = "users";
const IGNORE_USERS: &str = "ignore_users";

pub struct GoalPreprocessor;

Expand All @@ -45,6 +46,7 @@ pub struct GoalPreprocessorWithContext<'c> {
links: Vec<(String, String)>,
linkifiers: Vec<(Regex, String)>,
display_names: BTreeMap<String, Rc<String>>,
ignore_users: Vec<String>,
goal_document_map: BTreeMap<PathBuf, Arc<Vec<GoalDocument>>>,
}

Expand All @@ -55,6 +57,7 @@ impl<'c> GoalPreprocessorWithContext<'c> {
let mut links: Vec<(String, String)> = Default::default();
let mut linkifiers = Default::default();
let mut display_names: BTreeMap<String, Rc<String>> = Default::default();
let mut ignore_users: Vec<String> = Default::default();
if let Some(config) = ctx.config.get_preprocessor(GoalPreprocessor.name()) {
if let Some(value) = config.get(LINKS) {
links = value
Expand Down Expand Up @@ -112,6 +115,24 @@ impl<'c> GoalPreprocessorWithContext<'c> {
display_names.insert(user, Rc::new(display_name));
}
}

if let Some(value) = config.get(IGNORE_USERS) {
ignore_users = value
.as_array()
.with_context(|| format!("`{}` must be an array", IGNORE_USERS))?
.iter()
.map(|v| {
if let Some(v) = v.as_str() {
Ok(v.to_string())
} else {
Err(anyhow::anyhow!(
"ignore user value `{}` must be a string",
v
))
}
})
.collect::<anyhow::Result<Vec<_>>>()?;
}
}

Ok(GoalPreprocessorWithContext {
Expand All @@ -122,6 +143,7 @@ impl<'c> GoalPreprocessorWithContext<'c> {
links,
linkifiers,
display_names,
ignore_users,
goal_document_map: Default::default(),
})
}
Expand Down Expand Up @@ -312,6 +334,7 @@ impl<'c> GoalPreprocessorWithContext<'c> {
.username
.find_iter(&chapter.content)
.map(|m| m.as_str().to_string())
.filter(|username| !self.ignore_users.contains(username))
.collect();

for username in &usernames {
Expand Down
6 changes: 3 additions & 3 deletions crates/rust-project-goals-cli-llm/src/updates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ async fn prepare_goals(
let why_this_goal = why_this_goal(&issue_id, issue)?;

let details_summary = match comments.len() {
0 => String::from("No updates posted."),
1 => String::from("1 update posted."),
len => format!("{len} updates posted."),
0 => String::from("No detailed updates available."),
1 => String::from("1 detailed update available."),
len => format!("{len} detailed updates availabled."),
};
result.push(UpdatesGoal {
title: title.clone(),
Expand Down
1 change: 0 additions & 1 deletion crates/rust-project-goals/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ edition = "2021"
[dependencies]
anyhow = "1.0.94"
chrono = "0.4.39"
disk-persist = "0.1.0"
lazy_static = "1.5.0"
regex = "1.11.1"
reqwest = { version = "0.12.9", features = ["blocking", "json"] }
Expand Down
16 changes: 1 addition & 15 deletions crates/rust-project-goals/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use std::{
path::{Path, PathBuf},
};

use disk_persist::DiskPersist;
use walkdir::WalkDir;

pub const ARROW: &str = "↳";
Expand Down Expand Up @@ -59,20 +58,7 @@ pub struct GithubUserInfo {

impl GithubUserInfo {
pub fn load(login: &str) -> anyhow::Result<Self> {
let path = PathBuf::from("gh-cache").join(format!("{}.bincode", login));
let persist = DiskPersist::init_with_path(&path)?;
if let Some(info) = persist.read()? {
Ok(info)
} else {
let info = Self::github_request(login)?;
persist.write(&info)?;
eprintln!(
"cached info for `{}` from github in `{}`",
login,
path.display()
);
Ok(info)
}
Self::github_request(login)
}

fn github_request(login: &str) -> anyhow::Result<Self> {
Expand Down
Binary file removed gh-cache/@1c3t3a.bincode
Binary file not shown.
Binary file removed gh-cache/@BoxyUwU.bincode
Binary file not shown.
Binary file removed gh-cache/@Darksonn.bincode
Binary file not shown.
Binary file removed gh-cache/@Deleted.bincode
Binary file not shown.
Binary file removed gh-cache/@GuillaumeGomez.bincode
Binary file not shown.
Binary file removed gh-cache/@Jamesbarford.bincode
Binary file not shown.
Binary file removed gh-cache/@Kobzol.bincode
Binary file not shown.
Binary file removed gh-cache/@Muscraft.bincode
Binary file not shown.
Binary file removed gh-cache/@SparrowLii.bincode
Binary file not shown.
Binary file removed gh-cache/@ZuseZ4.bincode
Binary file not shown.
Binary file removed gh-cache/@adetaylor.bincode
Binary file not shown.
Binary file removed gh-cache/@amandasystems.bincode
Binary file not shown.
Binary file removed gh-cache/@baumanj.bincode
Binary file not shown.
Binary file removed gh-cache/@blyxyas.bincode
Binary file not shown.
Binary file removed gh-cache/@camelid.bincode
Binary file not shown.
Binary file removed gh-cache/@compiler-errors.bincode
Binary file not shown.
Binary file removed gh-cache/@dingxiangfei2009.bincode
Binary file not shown.
Binary file removed gh-cache/@eh2406.bincode
Binary file not shown.
Binary file removed gh-cache/@eholk.bincode
Binary file not shown.
Binary file removed gh-cache/@epage.bincode
Binary file not shown.
Binary file removed gh-cache/@estebank.bincode
Binary file not shown.
Binary file removed gh-cache/@fee1-dead.bincode
Binary file not shown.
Binary file removed gh-cache/@folkertdev.bincode
Binary file not shown.
Binary file removed gh-cache/@ghost.bincode
Binary file not shown.
Binary file removed gh-cache/@harmou01.bincode
Binary file not shown.
Binary file removed gh-cache/@hi-rustin.bincode
Binary file not shown.
Binary file removed gh-cache/@jaisnan.bincode
Binary file not shown.
Binary file removed gh-cache/@jdonszelmann.bincode
Binary file not shown.
Binary file removed gh-cache/@jkelleyrtp.bincode
Binary file not shown.
Binary file removed gh-cache/@joshtriplett.bincode
Binary file not shown.
Binary file removed gh-cache/@kernel.bincode
Binary file not shown.
Binary file removed gh-cache/@lcnr.bincode
Binary file not shown.
Binary file removed gh-cache/@lqd.bincode
Binary file not shown.
Binary file removed gh-cache/@matthewjasper.bincode
Binary file not shown.
Binary file removed gh-cache/@mrkajetanp.bincode
Binary file not shown.
Binary file removed gh-cache/@nbdd0121.bincode
Binary file not shown.
Binary file removed gh-cache/@nikomatsakis.bincode
Binary file not shown.
Binary file removed gh-cache/@notriddle.bincode
Binary file not shown.
Binary file removed gh-cache/@obi1kenobi.bincode
Binary file not shown.
Binary file removed gh-cache/@oli-obk.bincode
Binary file not shown.
Binary file removed gh-cache/@petrochenkov.bincode
Binary file not shown.
Binary file removed gh-cache/@pnkfelix.bincode
Binary file not shown.
Binary file removed gh-cache/@spastorino.bincode
Binary file not shown.
Binary file removed gh-cache/@tautschnig.bincode
Binary file not shown.
Binary file removed gh-cache/@tmandry.bincode
Binary file not shown.
Binary file removed gh-cache/@traviscross.bincode
Binary file not shown.
Binary file removed gh-cache/@triagebot.bincode
Binary file not shown.
Binary file removed gh-cache/@vabr-g.bincode
Binary file not shown.
Binary file removed gh-cache/@veluca93.bincode
Binary file not shown.
Binary file removed gh-cache/@walterhpearce.bincode
Binary file not shown.
Binary file removed gh-cache/@weihanglo.bincode
Binary file not shown.
2 changes: 1 addition & 1 deletion src/admin/author_updates.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Triagebot can ping project-goal owners for updates. To use it, go to Zulip and execute a command like this (you need to use an `@` in front of triagebot).

```
triagebot ping-goals 14 Oct-21
@triagebot ping-goals 14 Oct-21
```

The first number (14) is a threshold, it is typically set to the current day of the month (e.g., the above command assumes it is Oct 14). It means "if they have posted a comment in the last 14 days, don't bug them".
Expand Down