Repository navigation
fix: stop overwriting process.env.GOPRIVATE in the Go installers - #155
Merged
Merged
Conversation
The atl, esq, n8n and discordctl installers assigned process.env.GOPRIVATE = 'github.com/enthus-appdev/*'. environment-setup imports this package into its own process, so the assignment replaced its GOPRIVATE for every later go call there; the experts install then lost github.com/enthus-ai/* and failed against the public checksum database (environment-setup#497). Every installer already passes GOPRIVATE to its own go install, so the assignment did nothing for the install and is removed. A test guards that no module under lib/ assigns Go module settings to process.env.
There was a problem hiding this comment.
Code Review
This pull request removes direct assignments of GOPRIVATE to process.env across several installer modules (atl, discord, esq, and n8n) to prevent polluting the host process environment. It also adds a regression test to ensure Go environment variables are not directly assigned to process.env. Feedback on the pull request suggests enhancing the regression test's regular expression to also detect bracket notation assignments, ensuring more robust coverage.
ravor-x
marked this pull request as ready for review
December 3, 2026 10:44
smini-digital
left a comment
Contributor
There was a problem hiding this comment.
Comment, not approval. The fix is correct and complements environment-setup#497; the two PRs can merge in either order.
What I checked on b51a838:
- Nothing relied on the removed assignment. Every installer still passes GOPRIVATE to its own
go install: esq and discord viaenv: { ...process.env, GOPRIVATE }, atl and n8n via theGOPRIVATE=… go installprefix. The update path (goToolUpdateinlib/utils/versions.js) calls those same install functions, andlatestGoVersionusesgit ls-remote, which does not read GOPRIVATE. - The new test fails on revert. With
lib/frommain,test/process-env.test.jsfails and lists exactlyinstallers/atl.js,discord.js,esq.jsandn8n.js. On the PR headnpm testpasses 62/62.
Not blocking:
- CI does not run
npm test. The checks are format, lint, CodeQL and the license check, so the new guard only runs locally. This predates the PR, but a test job would make the guard enforced. - environment-setup only gets the fix after a release. Its lockfile pins
@enthus-appdev/llm-cli-setupat 1.15.0, so a version bump there is needed once this is published. - Nit:
goToolUpdatestill setsprocess.env.GOBINprocess-wide. It restores the value infinallyand the installs are synchronous, so I see no real problem today. The new test does not cover GOBIN. - Pre-existing, Windows: the
GOPRIVATE=… go installprefix in atl and n8n is not validcmd.exesyntax, and there is no win32 branch.
smini-digital
approved these changes
Dec 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
The atl, esq, n8n and discordctl installers assign
process.env.GOPRIVATE = 'github.com/enthus-appdev/*'(lib/installers/{atl,esq,n8n,discord}.js). environment-setup imports this package into its own process, so after one of them runs, every latergocall there sees onlygithub.com/enthus-appdev/*. An exported variable also wins overgo env -w, so environment-setup's experts install losesgithub.com/enthus-ai/*, asks the public checksum database about the private module and fails with404 Not Foundon every "Force update all". Diagnosed in enthus-appdev/environment-setup#497.Fix
Every installer already passes GOPRIVATE to its own
go install(env: { ...process.env, GOPRIVATE }in esq and discord, aGOPRIVATE=… go installprefix in atl and n8n). Theprocess.envassignment adds nothing to the install, so it is removed rather than made to extend the value.test/process-env.test.js: no module underlib/assigns GOPRIVATE, GONOSUMDB, GONOPROXY or GOFLAGS toprocess.env.CLAUDE.md: the private-repo pattern now says to pass GOPRIVATE per command and why.environment-setup#497 stays useful on its own: it makes the experts install independent of whatever the shell exports.
Testing
main(lists all four installers) and passes here.npm test: 62/62 pass.eslint lib test: clean.