Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix issues with https-agent-proxy for cli and openapi-core packages #1461

Merged
merged 4 commits into from
Mar 4, 2024

Conversation

malis42
Copy link
Contributor

@malis42 malis42 commented Feb 29, 2024

What/Why/How?

Adding https-proxy-agent package to fix issues with requests when using CLI behind proxy. Create better mechanism for handling env.REDOCLY_DOMAIN usage in few modules.

Now if you need to run the CLI tool behind a proxy, you can use the HTTP_PROXY and HTTPS_PROXY environment variables to configure the proxy settings.

https-proxy-agent package was used for node-fetch requests. Now we pass agent for every fetchWithTimeout request, as well as other regular fetch request.

This is a rollback of a rollback #1458
After encountering problems with some of the packages from https-proxy-agent dependencies, we had to ignore this package for browser environment, by modyfing packages/core/package.json like so:

  "browser": {
    "https-proxy-agent": false
  },

Reference

Resolves #1404
Fixes #529
Fixes #1146
Resolves #1433

Testing

Fixed unit tests. Tested with few CLI commands: push, lint etc.

Screenshots (optional)

n/a

Has code been changed?

Yes

Check yourself

  • Code is linted
  • Tested with redoc/reference-docs/workflows (internal)
  • All new/updated code is covered with tests

Security

  • Security impact of change has been considered
  • Code follows company security practices and guidelines

@malis42 malis42 requested review from a team as code owners February 29, 2024 17:41
Copy link

changeset-bot bot commented Feb 29, 2024

🦋 Changeset detected

Latest commit: 169d259

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@redocly/openapi-core Patch
@redocly/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Feb 29, 2024

Command Mean [ms] Min [ms] Max [ms] Relative
redocly lint packages/core/src/benchmark/benches/rebilly.yaml 980.6 ± 13.7 960.0 1000.3 1.00
redocly-next lint packages/core/src/benchmark/benches/rebilly.yaml 981.0 ± 15.1 953.3 1011.1 1.00 ± 0.02

Copy link
Contributor

github-actions bot commented Feb 29, 2024

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 76.95% 4468/5806
🟡 Branches 67.05% 2362/3523
🟡 Functions 70.41% 728/1034
🟡 Lines 77.17% 4204/5448
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🟢
... / domains.ts
100% 76.92% 100% 100%
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟡
... / config.ts
70.32%
77.3% (+1.11% 🔼)
67.86% (-1.11% 🔻)
70%
🟡
... / index.ts
63.64% (-3.03% 🔻)
67.86% (-3.57% 🔻)
73.91% (-1.09% 🔻)
63.64% (-3.03% 🔻)
🟡
... / push.ts
73.53% 68.46% 54.55% 75.93%
🟡
... / api-client.ts
75.44% (-4.56% 🔻)
41.38% (-4.77% 🔻)
75%
74.55% (-4.62% 🔻)

Test suite run success

722 tests passing in 102 suites.

Report generated by 🧪jest coverage report action from 169d259

@tatomyr tatomyr changed the title Fix issues with https-agent-proxy for cli and openapi-core packages fix: fix issues with https-agent-proxy for cli and openapi-core packages Mar 1, 2024
@malis42 malis42 removed the request for review from a team March 4, 2024 09:52
@malis42 malis42 merged commit 7ec5cfc into main Mar 4, 2024
30 checks passed
@malis42 malis42 deleted the fix/https-proxy-agent-issues-fix branch March 4, 2024 10:02
tatomyr added a commit that referenced this pull request Mar 4, 2024
tatomyr added a commit that referenced this pull request Mar 4, 2024
* Revert "fix: fix issues with https-agent-proxy for cli and openapi-core packages (#1461)"

This reverts commit 7ec5cfc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants