Skip to content

Make proxy mode default for npm based managers#148

Merged
Sahilb315 merged 7 commits intomainfrom
feat/#140-make-proxy-mode-default-for-npm
Feb 2, 2026
Merged

Make proxy mode default for npm based managers#148
Sahilb315 merged 7 commits intomainfrom
feat/#140-make-proxy-mode-default-for-npm

Conversation

@Sahilb315
Copy link
Contributor

@Sahilb315 Sahilb315 commented Feb 2, 2026

Closes #140


Open with Devin

Copilot AI review requested due to automatic review settings February 2, 2026 08:03
@Sahilb315 Sahilb315 requested a review from abhisek February 2, 2026 08:03
@codecov-commenter
Copy link

codecov-commenter commented Feb 2, 2026

Codecov Report

❌ Patch coverage is 5.00000% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.39%. Comparing base (b5696f9) to head (7b6acd1).

Files with missing lines Patch % Lines
cmd/executors/npx.go 0.00% 3 Missing ⚠️
cmd/executors/pnpx.go 0.00% 3 Missing ⚠️
cmd/npm/bun.go 0.00% 3 Missing ⚠️
cmd/npm/npm.go 0.00% 3 Missing ⚠️
cmd/npm/pnpm.go 0.00% 3 Missing ⚠️
cmd/npm/yarn.go 0.00% 3 Missing ⚠️
cmd/setup/info.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #148      +/-   ##
==========================================
+ Coverage   37.38%   37.39%   +0.01%     
==========================================
  Files          84       84              
  Lines        5107     5108       +1     
==========================================
+ Hits         1909     1910       +1     
  Misses       3021     3021              
  Partials      177      177              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

🟡 1 issue in files not directly in the diff

🟡 Info command displays incorrect Proxy Mode status by only checking ExperimentalProxyMode (cmd/setup/info.go:38)

The pmg setup info command displays the Proxy Mode status incorrectly by only checking ExperimentalProxyMode instead of using the IsProxyModeEnabled() helper function.

Click to expand

Root Cause

At cmd/setup/info.go:38, the code displays:

configEntries["Proxy Mode"] = strconv.FormatBool(cfg.Config.ExperimentalProxyMode)

However, the actual proxy mode determination at config/config.go:160-161 uses:

func (r *RuntimeConfig) IsProxyModeEnabled() bool {
    return (r.Config.ExperimentalProxyMode || r.Config.ProxyMode)
}

Impact

With the new default configuration where ProxyMode: true and ExperimentalProxyMode: true, users who customize their config to only set proxy_mode: true (without experimental_proxy_mode) will see "Proxy Mode: false" in the info output even though proxy mode is actually enabled. This creates confusion about the actual system state.

Expected vs Actual

  • Expected: Info command should show "Proxy Mode: true" when IsProxyModeEnabled() returns true
  • Actual: Info command shows "Proxy Mode: false" if only proxy_mode is set to true in config

Recommendation: Change line 38 to use the helper function: configEntries["Proxy Mode"] = strconv.FormatBool(cfg.IsProxyModeEnabled())

View issue and 4 additional flags in Devin Review.

Open in Devin Review

@safedep
Copy link

safedep bot commented Feb 2, 2026

SafeDep Report Summary

Green Malicious Packages Badge Green Vulnerable Packages Badge Green Risky License Badge

No dependency changes detected. Nothing to scan.

This report is generated by SafeDep Github App

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates PMG configuration and npm-family command execution so proxy-based interception is enabled by default, and aligns the E2E workflow/docs with that default.

Changes:

  • Switch default proxy mode to enabled in the config template and runtime defaults.
  • Adjust npm ecosystem command flows (npm/pnpm/yarn/bun and npx/pnpx) to treat proxy mode as the default execution path.
  • Update README feature wording and E2E workflow steps to remove reliance on the experimental proxy flag.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
config/config.template.yml Makes proxy_mode default to true and updates related config comments.
config/config.go Changes runtime defaults around proxy mode.
cmd/npm/npm.go Uses proxy flow by default when proxy mode is enabled.
cmd/npm/pnpm.go Uses proxy flow by default when proxy mode is enabled.
cmd/npm/yarn.go Uses proxy flow by default when proxy mode is enabled.
cmd/npm/bun.go Uses proxy flow by default when proxy mode is enabled.
cmd/executors/npx.go Uses proxy flow by default when proxy mode is enabled.
cmd/executors/pnpx.go Uses proxy flow by default when proxy mode is enabled.
README.md Updates feature bullet to reflect proxy-based analysis.
.github/workflows/pmg-e2e.yml Removes --experimental-proxy-mode usage to reflect new default behavior.

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sahilb315 and others added 3 commits February 2, 2026 14:08
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Sahil Bansal <bansalsahil315@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Sahil Bansal <bansalsahil315@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Sahil Bansal <bansalsahil315@gmail.com>
@Sahilb315 Sahilb315 merged commit 28c7b6c into main Feb 2, 2026
14 checks passed
@Sahilb315 Sahilb315 deleted the feat/#140-make-proxy-mode-default-for-npm branch February 2, 2026 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make Proxy Mode as Default for Npm Ecosystem

4 participants