fix: move test coverage collection before packaging phase #294
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes test coverage collection failing with "cannot load module _deps/api-go--lib" by moving it before the packaging phase.
Problem
Error:
Root Cause: Test coverage collection runs AFTER packaging phase deletes
_deps/, butgo tool coverneeds_deps/to rungo list.Affected: Leeway v0.15.0-rc3+ (SLSA-enabled builds only)
What Happened
Commit cdb2518 (November 19, 2025)
Intent: Fix provenance subjects to accurately reflect final artifact (without
_deps/)Change: Moved provenance handling AFTER packaging
Side Effect: Test coverage was moved along with provenance, breaking it
Before commit cdb2518:
After commit cdb2518:
The Fix
Move test coverage back to BEFORE packaging (where it was, and where it needs to be).
This satisfies all requirements:
_deps/forgo list_deps/for scanning_deps/for deterministic builds_deps/)Changes
File:
pkg/leeway/build.goWhat changed:
Build order after fix:
Testing
Related
Impact