Skip to content

Conversation

@naffers
Copy link

@naffers naffers commented Jan 6, 2022

An attempt at visualising what changes would be required to align the HTTP client with added proxy support. As discussed in this thread.

There's a fair few differences between the got and fetch HTTP clients, which has resulted in what I'd consider some less than desirable changes.

Though hopefully this helps visualise some way the extent of the changes being suggested.

For reference the original PR: #229
b3nk3 PR that refreshes the above: #310

@naffers naffers force-pushed the github-proxy-implementation-port branch from 72e0465 to 24f0319 Compare January 6, 2022 15:10
const gitlab = authenticate(env)
.get(`/projects/${owner}%2F${repo}`)
.times(3)
.times(1)
Copy link
Author

@naffers naffers Jan 6, 2022

Choose a reason for hiding this comment

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

This was changed intentionally so as to not bloat the diffs with additional logic to facilitate what I can only assume was default retry logic contained in the got module.

If the general approach of swapping out got for fetch is decided to be a good idea, then adding this retry logic should be explored then.

@@ -0,0 +1,8 @@
module.exports = class GotPollyFillError extends Error {
Copy link
Author

Choose a reason for hiding this comment

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

This feels dirty but felt like the path of least resistance without rewriting the error handling

@naffers naffers force-pushed the github-proxy-implementation-port branch from 24f0319 to 25b6125 Compare January 6, 2022 15:31
@fgreinacher
Copy link
Contributor

Closing this in favor of #310, thanks for your work so far @naffers!

@fgreinacher fgreinacher closed this Apr 5, 2022
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.

2 participants