Skip to content

Commit 5a045f5

Browse files
authored
Update depdencies (#105)
* Update depdencies lambda runners, remove depracted methods * Update dependencies webhook * Update dependencies sync * Update webhook, not upgrade ocktokit 7.5.0 due breaking changes * Upgrade octokit/webhooks * Add terraform version for examples, upgrade AWS provider to 3.0 * Upgrade jest for webhooks * Upgrade types/node for syncer
1 parent ab2ba19 commit 5a045f5

File tree

13 files changed

+2169
-1979
lines changed

13 files changed

+2169
-1979
lines changed

examples/.terraform-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.12.29

examples/default/main.tf

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ locals {
44
}
55

66
resource "random_password" "random" {
7-
length = 32
7+
length = 28
88
}
99

1010
module "runners" {
@@ -27,12 +27,14 @@ module "runners" {
2727
webhook_secret = random_password.random.result
2828
}
2929

30-
webhook_lambda_zip = "lambdas-download/webhook.zip"
31-
runner_binaries_syncer_lambda_zip = "lambdas-download/runner-binaries-syncer.zip"
32-
runners_lambda_zip = "lambdas-download/runners.zip"
33-
enable_organization_runners = false
34-
runner_extra_labels = "default,example"
30+
# webhook_lambda_zip = "lambdas-download/webhook.zip"
31+
# runner_binaries_syncer_lambda_zip = "lambdas-download/runner-binaries-syncer.zip"
32+
# runners_lambda_zip = "lambdas-download/runners.zip"
33+
enable_organization_runners = false
34+
runner_extra_labels = "default,example"
35+
36+
# instance_type = "a1.large"
3537

3638
# disable KMS and encryption
37-
# encrypt_secrets = false
39+
# encrypt_secrets = true
3840
}

examples/default/providers.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
provider "aws" {
22
region = local.aws_region
3-
version = "2.61"
3+
version = "3.0"
44
}

examples/permissions-boundary/providers.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
provider "aws" {
22
alias = "terraform_role"
33
region = local.aws_region
4-
version = "2.61"
4+
version = "3.0"
55
assume_role {
66
role_arn = data.terraform_remote_state.iam.outputs.role
77
}

modules/runner-binaries-syncer/lambdas/runner-binaries-syncer/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
"dist": "yarn build && cd dist && zip ../runner-binaries-syncer.zip index.js"
1414
},
1515
"devDependencies": {
16-
"@octokit/rest": "^17.6.0",
16+
"@octokit/rest": "^18.0.3",
1717
"@types/jest": "^26.0.4",
18-
"@types/node": "^13.13.4",
18+
"@types/node": "^14.0.27",
1919
"@types/request": "^2.48.4",
2020
"@typescript-eslint/eslint-plugin": "^2.30.0",
2121
"@typescript-eslint/parser": "^2.30.0",

modules/runner-binaries-syncer/lambdas/runner-binaries-syncer/yarn.lock

Lines changed: 680 additions & 722 deletions
Large diffs are not rendered by default.

modules/runners/lambdas/runners/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
},
2525
"dependencies": {
2626
"@octokit/auth-app": "^2.4.5",
27-
"@octokit/rest": "^17.6.0",
27+
"@octokit/rest": "^18.0.3",
2828
"moment": "^2.25.3",
2929
"yn": "^4.0.0"
3030
}

modules/runners/lambdas/runners/src/scale-runners/scale-up.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jest.mock('@octokit/auth-app', () => ({
1111
const mockOctokit = {
1212
checks: { get: jest.fn() },
1313
actions: {
14-
listRepoWorkflowRuns: jest.fn(),
14+
listWorkflowRunsForRepo: jest.fn(),
1515
createRegistrationTokenForOrg: jest.fn(),
1616
createRegistrationTokenForRepo: jest.fn(),
1717
},
@@ -40,7 +40,7 @@ describe('scaleUp', () => {
4040
process.env.ENVIRONMENT = 'unit-test-environment';
4141

4242
jest.clearAllMocks();
43-
mockOctokit.actions.listRepoWorkflowRuns.mockImplementation(() => ({
43+
mockOctokit.actions.listWorkflowRunsForRepo.mockImplementation(() => ({
4444
data: {
4545
total_count: 1,
4646
},
@@ -70,15 +70,15 @@ describe('scaleUp', () => {
7070

7171
it('checks queued workflows', async () => {
7272
await scaleUp('aws:sqs', TEST_DATA);
73-
expect(mockOctokit.actions.listRepoWorkflowRuns).toBeCalledWith({
73+
expect(mockOctokit.actions.listWorkflowRunsForRepo).toBeCalledWith({
7474
owner: TEST_DATA.repositoryOwner,
7575
repo: TEST_DATA.repositoryName,
7676
status: 'queued',
7777
});
7878
});
7979

8080
it('does not list runners when no workflows are queued', async () => {
81-
mockOctokit.actions.listRepoWorkflowRuns.mockImplementation(() => ({
81+
mockOctokit.actions.listWorkflowRunsForRepo.mockImplementation(() => ({
8282
data: { total_count: 0, runners: [] },
8383
}));
8484
await scaleUp('aws:sqs', TEST_DATA);

modules/runners/lambdas/runners/src/scale-runners/scale-up.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export const scaleUp = async (eventSource: string, payload: ActionRequestMessage
5656
const environment = process.env.ENVIRONMENT as string;
5757
const githubAppAuth = await createGithubAppAuth(payload.installationId);
5858
const githubInstallationClient = await createInstallationClient(githubAppAuth);
59-
const queuedWorkflows = await githubInstallationClient.actions.listRepoWorkflowRuns({
59+
const queuedWorkflows = await githubInstallationClient.actions.listWorkflowRunsForRepo({
6060
owner: payload.repositoryOwner,
6161
repo: payload.repositoryName,
6262
// @ts-ignore (typing of the 'status' field is incorrect)

0 commit comments

Comments
 (0)