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

refactor: Remove 'util/got' #6523

Merged
merged 6 commits into from Jun 16, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/manager/bazel/update.spec.ts
Expand Up @@ -5,7 +5,7 @@ import { UpdateType } from '../../config';
import { updateDependency } from './update';

jest.mock('hasha');
jest.mock('../../util/got');
jest.mock('got');
zharinov marked this conversation as resolved.
Show resolved Hide resolved

const fromStream: jest.Mock<Promise<string>> = _fromStream as any;

Expand Down
2 changes: 1 addition & 1 deletion lib/manager/homebrew/update.spec.ts
Expand Up @@ -3,7 +3,7 @@ import { fromStream as _fromStream } from 'hasha';
import { updateDependency } from './update';

jest.mock('hasha');
jest.mock('../../util/got');
jest.mock('got');

const fromStream: jest.Mock<Promise<string>> = _fromStream as any;

Expand Down
92 changes: 0 additions & 92 deletions lib/util/got/__snapshots__/index.spec.ts.snap

This file was deleted.

33 changes: 0 additions & 33 deletions lib/util/got/common.ts

This file was deleted.

70 changes: 0 additions & 70 deletions lib/util/got/got.spec.ts

This file was deleted.

59 changes: 0 additions & 59 deletions lib/util/got/index.spec.ts

This file was deleted.

15 changes: 0 additions & 15 deletions lib/util/got/index.ts

This file was deleted.

13 changes: 0 additions & 13 deletions lib/util/got/util.ts

This file was deleted.

3 changes: 2 additions & 1 deletion lib/util/http/index.ts
@@ -1,8 +1,8 @@
import crypto from 'crypto';
import URL from 'url';
import got from 'got';
import * as runCache from '../cache/run';
import { clone } from '../clone';
import got from '../got';
import { applyAuthorization } from './auth';
import { applyHostRules } from './host-rules';

Expand Down Expand Up @@ -55,6 +55,7 @@ export class Http<GetOptions = HttpOptions, PostOptions = HttpPostOptions> {
// TODO: deep merge in order to merge headers
let options: any = {
method: 'get',
retry: 0,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Btw do we need retry=0 for streams? @viceice

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

According to tests, it doesn't do retry though

Copy link
Collaborator

Choose a reason for hiding this comment

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

We do want got to do retrying. Does this disable it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It disables it by default, in order to match current snapshots. Probably, we should adjust snapshots instead.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's revert it then and make whatever changes necessary to get tests to pas s

...this.options,
hostType: this.hostType,
...httpOptions,
Expand Down