GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: propagate npmrcpath to lockfile shell targets by nickzerjeski · Pull Request #8407 · updatecli/updatecli

Conversation

@nickzerjeski

@nickzerjeski nickzerjeski commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

Fix #7670

Propagate npmrcpath to generated shell targets for lockfile updates by adding NPM_CONFIG_USERCONFIG to target environments when npmrcpath is configured.

Test

To test this pull request, you can run the following commands:

cd pkg/plugins/autodiscovery/npm
go test -run 'TestNew_WithResourceConfig|TestDiscoverManifests_WithResourceConfig'

Additional Information

Checklist

  • I have updated the documentation via pull request in website repository.

Tradeoff

  • The environment variable is injected in shell targets only when npmrcpath is set, so manifests without npmrcpath are unchanged.

Potential improvement

  • Extend the test matrix with a hermetic pnpm/yarn command mock so full TestDiscoverManifests can assert all lockfile target variants without local tool dependencies.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nickzerjeski
fix: propagate npmrcpath to npm lockfile shell targets
57c81f0
Fixes: #7670
Copilot AI review requested due to automatic review settings April 13, 2026 08:53
Copilot AI reviewed Apr 13, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Propagates a configured npmrcpath into generated lockfile-update shell targets by injecting NPM_CONFIG_USERCONFIG, ensuring npm/yarn/pnpm commands use the intended user config.

Changes:

  • Add conditional NPM_CONFIG_USERCONFIG environment variable to shell targets when .SourceNpmrcPath is set
  • Extend autodiscovery tests to assert the manifest includes the new environment variable

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
pkg/plugins/autodiscovery/npm/manifestTemplate.go Injects NPM_CONFIG_USERCONFIG into generated shell target environments (npm/yarn/pnpm blocks) when npmrcpath is configured
pkg/plugins/autodiscovery/npm/main_test.go Adds assertions verifying the generated manifest includes NPM_CONFIG_USERCONFIG and the configured path

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pkg/plugins/autodiscovery/npm/manifestTemplate.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pkg/plugins/autodiscovery/npm/main_test.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pkg/plugins/autodiscovery/npm/manifestTemplate.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

@nickzerjeski
Fix npm manifest env templating and validate YAML
45934c1
Copilot started reviewing on behalf of nickzerjeski April 13, 2026 13:15
View session
@nickzerjeski

nickzerjeski commented Apr 14, 2026

Copy link
Copy Markdown
Contributor Author

@copilot apply changes based on the comments in this thread

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nickzerjeski
Merge branch 'main' into fix-npm-autodiscovery-npmrc-shell-7670
08f2127
@olblak

olblak commented Apr 14, 2026

Copy link
Copy Markdown
Member

Thank you for the pullrequest.
I'll try to find some time to review it

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

loispostula
loispostula reviewed Apr 14, 2026
View reviewed changes
Comment thread pkg/plugins/autodiscovery/npm/manifestTemplate.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

loispostula
loispostula reviewed Apr 14, 2026
View reviewed changes
Comment thread pkg/plugins/autodiscovery/npm/manifestTemplate.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

loispostula
loispostula reviewed Apr 14, 2026
View reviewed changes
Comment thread pkg/plugins/autodiscovery/npm/manifestTemplate.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

loispostula
loispostula previously approved these changes Apr 14, 2026
View reviewed changes

@loispostula loispostula left a comment

Copy link
Copy Markdown
Contributor

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.

Few formatting nit, otherwise looks good! Thanks

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nickzerjeski
style(autodiscovery/npm): align npmrc env template formatting
f921f85
@nickzerjeski
nickzerjeski dismissed loispostula’s stale review via f921f85 April 15, 2026 05:06
loispostula and others added 2 commits April 15, 2026 10:26
@loispostula
Merge branch 'main' into fix-npm-autodiscovery-npmrc-shell-7670
2256f2c
@olblak
Merge branch 'main' into fix-npm-autodiscovery-npmrc-shell-7670
d8ede17
olblak
olblak approved these changes Apr 17, 2026
View reviewed changes
@olblak
olblak enabled auto-merge (squash) April 17, 2026 06:53
@olblak olblak added bug Something isn't working resource-npm labels Apr 17, 2026
@olblak
olblak merged commit e9215c5 into updatecli:main Apr 17, 2026
7 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@nickzerjeski
nickzerjeski deleted the fix-npm-autodiscovery-npmrc-shell-7670 branch April 23, 2026 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@olblak olblak olblak approved these changes
@loispostula loispostula loispostula left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

bug Something isn't working resource-npm

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

npm autodiscovery: propagate npmrcpath to shell targets for lock file updates

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@nickzerjeski @olblak @loispostula
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.