Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions __tests__/proxy-integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ integration('ProxyBuilder', () => {
}
]

const cachedMode = true
const builder = new ProxyBuilder(docker, PROXY_IMAGE_NAME, cachedMode)
const builder = new ProxyBuilder(docker, PROXY_IMAGE_NAME)

beforeAll(async () => {
await ImageService.pull(PROXY_IMAGE_NAME)
Expand Down
12 changes: 6 additions & 6 deletions __tests__/updater-builder-integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ integration('UpdaterBuilder', () => {
})

it('createUpdaterContainer returns a container only connected to the internal network', async () => {
const cachedMode = true
const proxy = await new ProxyBuilder(
docker,
PROXY_IMAGE_NAME,
cachedMode
).run(1, dependabotApiUrl, jobToken, credentials)
const proxy = await new ProxyBuilder(docker, PROXY_IMAGE_NAME).run(
1,
jobToken,
dependabotApiUrl,
credentials
)
await proxy.container.start()
const input = {job: details}
const params = new JobParameters(
Expand Down
8 changes: 2 additions & 6 deletions dist/main/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/main/index.js.map

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions src/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ export type Proxy = {
export class ProxyBuilder {
constructor(
private readonly docker: Docker,
private readonly proxyImage: string,
private readonly cachedMode: boolean
private readonly proxyImage: string
) {}

async run(
Expand Down Expand Up @@ -233,7 +232,6 @@ export class ProxyBuilder {
`no_proxy=${process.env.no_proxy || process.env.NO_PROXY || ''}`,
`JOB_ID=${jobId}`,
`JOB_TOKEN=${jobToken}`,
`PROXY_CACHE=${this.cachedMode ? 'true' : 'false'}`,
`DEPENDABOT_API_URL=${dependabotApiUrl}`,
`ACTIONS_ID_TOKEN_REQUEST_TOKEN=${process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN || ''}`,
`ACTIONS_ID_TOKEN_REQUEST_URL=${process.env.ACTIONS_ID_TOKEN_REQUEST_URL || ''}`
Expand Down
9 changes: 1 addition & 8 deletions src/updater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,7 @@ export class Updater {
* Execute an update job and report the result to Dependabot API.
*/
async runUpdater(): Promise<boolean> {
const cachedMode =
this.details.experiments?.hasOwnProperty('proxy-cached') === true

const proxyBuilder = new ProxyBuilder(
this.docker,
this.proxyImage,
cachedMode
)
const proxyBuilder = new ProxyBuilder(this.docker, this.proxyImage)

const proxy = await proxyBuilder.run(
this.apiClient.params.jobId,
Expand Down
Loading