(repo: &Repository, report: &IncrementalReport, graph: &mut ReviewGraph)
| 611 | } |
| 612 | |
| 613 | fn project(repo: &Repository, report: &IncrementalReport, graph: &mut ReviewGraph) { |
| 614 | let mut out = Projection::default(); |
| 615 | let project = repo.project_id().expect("resolved project"); |
| 616 | out.node( |
| 617 | "review", |
| 618 | "review", |
| 619 | "Three-pass review (not independent approval)", |
| 620 | encode(&graph.scope), |
| 621 | ); |
| 622 | let excluded: BTreeSet<_> = report |
| 623 | .analyses() |
| 624 | .flat_map(|(_, analysis)| analysis.excluded_metadata_paths.iter()) |
| 625 | .collect(); |
| 626 | if !excluded.is_empty() { |
| 627 | out.node( |
| 628 | "excluded-vault", |
| 629 | "analysis_exclusion", |
| 630 | ".vault metadata excluded from code analysis (retained as evidence)", |
| 631 | json!({"paths": excluded}), |
| 632 | ); |
| 633 | out.edge("review", "excludes_from_code_analysis", "excluded-vault"); |
| 634 | } |
| 635 | for pass in &graph.passes { |
| 636 | out.node( |
| 637 | pass.pass.id(), |
| 638 | "review_pass", |
| 639 | pass.pass.label(), |
| 640 | encode(pass), |
| 641 | ); |
| 642 | out.edge("review", "has_pass", pass.pass.id()); |
| 643 | } |
| 644 | for change in report.changes.iter().filter(|change| change.selected_root) { |
| 645 | let id = |
| 646 | iri::mint_change(&Hash::from_base32(change.hash.as_bytes()).expect("resolved hash")); |
| 647 | out.node(&id, "change", &change.hash, json!({"hash": change.hash})); |
| 648 | out.edge("review", "reviews", &id); |
| 649 | project_checks(&mut out, &change.analysis); |
| 650 | project_metrics(&mut out, &change.hash, &change.analysis, &project, None); |
| 651 | } |
| 652 | if let Some(snapshot) = &report.view_snapshot { |
| 653 | out.node(&snapshot.source_ref,"view_snapshot",&format!("Recorded view {}",snapshot.view),json!({"source_ref":snapshot.source_ref,"view":snapshot.view,"state":snapshot.state,"membership_hash":snapshot.membership_hash,"paths":snapshot.paths,"conformance":snapshot.conformance})); |
| 654 | out.edge("review", "reviews_snapshot", &snapshot.source_ref); |
| 655 | project_checks(&mut out, &snapshot.analysis); |
| 656 | project_metrics( |
| 657 | &mut out, |
| 658 | &snapshot.source_ref, |
| 659 | &snapshot.analysis, |
| 660 | &project, |
| 661 | Some("view_snapshot"), |
| 662 | ); |
| 663 | } |
| 664 | if let Some(comparison) = &report.view_comparison { |
| 665 | out.node( |
| 666 | &comparison.source_ref, |
| 667 | "view_comparison", |
| 668 | "Paired recorded views", |
| 669 | json!({"from":comparison.from,"to":comparison.to,"before":comparison.before,"after":comparison.after,"diagnostics":comparison.diagnostics,"conformance":comparison.conformance}), |
| 670 | ); |
no test coverage detected