-
Notifications
You must be signed in to change notification settings - Fork 627
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove fetch override for octokit and versions (#4042)
## Problem Updating octkit auth app to 6.1.1. fails runtime. Not in our tests due to most of the SDK layer is mocked. Only information we catch is a generic Error. ``` HttpError: response.json(...).catch is not a function ``` Via [issue](octokit/auth-app.js#634) @wolfy1339 provides feedback that the cause could be related to overriding the fetch in octokit. In PR #3554 where tracing was introduced also the fetch command was overriden, this due the fact the node fetch was not working properly for tracing HTTP calls, which are in our case the cals to GitHub. This problem seems now to be fixed in the [AWS xray sdk](https://github.com/aws/aws-xray-sdk-node/blob/master/CHANGELOG.md#370). ## Solution The solution is quite simple. Just remove axios as fetch implementation (override) and use the default provide by octokit. ## Testing The problem was not detected in the unit tests. Reason is that the unit test mocking the octokit SDK. In case of an ovrride we have doen. We hsould have added a test using nock to mock the HTTP calls and not the full SDK to catch problems like this in the unit test. By removing the override, we can relay again on the test efforts done by octokit. ## References - fix #3966
- Loading branch information
Showing
10 changed files
with
96 additions
and
480 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 0 additions & 31 deletions
31
lambdas/functions/control-plane/src/axios/fetch-override.test.ts
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
lambdas/functions/control-plane/src/axios/fetch-override.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.