MCPcopy Create free account
hub / github.com/f0rr0/oliphaunt / audit_upstream_fixes

Function audit_upstream_fixes

xtask/src/main.rs:6488–6524  ·  view source on GitHub ↗
(manifest: &SourcesManifest, strict: bool)

Source from the content-addressed store, hash-verified

6486}
6487
6488fn audit_upstream_fixes(manifest: &SourcesManifest, strict: bool) -> Result<()> {
6489 let checkout = Path::new(POSTGRES_PGLITE_PATH);
6490 if !checkout.exists() {
6491 bail!("missing local checkout {}", checkout.display());
6492 }
6493 let postgres = source_by_name(manifest, POSTGRES_PGLITE_SOURCE)?;
6494 println!(
6495 "auditing upstream fixes against {} {}",
6496 postgres.branch, postgres.commit
6497 );
6498
6499 let mut pending_required = Vec::new();
6500 for item in UPSTREAM_AUDIT {
6501 let status = if is_git_ancestor(checkout, item.commit)? {
6502 "included".to_owned()
6503 } else if let Some(replacement) = replacement_for_upstream_item(item.id)? {
6504 format!("replaced ({replacement})")
6505 } else if item.required {
6506 pending_required.push(item.id);
6507 "pending".to_owned()
6508 } else {
6509 "optional".to_owned()
6510 };
6511 println!(
6512 "{status:32} {} {} - {}",
6513 item.id, item.commit, item.description
6514 );
6515 }
6516
6517 if strict && !pending_required.is_empty() {
6518 bail!(
6519 "required upstream fixes are not included in the active source branch: {}",
6520 pending_required.join(", ")
6521 );
6522 }
6523 Ok(())
6524}
6525
6526fn replacement_for_upstream_item(id: &str) -> Result<Option<&'static str>> {
6527 match id {

Callers 1

assetsFunction · 0.85

Calls 4

source_by_nameFunction · 0.85
is_git_ancestorFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected