Repository navigation
Description
Summary
PR #165 (provider-interfaces) refactored runProductionPipeline in internal/aireport/runner.go to pass a ContractCoverageProvider to runCRAPStep instead of calling BuildContractCoverageFunc directly. This changed how SSA degradation data flows into payload.Summary.
Before (pre-#165)
// runner.go — BuildContractCoverageFunc called directly in runProductionPipeline
ccFunc, degradedPkgs := crap.BuildContractCoverageFunc(patterns, moduleDir, stderr)
if len(degradedPkgs) > 0 {
payload.Summary.SSADegraded = true
payload.Summary.SSADegradedPackages = append(
payload.Summary.SSADegradedPackages, degradedPkgs...)
}SSA degradation from the contract coverage build was written to payload.Summary from two sources:
- The
BuildContractCoverageFunccall (above) — before the CRAP step - The quality step (Step 2) — via
qualRes.SSADegraded
After (#165)
// runner.go — provider passed to runCRAPStep
ccProvider := goprovider.NewContractCoverageProvider(stderr)
// ... passed to steps.crapStep(...)The provider's Build() is now called inside crap.Analyze(), which writes degradation data to crap.Options.SSADegradedPackages → crap.Summary.SSADegradedPackages → CRAP JSON output. But crapStepResult does not carry SSADegradedPackages, so this data is not propagated back to payload.Summary.
payload.Summary.SSADegraded now only reflects degradation from the quality step (Step 2, runner.go:306-308).
Impact
Low risk in practice: Both the CRAP step (via ContractCoverageProvider.Build) and the quality step analyze the same packages, so the quality step captures the same degraded packages. The SSA degradation data is also present in the CRAP JSON output (crap.Summary.SSADegradedPackages).
Edge case: If a future change causes the two steps to analyze different package sets, or if the quality step fails entirely while the CRAP step succeeds, payload.Summary.SSADegradedPackages could be incomplete compared to the pre-#165 behavior.
Proposed Fix
Add SSADegraded and SSADegradedPackages fields to crapStepResult in internal/aireport/runner_steps.go, populated from rpt.Summary.SSADegradedPackages. Propagate them to payload.Summary in runProductionPipeline (mirroring how qualRes.SSADegraded is already handled at runner.go:306).
Affected Files
internal/aireport/runner_steps.go—crapStepResult,runCRAPStepinternal/aireport/runner.go—runProductionPipeline(CRAP result handling)internal/aireport/pipeline_internal_test.go— verify propagation
Severity
LOW — no data loss (degradation info exists in CRAP JSON), no user-facing behavior change in the common case. Defensive fix to restore data flow parity with pre-#165 behavior.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNo status
Activity
fix(aireport): propagate SSA degradation from CRAP step to payload su…
fix(aireport): propagate SSA degradation from CRAP step to payload su…
fix(aireport): propagate SSA degradation from CRAP step to payload su…
fix(aireport): propagate SSA degradation from CRAP step to payload su…