Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

Commit ae9c277

Browse files
authored
feat: add format checking for lambdas in CI (#899) (#1080)
* feat: add fomat checking for lambdas in CI (#899) * FIx build issues. - fix prettier issue - add dependencies for the syncer module - use same eslint in all 3 modules * Fix prettier issue, and update the yarn.lock files
1 parent 946b2ea commit ae9c277

File tree

10 files changed

+40
-8
lines changed

10 files changed

+40
-8
lines changed

Diff for: .github/workflows/lambda-runner-binaries-syncer.yml

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ jobs:
2222
- uses: actions/checkout@v2
2323
- name: Install dependencies
2424
run: yarn install
25+
- name: Run prettier
26+
run: yarn format-check
2527
- name: Run linter
2628
run: yarn lint
2729
- name: Run tests

Diff for: .github/workflows/lambda-runners.yml

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
- uses: actions/checkout@v2
2121
- name: Install dependencies
2222
run: yarn install
23+
- name: Run prettier
24+
run: yarn format-check
2325
- name: Run linter
2426
run: yarn lint
2527
- name: Run tests

Diff for: .github/workflows/lambda-webhook.yml

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
- uses: actions/checkout@v2
2121
- name: Install dependencies
2222
run: yarn install
23+
- name: Run prettier
24+
run: yarn format-check
2325
- name: Run linter
2426
run: yarn lint
2527
- name: Run tests

Diff for: modules/runner-binaries-syncer/lambdas/runner-binaries-syncer/package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@
2323
"@typescript-eslint/parser": "^4.29.1",
2424
"@vercel/ncc": "^0.29.0",
2525
"aws-sdk": "^2.965.0",
26-
"eslint": "^7.24.0",
26+
"eslint": "^7.32.0",
27+
"eslint-plugin-prettier": "3.4.0",
2728
"jest": "^26.6.3",
29+
"prettier": "2.3.2",
2830
"ts-jest": "^26.5.5",
2931
"ts-node-dev": "^1.1.6",
3032
"typescript": "^4.3.4"

Diff for: modules/runner-binaries-syncer/lambdas/runner-binaries-syncer/src/syncer/handler.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ describe('Synchronize action distribution.', () => {
7070
},
7171
};
7272
});
73-
73+
7474
await handle();
7575
expect(mockOctokit.repos.listReleases).toBeCalledTimes(1);
7676
expect(mockS3.getObjectTagging).toBeCalledWith({

Diff for: modules/runner-binaries-syncer/lambdas/runner-binaries-syncer/yarn.lock

+25-1
Original file line numberDiff line numberDiff line change
@@ -1694,6 +1694,13 @@ escodegen@^2.0.0:
16941694
optionalDependencies:
16951695
source-map "~0.6.1"
16961696

1697+
1698+
version "3.4.0"
1699+
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.4.0.tgz#cdbad3bf1dbd2b177e9825737fe63b476a08f0c7"
1700+
integrity sha512-UDK6rJT6INSfcOo545jiaOwB701uAIt2/dR7WnFQoGCVl1/EMqdANBmwUaqqQ45aXprsTGzSa39LI1PyuRBxxw==
1701+
dependencies:
1702+
prettier-linter-helpers "^1.0.0"
1703+
16971704
eslint-scope@^5.1.1:
16981705
version "5.1.1"
16991706
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c"
@@ -1726,7 +1733,7 @@ eslint-visitor-keys@^2.0.0:
17261733
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303"
17271734
integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==
17281735

1729-
eslint@^7.24.0:
1736+
eslint@^7.32.0:
17301737
version "7.32.0"
17311738
resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz#c6d328a14be3fb08c8d1d21e12c02fdb7a2a812d"
17321739
integrity sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==
@@ -1932,6 +1939,11 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3:
19321939
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
19331940
integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==
19341941

1942+
fast-diff@^1.1.2:
1943+
version "1.2.0"
1944+
resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03"
1945+
integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==
1946+
19351947
fast-glob@^3.1.1:
19361948
version "3.2.7"
19371949
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.7.tgz#fd6cb7a2d7e9aa7a7846111e85a196d6b2f766a1"
@@ -3561,6 +3573,18 @@ prelude-ls@~1.1.2:
35613573
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
35623574
integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=
35633575

3576+
prettier-linter-helpers@^1.0.0:
3577+
version "1.0.0"
3578+
resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b"
3579+
integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==
3580+
dependencies:
3581+
fast-diff "^1.1.2"
3582+
3583+
3584+
version "2.3.2"
3585+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.2.tgz#ef280a05ec253712e486233db5c6f23441e7342d"
3586+
integrity sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==
3587+
35643588
pretty-format@^26.0.0, pretty-format@^26.6.2:
35653589
version "26.6.2"
35663590
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-26.6.2.tgz#e35c2705f14cb7fe2fe94fa078345b444120fc93"

Diff for: modules/runners/lambdas/runners/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"@typescript-eslint/eslint-plugin": "^4.29.1",
2323
"@typescript-eslint/parser": "^4.29.1",
2424
"@vercel/ncc": "^0.29.0",
25-
"eslint": "^7.22.0",
25+
"eslint": "^7.32.0",
2626
"eslint-plugin-prettier": "3.4.0",
2727
"jest": "27.0.6",
2828
"jest-mock-extended": "^2.0.1",

Diff for: modules/runners/lambdas/runners/src/scale-runners/scale-up.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ describe('scaleUp with GHES', () => {
271271
expect(mockOctokit.actions.createRegistrationTokenForOrg).not.toBeCalled();
272272
expect(mockOctokit.actions.createRegistrationTokenForRepo).not.toBeCalled();
273273
});
274-
274+
275275
it('creates a token when maximum runners has not been reached', async () => {
276276
await scaleUpModule.scaleUp('aws:sqs', TEST_DATA);
277277
expect(mockOctokit.actions.createRegistrationTokenForOrg).not.toBeCalled();
@@ -481,7 +481,7 @@ describe('scaleUp with public GH', () => {
481481
expect(mockOctokit.actions.createRegistrationTokenForOrg).not.toBeCalled();
482482
expect(mockOctokit.actions.createRegistrationTokenForRepo).not.toBeCalled();
483483
});
484-
484+
485485
it('creates a token when maximum runners has not been reached', async () => {
486486
await scaleUpModule.scaleUp('aws:sqs', TEST_DATA);
487487
expect(mockOctokit.actions.createRegistrationTokenForOrg).not.toBeCalled();

Diff for: modules/webhook/lambdas/webhook/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"@vercel/ncc": "0.29.0",
2727
"aws-sdk": "^2.965.0",
2828
"body-parser": "^1.19.0",
29-
"eslint": "^7.29.0",
29+
"eslint": "^7.32.0",
3030
"eslint-plugin-prettier": "3.4.0",
3131
"express": "^4.17.1",
3232
"jest": "^26.6.3",

Diff for: modules/webhook/lambdas/webhook/yarn.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -2439,7 +2439,7 @@ eslint-visitor-keys@^2.0.0:
24392439
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303"
24402440
integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==
24412441

2442-
eslint@^7.29.0:
2442+
eslint@^7.32.0:
24432443
version "7.32.0"
24442444
resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz#c6d328a14be3fb08c8d1d21e12c02fdb7a2a812d"
24452445
integrity sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==

0 commit comments

Comments
 (0)