
The old one wasn't linking, and https://github.com/zed-industries/zed/pull/29081 has a bunch of merge conflicts. Wanted to start simple/small. ## Todo * [x] Remove low-signal examples * [x] Make the eval run on a cron, on main, and on any PR with the `run-eval` label * [x] Noise in logs about failure to write settings ``` [2025-04-21T20:45:04Z ERROR settings] Failed to write settings to file "/home/runner/.config/zed/settings.json" Caused by: No such file or directory (os error 2) at path "/home/runner/.config/zed/.tmpLewFEs" ``` * [x] `Agentic loop stalled` (https://github.com/zed-industries/zed/actions/runs/14581044243/job/40897622894) * [x] Make sure that events are recorded in snowflake * [ ] Change judge criteria to be more explicit about meanings of scores Release Notes: - N/A --------- Co-authored-by: Antonio Scandurra <me@as-cii.com> Co-authored-by: Agus Zubiaga <hi@aguz.me> Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com> Co-authored-by: Thomas Mickley-Doyle <tmickleydoyle@gmail.com>
29 lines
820 B
Rust
29 lines
820 B
Rust
use anyhow::{Result, anyhow};
|
|
use std::fs;
|
|
use std::path::{Path, PathBuf};
|
|
use uuid::Uuid;
|
|
|
|
pub fn get_or_create_id(path: &Path) -> Result<String> {
|
|
if let Ok(id) = fs::read_to_string(path) {
|
|
let trimmed = id.trim();
|
|
if !trimmed.is_empty() {
|
|
return Ok(trimmed.to_string());
|
|
}
|
|
}
|
|
let new_id = Uuid::new_v4().to_string();
|
|
fs::create_dir_all(path.parent().ok_or_else(|| anyhow!("invalid id path"))?)?;
|
|
fs::write(path, &new_id)?;
|
|
Ok(new_id)
|
|
}
|
|
|
|
pub fn eval_system_id_path() -> PathBuf {
|
|
dirs::data_local_dir()
|
|
.unwrap_or_else(|| PathBuf::from("."))
|
|
.join("zed-eval-system-id")
|
|
}
|
|
|
|
pub fn eval_installation_id_path() -> PathBuf {
|
|
dirs::data_local_dir()
|
|
.unwrap_or_else(|| PathBuf::from("."))
|
|
.join("zed-eval-installation-id")
|
|
}
|