GeezerVison is showing github.com — mcpx: reproducible man page, single-source version, guard tests for generated artefacts by dezren39 · Pull Request #2537 · developing-today/code
Conversation
dezren39
commented
Oct 30, 2026
•
edited by blacksmith-sh
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Closes #1895.
What changed
Man page is reproducible. ManPage dated itself with time.Now(), and package.nix runs mcpx man in postInstall — so $out/share/man/man1/mcpx.1 embedded the build day and nix build --rebuild could diff across a UTC midnight. The date now comes from SOURCE_DATE_EPOCH (which nixpkgs exports), falling back to a fixed release date, never the clock.
Version has one literal. ldflags now interpolates ${version} instead of repeating 0.1.0, so package.nix carries the literal once. internal/buildcheck asserts package.nix's version, the ldflags stamp and cmd/mcpx/main.go's default agree — and it keeps the e2e binary (built without ldflags) honest.
Generated artefacts are asserted, per the issue's recommended approach C:
- completions carry the version they were generated for (
mcpx <version> header), matching --version;
- every
Commands() entry appears in the man page and in each of bash/zsh/fish;
- an e2e test proves the shipped binary's
--version, man page header and all three completions agree, with the man date taken from SOURCE_DATE_EPOCH.
Verification
go test ./internal/cli/ ./internal/buildcheck/ — pass
go test ./internal/e2e/ -run TestBinaryArtefactsNameTheSameVersion — pass
go build ./..., go vet on the touched packages — clean; gofmt clean on touched files
Note on the issue's 3B
The issue suggests var version = "dev" so an unstamped binary can never be mistaken for a release. This PR keeps 0.1.0 and makes disagreement a test failure instead, which preserves the e2e binary's version report and still removes the drift: the value is written once in package.nix and checked against main.go. Switching the default to dev is a separate, compatible decision for the release pipeline (#158).
![Autofix with [code]smith](/api/image?u=https%3A%2F%2Fcamo.githubusercontent.com%2F33b6f70f3541c4e93f4503d29cbfec051fa1b040d8e0ae9313a51c4ece44a627%2F68747470733a2f2f70722d636f6d6d656e74732d6173736574732e626c61636b736d6974682e73682f636f6465736d6974682f6175746f6669782d776974682d636f6465736d6974682d6461726b2d33782e706e67)
Need help on this PR? Tag @codesmith-bot with what you need.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…enerated artefacts
Closes #1895.
- man page: date from SOURCE_DATE_EPOCH, fixed release fallback instead of
time.Now(), so a pinned Nix build reproduces the page byte for byte.
- version: ldflags now interpolate ${version}, so package.nix carries the
literal once; internal/buildcheck asserts package.nix, the ldflags stamp
and cmd/mcpx/main.go agree.
- generated artefacts are now asserted: man page and all three completions
carry the version, every Commands() entry appears in each of them, and an
e2e test proves the shipped binary's --version, man page and completions
agree.
coderabbitai
Bot
commented
Oct 30, 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 47 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:
34410d0a-8941-42d2-82d0-7c0f4cba8870
Commits
-
Reviewing files that changed from the base of the PR and between 7d1b081 and eb79a58.
Files selected for processing: 9
-
bin/sessions.json
pkgs/mcpx/internal/buildcheck/version_test.go
pkgs/mcpx/internal/cli/completion.go
pkgs/mcpx/internal/cli/completion_test.go
pkgs/mcpx/internal/cli/generated_artefacts_test.go
pkgs/mcpx/internal/cli/manual.go
pkgs/mcpx/internal/cli/root.go
pkgs/mcpx/internal/e2e/artefacts_test.go
pkgs/mcpx/package.nix
- 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
-
Comment @coderabbitai help to get the list of available commands.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Codex Review Summary
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
✅ Completed 2026-10-30T03:09:37.857354Z |
c4e7c3d |
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.
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c4e7c3d468
ℹ️ 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".
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
"-s"
|
|
|
"-w"
|
|
|
"-X main.version=0.1.0"
|
|
|
"-X main.version=${version}"
|
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.
Bind version before interpolating it into ldflags
The argument to buildGo127Module is a non-recursive attribute set, so its version attribute is not in lexical scope for ${version}. There is also no enclosing let binding or function argument named version. Consequently, evaluating the mcpx package through pkgs/default.nix fails with an undefined-variable error, preventing the Nix package from building. Bind the version in an enclosing let, use a recursive attribute set, or use the builder's final-attributes form before referencing it here.
Useful? React with 👍 / 👎.
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.
Fixed in eb79a58: version is now bound once in an enclosing let and inherited into the derivation, so ${version} in ldflags resolves. Verified: nix eval .#packages.x86_64-linux.mcpx.version returns the version and the derivation instantiates (previously undefined-variable), and go test ./internal/buildcheck/ passes — the literal still appears exactly once in package.nix.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
The buildGo127Module argument is a non-recursive attribute set, so
${version} in ldflags had no binding in scope and evaluating the
package failed with an undefined-variable error (Codex P1 on #2537).
Bind version once in an enclosing let and inherit it into the
derivation; the literal still appears exactly once, so the
internal/buildcheck single-source guard still passes, and
nix eval .#packages.x86_64-linux.mcpx.version now returns the version
and the derivation instantiates.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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.
|