Skip to content

fix(toolexec): rebuild synthetic test imports - #879

Merged
RomainMuller merged 6 commits into
mainfrom
romain.marcadier/more-cov-fix
Aug 19, 2026
Merged

fix(toolexec): rebuild synthetic test imports#879
RomainMuller merged 6 commits into
mainfrom
romain.marcadier/more-cov-fix

Conversation

@RomainMuller

@RomainMuller RomainMuller commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Implicit test coverage gives the package under test a binary-local archive. Instrumentation-added compiler imports are absent from the Go package graph, so ordinary importer archives can retain a conflicting fingerprint and fail at link time.

Preserve satisfied import provenance and rebuild affected importer closures in a target-specific tool flavor. Carry authoritative archives through nested compilation, record validated closure metadata on the test main, and replay or reconstruct it at link time without polluting ordinary build cache entries.

Keep same-package cycles rejected and add regression coverage for external tests, cache reuse, explicit coverage, and stale metadata.

Fixes #875 (to the extent of what's possible)

Implicit test coverage gives the package under test a binary-local
archive. Instrumentation-added compiler imports are absent from the Go
package graph, so ordinary importer archives can retain a conflicting
fingerprint and fail at link time.

Preserve satisfied import provenance and rebuild affected importer
closures in a target-specific tool flavor. Carry authoritative archives
through nested compilation, record validated closure metadata on the
test main, and replay or reconstruct it at link time without polluting
ordinary build cache entries.

Keep same-package cycles rejected and add regression coverage for
external tests, cache reuse, explicit coverage, and stale metadata.
@RomainMuller
RomainMuller requested a review from a team as a code owner August 18, 2026 15:22

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2f0bbdbd65

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/toolexec/archive/fingerprint.go Outdated
Read compiler fingerprints only from `_go_.o` so package export data
cannot supply a false compatibility identity.

Resolve test target provenance only after finding a synthetic importer
that needs a reverse variant. This preserves test-only packages that have
no ordinary export archive or import configuration entry.
@datadog-prod-us1-5

datadog-prod-us1-5 Bot commented Aug 19, 2026

Copy link
Copy Markdown

🎯 Code Coverage (details)
Patch Coverage: 68.42%
Overall Coverage: 75.04%

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 85c012a | Docs | View more details | Give us feedback!

Exercise reverse-variant environment parsing, archive fingerprint
errors, metadata compatibility, reconstruction guards, and version
flavoring. Add focused integration coverage for rebuilding a standalone
synthetic importer against an authoritative test target.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5a0a3be24a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/toolexec/archive/fingerprint.go Outdated
Parse the documented variable-length textual Go object header instead
of limiting reads to 4 KiB. This preserves fingerprint validation for
valid archives with long build IDs and rejects malformed object members
instead of treating them as fingerprint-free.
Comment thread internal/toolexec/archive/fingerprint_test.go
Comment thread internal/jobserver/pkgs/reversevariants.go
Comment thread internal/toolexec/proxy/testmain_test.go
Comment thread internal/toolexec/aspect/onlink.go Outdated
Inject the reverse-package resolver into cached test-main metadata
refreshes so reconstruction behavior can be exercised without a
jobserver.

Cover successful archive replacement and every reconstruction error,
including fingerprint mismatches. This keeps incompatible archives out
of linker import configuration.
@RomainMuller
RomainMuller requested a review from darccio August 19, 2026 16:11
@RomainMuller
RomainMuller added this pull request to the merge queue Aug 19, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Aug 19, 2026
@RomainMuller
RomainMuller added this pull request to the merge queue Aug 19, 2026
Merged via the queue into main with commit 9e807d1 Aug 19, 2026
63 checks passed
@RomainMuller
RomainMuller deleted the romain.marcadier/more-cov-fix branch August 19, 2026 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Nested coverage can select incompatible test archives

2 participants