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

Merged
merged 5 commits into from
Jun 18, 2024

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: 68a3f63

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 [s] Min [s] Max [s] Relative
redocly lint packages/core/src/benchmark/benches/rebilly.yaml 1.003 ± 0.048 0.969 1.135 1.01 ± 0.05
redocly-next lint packages/core/src/benchmark/benches/rebilly.yaml 0.990 ± 0.016 0.971 1.025 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 77.25% 4499/5824
🟡 Branches 67.5% 2478/3671
🟡 Functions 70.9% 748/1055
🟡 Lines 77.45% 4234/5467
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
62.12% (-3.16% 🔻)
64.29% (-4.29% 🔻)
69.57% (-1.27% 🔻)
62.12% (-3.16% 🔻)
🟡
... / 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

747 tests passing in 105 suites.

Report generated by 🧪jest coverage report action from 68a3f63

docs/installation.md Outdated Show resolved Hide resolved
malis42 and others added 2 commits June 14, 2024 13:21
Co-authored-by: Andrew Tatomyr <andrew.tatomyr@redocly.com>
@malis42 malis42 marked this pull request as ready for review June 17, 2024 09:05
@tatomyr tatomyr merged commit 4c17699 into main Jun 18, 2024
32 checks passed
@tatomyr tatomyr deleted the revert-1468-revert/1.10.2 branch June 18, 2024 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants