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 #1493

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

malis42
Copy link
Contributor

@malis42 malis42 commented Mar 20, 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.

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
  },

This is 3rd attempt to release this fix after previous two were reverted: #1461 and #1433

Reference

Reverts #1468

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 March 20, 2024 12:34
Copy link

changeset-bot bot commented Mar 20, 2024

🦋 Changeset detected

Latest commit: 0e18cb0

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 Minor
@redocly/cli Minor

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 Mar 20, 2024

Command Mean [ms] Min [ms] Max [ms] Relative
redocly lint packages/core/src/benchmark/benches/rebilly.yaml 999.4 ± 46.1 958.2 1125.8 1.00 ± 0.05
redocly-next lint packages/core/src/benchmark/benches/rebilly.yaml 996.9 ± 12.6 976.3 1022.1 1.00

@tatomyr tatomyr marked this pull request as draft March 20, 2024 12:36
Copy link
Contributor

github-actions bot commented Mar 20, 2024

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 76.7% 4408/5747
🟡 Branches 66.99% 2362/3526
🟡 Functions 70.35% 726/1032
🟡 Lines 76.9% 4144/5389
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 0e18cb0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant