Skip to content

fix: require NODE_USE_ENV_PROXY for proxy support - #342

Merged
parkerbxyz merged 18 commits into
betafrom
issue-134-remove-custom-proxy-functionality
Mar 13, 2026
Merged

fix: require NODE_USE_ENV_PROXY for proxy support#342
parkerbxyz merged 18 commits into
betafrom
issue-134-remove-custom-proxy-functionality

Conversation

@parkerbxyz

@parkerbxyzparkerbxyz commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

This PR switches proxy support to Node's native env-proxy handling and makes the required configuration explicit.

What changed

  • fail fast in both main and post when proxy configuration is present without NODE_USE_ENV_PROXY=1
  • document the supported proxy configuration in README.md
  • add regression tests for the proxy guard in both entrypoints
  • keep the existing successful end-to-end coverage and add a smaller proxy-specific workflow check that enables native proxy support, points https_proxy at an unreachable proxy, and asserts the action fails
  • update the test workflow so the same checks also run on pushes to beta

Proxy configuration

When using HTTP_PROXY or HTTPS_PROXY, set NODE_USE_ENV_PROXY=1 on the action step. If you need bypass rules, set NO_PROXY alongside them.

Use Undici's EnvHttpProxyAgent in the shared request client so the beta branch keeps proxy support without relying on NODE_USE_ENV_PROXY or respawning the action process.
Add focused proxy tests and regenerate snapshots/dist.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@parkerbxyz
parkerbxyz changed the base branch from main to betaMarch 12, 2026 18:32
@parkerbxyzparkerbxyz self-assigned this Mar 12, 2026
parkerbxyzand others added 3 commits March 12, 2026 12:19
Add a real end-to-end proxy job that starts a local CONNECT proxy, runs the action with https_proxy, and asserts that traffic actually tunneled through the proxy.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove the extra post-action API request from the proxy workflow job so it only verifies the action succeeds and that proxy traffic occurred.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove the bundled runtime proxy handling and rely on Node's native env-proxy support instead.
Document the required NODE_USE_ENV_PROXY / NODE_OPTIONS setting, fail fast when proxy vars are set without native proxy support enabled, and keep proxy CI coverage on the native path.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@parkerbxyzparkerbxyz changed the title Restore beta proxy env support with EnvHttpProxyAgentfix: rely on native Node proxy supportMar 13, 2026
parkerbxyzand others added 2 commits March 12, 2026 20:49
Fold the native proxy support guard into lib/request.js so the request-related logic stays together without a separate helper file.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Make NODE_USE_ENV_PROXY=1 the only documented and enforced knob for enabling native proxy support.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@parkerbxyzparkerbxyz changed the title fix: rely on native Node proxy supportfix!: require NODE_USE_ENV_PROXY for proxy supportMar 13, 2026
parkerbxyzand others added 2 commits March 12, 2026 21:43
Bump actions org workflow dependencies to their latest major versions where available.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@parkerbxyzparkerbxyz changed the title fix!: require NODE_USE_ENV_PROXY for proxy supportfix!: require NODE_USE_ENV_PROXY for proxy supportMar 13, 2026
parkerbxyzand others added 6 commits March 12, 2026 21:53
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@parkerbxyz
parkerbxyz marked this pull request as ready for review March 13, 2026 05:28
@parkerbxyz
parkerbxyz requested a review from a team as a code ownerMarch 13, 2026 05:28
CopilotAI review requested due to automatic review settings March 13, 2026 05:28
@parkerbxyzparkerbxyz changed the title fix!: require NODE_USE_ENV_PROXY for proxy supportfix: require NODE_USE_ENV_PROXY for proxy supportMar 13, 2026

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR makes proxy behavior explicit by relying on Node.js native env-proxy handling and failing fast when proxy env vars are set without NODE_USE_ENV_PROXY=1, with accompanying docs and test/workflow coverage.

Changes:

  • Add a proxy configuration guard (ensureNativeProxySupport) and invoke it in both main and post entrypoints.
  • Add regression tests and update AVA snapshots for the proxy guard behavior.
  • Update README and CI workflow to document and validate the new proxy requirement (including a proxy-failure E2E job and running on beta pushes).

Reviewed changes

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

Show a summary per file
FileDescription
lib/request.jsIntroduces proxy env detection and the ensureNativeProxySupport guard.
main.jsCalls the new guard during action startup.
post.jsCalls the new guard during post-step startup.
tests/index.jsSanitizes proxy-related env vars for deterministic test execution.
tests/main-proxy-requires-native-support.test.jsAdds regression test for main proxy guard.
tests/post-proxy-requires-native-support.test.jsAdds regression test for post proxy guard.
tests/snapshots/index.js.mdUpdates snapshot report with new proxy-guard test output.
tests/snapshots/index.js.snapUpdates/creates AVA snapshot data backing the report.
README.mdDocuments required configuration for proxy usage.
.github/workflows/test.ymlRuns tests on beta pushes and adds an E2E job validating failure via unreachable proxy.
dist/main.cjsUpdates bundled output to include the new guard and call site.
dist/post.cjsUpdates bundled output to include the new guard and call site.

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

You can also share your feedback on Copilot code review. Take the survey.

Comment threadpost.js Outdated
Comment threadmain.js Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR makes proxy behavior explicit by switching to Node.js native env-proxy handling and failing early when proxy env vars are set without NODE_USE_ENV_PROXY=1, with accompanying docs, tests, and CI coverage.

Changes:

  • Add a runtime guard (ensureNativeProxySupport) and call it from both main and post entrypoints.
  • Add regression tests + snapshot updates for the new proxy guard behavior.
  • Expand CI to run on beta pushes and add an end-to-end workflow job that validates failure through an unreachable proxy.

Reviewed changes

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

Show a summary per file
FileDescription
lib/request.jsAdds ensureNativeProxySupport() to enforce explicit opt-in to Node’s env proxy support.
main.jsWraps entrypoint in run() and calls proxy guard before executing main logic.
post.jsWraps entrypoint in run() and calls proxy guard before executing post logic.
tests/index.jsClears proxy-related env vars for consistent test execution.
tests/main-proxy-requires-native-support.test.jsRegression test for main entrypoint proxy guard behavior.
tests/post-proxy-requires-native-support.test.jsRegression test for post entrypoint proxy guard behavior.
tests/snapshots/index.js.mdUpdates snapshot report with new proxy-guard test outputs.
tests/snapshots/index.js.snapUpdates underlying AVA snapshot data.
.github/workflows/test.ymlRuns on beta pushes and adds an end-to-end “unreachable proxy” job.
README.mdDocuments proxy configuration and NODE_USE_ENV_PROXY requirement.
dist/main.cjsBundled output reflecting entrypoint + proxy guard changes.
dist/post.cjsBundled output reflecting entrypoint + proxy guard changes.

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

You can also share your feedback on Copilot code review. Take the survey.

Comment threadlib/request.js Outdated
Comment threadREADME.md Outdated
parkerbxyzand others added 2 commits March 12, 2026 22:48
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR makes proxy behavior explicit by switching proxy handling to Node.js native environment proxy support and failing fast when proxy variables are set without enabling that support, with accompanying documentation and regression coverage.

Changes:

  • Add a guard (ensureNativeProxySupport) that throws when HTTP_PROXY/HTTPS_PROXY are set but NODE_USE_ENV_PROXY !== "1".
  • Invoke the guard at startup in both main and post entrypoints (and in built dist/* outputs).
  • Add regression tests + snapshots and a dedicated end-to-end workflow job that validates failure through an unreachable proxy; run workflows on beta pushes too.

Reviewed changes

Copilot reviewed 9 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
FileDescription
lib/request.jsAdds the ensureNativeProxySupport() guard and proxy env detection.
main.jsCalls the proxy guard early via a new run() wrapper before main logic.
post.jsCalls the proxy guard early via a new run() wrapper before post logic.
tests/main-proxy-requires-native-support.test.jsRegression test ensuring main fails fast when proxy is set without native support enabled.
tests/post-proxy-requires-native-support.test.jsRegression test ensuring post fails fast when proxy is set without native support enabled.
tests/index.jsClears proxy-related env vars for deterministic test runs across environments.
tests/snapshots/index.js.mdUpdates human-readable AVA snapshot output to include new proxy-guard tests.
tests/snapshots/index.js.snapAdds the corresponding AVA snapshot data file.
README.mdDocuments required env configuration for proxy usage (NODE_USE_ENV_PROXY).
.github/workflows/test.ymlRuns CI on beta pushes and adds an end-to-end “unreachable proxy” validation job.
dist/main.cjsBundled output updated to include the proxy guard and entrypoint wrapper.
dist/post.cjsBundled output updated to include the proxy guard and entrypoint wrapper.

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

You can also share your feedback on Copilot code review. Take the survey.

@parkerbxyz
parkerbxyz merged commit 54e58b6 into betaMar 13, 2026
3 checks passed
@parkerbxyz
parkerbxyz deleted the issue-134-remove-custom-proxy-functionality branch March 13, 2026 06:18
create-app-token-action-releaserBot pushed a commit that referenced this pull request Mar 13, 2026
# [3.0.0-beta.3](v3.0.0-beta.2...v3.0.0-beta.3) (2026-03-13)
### Bug Fixes
* require `NODE_USE_ENV_PROXY` for proxy support ([#342](#342)) ([54e58b6](54e58b6))
@create-app-token-action-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.0.0-beta.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

parkerbxyz added a commit that referenced this pull request Mar 13, 2026
BREAKING CHANGE: Custom proxy handling has been removed. If you use HTTP_PROXY or HTTPS_PROXY, you must now also set NODE_USE_ENV_PROXY=1 on the action step.
create-app-token-action-releaserBot pushed a commit that referenced this pull request Mar 13, 2026
# [3.0.0-beta.5](v3.0.0-beta.4...v3.0.0-beta.5) (2026-03-13)
* fix!: require `NODE_USE_ENV_PROXY` for proxy support ([#342](#342)) ([d53a1cd](d53a1cd))
### BREAKING CHANGES
* Custom proxy handling has been removed. If you use HTTP_PROXY or HTTPS_PROXY, you must now also set NODE_USE_ENV_PROXY=1 on the action step.
parkerbxyz added a commit that referenced this pull request Mar 14, 2026
This PR switches proxy support to Node's native env-proxy handling and
makes the required configuration explicit.
- fail fast in both `main` and `post` when proxy configuration is
present without `NODE_USE_ENV_PROXY=1`
- document the supported proxy configuration in `README.md`
- add regression tests for the proxy guard in both entrypoints
- keep the existing successful end-to-end coverage and add a smaller
proxy-specific workflow check that enables native proxy support, points
`https_proxy` at an unreachable proxy, and asserts the action fails
- update the test workflow so the same checks also run on pushes to
`beta`
When using `HTTP_PROXY` or `HTTPS_PROXY`, set `NODE_USE_ENV_PROXY=1` on
the action step. If you need bypass rules, set `NO_PROXY` alongside
them.
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
(cherry picked from commit 54e58b6)
parkerbxyz added a commit that referenced this pull request Mar 14, 2026
BREAKING CHANGE: Custom proxy handling has been removed. If you use HTTP_PROXY or HTTPS_PROXY, you must now also set NODE_USE_ENV_PROXY=1 on the action step.
parkerbxyz added a commit that referenced this pull request Mar 14, 2026
BREAKING CHANGE: Custom proxy handling has been removed. If you use HTTP_PROXY or HTTPS_PROXY, you must now also set NODE_USE_ENV_PROXY=1 on the action step.
create-app-token-action-releaserBot pushed a commit that referenced this pull request Mar 14, 2026
# [3.0.0](v2.2.2...v3.0.0) (2026-03-14)
* feat!: node 24 support ([#275](#275)) ([2e564a0](2e564a0))
* fix!: require `NODE_USE_ENV_PROXY` for proxy support ([#342](#342)) ([4451bcb](4451bcb))
### Bug Fixes
* remove custom proxy handling ([#143](#143)) ([dce0ab0](dce0ab0))
### BREAKING CHANGES
* Custom proxy handling has been removed. If you use HTTP_PROXY or HTTPS_PROXY, you must now also set NODE_USE_ENV_PROXY=1 on the action step.
* Requires [Actions Runner v2.327.1](https://github.com/actions/runner/releases/tag/v2.327.1) or later if you are using a self-hosted runner.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@parkerbxyz