(project_root: &Path, project_id: &str)
| 156 | } |
| 157 | |
| 158 | pub fn remove_enrollment_marker(project_root: &Path, project_id: &str) -> Result<bool> { |
| 159 | let path = enrollment_marker_path(project_root); |
| 160 | let Some(marker) = read_enrollment_marker(project_root)? else { |
| 161 | return Ok(false); |
| 162 | }; |
| 163 | if marker.project_id != project_id || marker.storage_mode != StorageMode::ProfileSharded { |
| 164 | return Err(TraceDecayError::Config { |
| 165 | message: format!( |
| 166 | "refusing to remove enrollment marker '{}': it does not match project_id '{}'", |
| 167 | path.display(), |
| 168 | project_id |
| 169 | ), |
| 170 | }); |
| 171 | } |
| 172 | fs::remove_file(&path).map_err(|e| TraceDecayError::Config { |
| 173 | message: format!( |
| 174 | "failed to remove enrollment marker '{}': {e}", |
| 175 | path.display() |
| 176 | ), |
| 177 | })?; |
| 178 | Ok(true) |
| 179 | } |
| 180 | |
| 181 | pub fn profile_sharded_data_root(profile_root: &Path, project_id: &str) -> PathBuf { |
| 182 | profile_root.join("projects").join(project_id) |
no test coverage detected