Skip to content

CI and Code Scanning

darkstar edited this page Oct 3, 2026 · 2 revisions

CI & Code Scanning

🚦 GitHub Actions annotations

let diagnostic = reporter
    .error("Cannot combine incompatible values")
    .code("E-TYPE")
    .label("src/main.rs", 12, Some(9), Some(5), Some("numeric value"))
    .secondary_label("src/lib.rs", 4, Some(5), Some(8), Some("string declaration"));

reporter.emit_github_actions(&diagnostic)?;
diagprint GitHub Actions
Trace · Debug · Info notice
Warning warning
Error · Fatal error

Primary labels keep the diagnostic's severity; secondary labels are emitted as notices so related locations stay visible without looking like extra failures. Workflow-command data and properties are escaped.

🛡️ SARIF 2.1.0

SarifRenderer produces SARIF for GitHub Code Scanning and any SARIF 2.1.0 consumer:

use diagprint::render::SarifRenderer;

SarifRenderer.write_many("target/diagprint.sarif", [&first, &second])?;

write_many() writes one complete document (not appended JSON fragments) with:

  • SARIF 2.1.0 metadata, deterministic rule IDs and indices, severity mapping;
  • primary and related locations with exclusive end-column ranges;
  • notes, help, causes, and diagprint source-revision metadata.

No synthetic fingerprints are invented.

📊 Baselines and deltas

Canonical fingerprints and report digests make runs comparable: semantic report deltas and baseline-aware CI evaluation flag what's new rather than everything, and delta annotations are available for GitHub Actions. The delta format is specified in docs/delta-v1.md.

📦 Artifacts and capsules

Exact-byte artifact receipts and transactional artifact persistence (artifact-store feature) keep CI outputs verifiable; capsules bundle a scan for later verification:

diagprint scan . --static --history .diagprint/history --capsule reports/project.diagpack
diagprint capsule verify reports/project.diagpack

← 🖨️ Rendering & Output  ·  🌉 Ecosystem Interop →

🩺 diagprint

⚡ Start

🧱 Build

📤 Ship

🔧 Fix

🔬 Investigate

🛠️ Project


🌐 Site · 📖 docs.rs · 📦 crates.io

Clone this wiki locally