GeezerVison is showing github.com — fix(mcpx): shard packer discovery respects Go build constraints (#6906) by dezren39 · Pull Request #8101 · developing-today/code
Conversation
dezren39
commented
Nov 10, 2026
•
edited by coderabbitai
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Fixes #6906 (queue task 14432).
Problem
e2e-shard-packer.py discover() regex-scanned raw *_test.go text, ignoring Go build constraints. The four realsoftware-tagged e2e tests were dealt into shards and counted in matrix.count, but the untagged shard legs could never report them, so those legs failed the count check (shard test count differs from the init assignment) and the tagged tests never ran in the PR path.
Fix
discover() now mirrors go/build default-context matching for the legs context (no -tags, linux/amd64): evaluates //go:build expressions (recursive-descent: !, &&, ||, parens; satisfied tags = GOOS/GOARCH, unix, gc, cumulative go1.x; any custom tag such as realsoftware or ignore is unsatisfied), legacy // +build lines, and GOOS/GOARCH filename suffixes.
TestMain is no longer counted: it is the package test entry point, go test -list never reports it, and a -run leg can never report it either — the same count-contract defect on current main.
- No
-tags realsoftware added to the per-PR legs; the tagged subset keeps its nightly path (mcpx testing: a labelled real-software subset, pinned by the flake, run nightly #1990).
Evidence
- On the real tree, fixed
discover() returns exactly the untagged go test ./internal/e2e -list ".*" set (364 tests, set-diff empty); pre-fix it returned 369 including the 4 tagged tests + TestMain.
- New regression suite
pkgs/mcpx/scripts/tests/test_e2e_shard_packer.py (the packer had none): 9 tests covering tagged/untagged/default-satisfied constraints, legacy +build, filename suffixes, TestMain, and pack counts — 9/9 pass with the fix, 8/9 fail against the pre-fix packer.
- CI: new step in mcpx-test.yml unit job runs the suite alongside the existing packer-adjacent suites.
![Autofix with [code]smith](/api/image?u=https%3A%2F%2Fcamo.githubusercontent.com%2F33b6f70f3541c4e93f4503d29cbfec051fa1b040d8e0ae9313a51c4ece44a627%2F68747470733a2f2f70722d636f6d6d656e74732d6173736574732e626c61636b736d6974682e73682f636f6465736d6974682f6175746f6669782d776974682d636f6465736d6974682d6461726b2d33782e706e67)
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Summary by CodeRabbit
-
Tests
- Added regression coverage for test discovery across build constraints, platform-specific filenames, legacy build tags, and test entry points.
- CI now runs the shard-packer regression suite alongside existing checks.
-
Chores
- Test discovery now better matches the Linux/amd64 build context, helping ensure tests are assigned to the appropriate shards.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
discover() ignored //go:build constraints, dealing realsoftware-tagged tests into untagged shards whose legs could never report them, failing the shard count check. Evaluate build constraints (//go:build and legacy // +build) and GOOS/GOARCH filename suffixes under the legs default build context (no tags, linux/amd64), and stop counting TestMain, which go test -list never reports. Adds the packer first regression suite (9 tests, 8 fail pre-fix) and a CI step running it.
Codex Review Summary: ❌ Failed
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
❌ Failed 2026-11-10T02:44:40.246088Z We couldn’t complete this review. Comment @codex review to try again. |
b254633 |
PR opened |
ℹ️ 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" or "@codex security review".
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Nov 10, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

Warning
Review limit reached
You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
Next included review available in 34 minutes.
Check out review usage here.
View limit details
-
Limit details: You’ve used the included review currently available.
Learn how review limits work.
Review configuration:
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
76765b97-ae77-4b9d-a613-0ab2ae1b6199
Commits
-
Reviewing files that changed from the base of the PR and between b254633 and d10ae3d.
Files selected for processing: 1
-
pkgs/mcpx/scripts/ci/e2e-shard-packer.py
Walkthrough
-
The shard packer now filters test files for the default linux/amd64 build context, evaluates modern and legacy Go build constraints, and excludes TestMain. A new regression suite checks discovery and packing, and the unit job runs that suite.
Changes: Shard test discovery
| Layer / File(s) |
Summary |
Build-context file selection pkgs/mcpx/scripts/ci/e2e-shard-packer.py |
The packer evaluates filename suffixes and //go:build or legacy // +build constraints for the default linux/amd64 context. |
Discovery, packing, and CI validation pkgs/mcpx/scripts/ci/e2e-shard-packer.py, pkgs/mcpx/scripts/tests/test_e2e_shard_packer.py, .github/workflows/mcpx-test.yml |
Discovery skips files excluded by build selection and omits TestMain. Regression tests check discovery and bucket coverage. The unit job runs the test suite. |
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix · Severity of issue fixed: Medium
Possibly related issues
- Issue 7901: The CI workflow now runs the e2e shard-packer regression suite.
- Issue 1892: The packer’s discovery changes align the sharded matrix with Go’s default test selection.
Possibly related PRs
Merge Risk: Low · previous review b2546
-
The shard workflow remains mergeable, but a malformed build constraint would be harder to locate if initialization fails. Include the filename in that error.
Pre-merge checks: 4 · 1
-
Failed checks: 1 warning
| Check name |
Status |
Explanation |
Resolution |
| Docstring Coverage |
 |
Docstring coverage is 30.77% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… |
Write docstrings for the functions missing them to satisfy the coverage threshold. |
Passed checks: 4 passed
-
| Check name |
Status |
Explanation |
| Description Check |
 |
Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check |
 |
The title clearly identifies the main change: shard packer discovery now respects Go build constraints. |
| Linked Issues check |
 |
For #6906, e2e-shard-packer.py now filters files by Linux/amd64 filename suffixes and evaluates //go:build and legacy // +build constraints. It excludes TestMain, which the untagged `go test -… |
| Out of Scope Changes check |
 |
The changes are limited to build-aware e2e test discovery, regression tests for that behavior, and a CI step that runs the tests. Each change supports #6906. No unrelated change is evident. |
Full details: Linked Issues check
-
Explanation
For #6906, e2e-shard-packer.py now filters files by Linux/amd64 filename suffixes and evaluates //go:build and legacy // +build constraints. It excludes TestMain, which the untagged go test -list and shard legs do not report. The new regression suite covers tagged and untagged files, default-satisfied constraints, filename suffixes, legacy constraints, TestMain, and packed-name coverage. The workflow runs this suite. The PR reports that discovery matches the current untagged go test -list set and does not add -tags realsoftware to the per-PR legs.
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 30.77% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 13 functions across 2 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
… fails
CodeRabbit finding on PR #8101: a malformed //go:build expression failed
discovery with a traceback naming the expression but not the file.
Wrap the _file_included call in discover() and re-raise as a SystemExit
coverage defect carrying the path. Packer suite 9/9 pass; malformed
fixture now reports the file path.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 21, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
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.
|