-
Notifications
You must be signed in to change notification settings - Fork 628
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: change module exports and upgrade vercel to latest release (#1005)
* bugfix: change module exports and upgrade vercel to latest release * bugfix: webhook.verify is now asynchronous
- Loading branch information
1 parent
92a0d8a
commit f8f8981
Showing
11 changed files
with
57 additions
and
47 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
4 changes: 2 additions & 2 deletions
4
modules/runner-binaries-syncer/lambdas/runner-binaries-syncer/src/lambda.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { handle } from './syncer/handler'; | ||
|
||
// eslint-disable-next-line | ||
module.exports.handler = async (event: any, context: any, callback: any): Promise<any> => { | ||
export const handler = async (event: any, context: any, callback: any): Promise<void> => { | ||
await handle(); | ||
return callback(); | ||
callback(); | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,27 @@ | ||
import { scaleUp } from './scale-runners/scale-up'; | ||
import { scaleDown } from './scale-runners/scale-down'; | ||
import { scaleUp as scaleUpAction } from './scale-runners/scale-up'; | ||
import { scaleDown as scaleDownAction } from './scale-runners/scale-down'; | ||
import { SQSEvent, ScheduledEvent, Context } from 'aws-lambda'; | ||
|
||
module.exports.scaleUp = async (event: SQSEvent, context: Context, callback: any) => { | ||
export const scaleUp = async (event: SQSEvent, context: Context, callback: any): Promise<void> => { | ||
console.dir(event, { depth: 5 }); | ||
try { | ||
for (const e of event.Records) { | ||
await scaleUp(e.eventSource, JSON.parse(e.body)); | ||
await scaleUpAction(e.eventSource, JSON.parse(e.body)); | ||
} | ||
return callback(null); | ||
|
||
callback(null); | ||
} catch (e) { | ||
console.error(e); | ||
return callback('Failed handling SQS event'); | ||
callback('Failed handling SQS event'); | ||
} | ||
}; | ||
|
||
module.exports.scaleDown = async (event: ScheduledEvent, context: Context, callback: any) => { | ||
export const scaleDown = async (event: ScheduledEvent, context: Context, callback: any): Promise<void> => { | ||
try { | ||
scaleDown(); | ||
return callback(null); | ||
scaleDownAction(); | ||
callback(null); | ||
} catch (e) { | ||
console.error(e); | ||
return callback('Failed'); | ||
callback('Failed'); | ||
} | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { handle as githubWebhook } from './webhook/handler'; | ||
import { handle } from './webhook/handler'; | ||
|
||
module.exports.githubWebhook = async (event: any, context: any, callback: any) => { | ||
const statusCode = await githubWebhook(event.headers, event.body); | ||
return callback(null, { | ||
export const githubWebhook = async (event: any, context: any, callback: any): Promise<void> => { | ||
const statusCode = await handle(event.headers, event.body); | ||
callback(null, { | ||
statusCode: statusCode, | ||
}); | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,5 +92,4 @@ describe('handler', () => { | |
expect(resp).toBe(200); | ||
expect(sendActionRequest).toBeCalled(); | ||
}); | ||
|
||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -634,20 +634,30 @@ | |
dependencies: | ||
"@octokit/openapi-types" "^7.3.2" | ||
|
||
"@octokit/webhooks-definitions@3.67.3", "@octokit/webhooks-definitions@^3.67.3": | ||
"@octokit/webhooks-definitions@^3.67.3": | ||
version "3.67.3" | ||
resolved "https://registry.yarnpkg.com/@octokit/webhooks-definitions/-/webhooks-definitions-3.67.3.tgz#d2a905a90b04af8111982d0c13658a49fc4eecb9" | ||
integrity sha512-do4Z1r2OVhuI0ihJhQ8Hg+yPWnBYEBNuFNCrvtPKoYT1w81jD7pBXgGe86lYuuNirkDHb0Nxt+zt4O5GiFJfgA== | ||
|
||
"@octokit/webhooks@^8.5.4": | ||
version "8.12.3" | ||
resolved "https://registry.yarnpkg.com/@octokit/webhooks/-/webhooks-8.12.3.tgz#8e30ac3534bbc65be39995664ee25ca6922f9e44" | ||
integrity sha512-rbzBG0XmzYtaLoeXZ2F4wyY3AaBbvnHT5OkSXxaF+OJTJLEdAKE6dtJsNYzB2mr2XYpe9pb198SrTeutKQeiQA== | ||
"@octokit/webhooks-methods@^2.0.0": | ||
version "2.0.0" | ||
resolved "https://registry.yarnpkg.com/@octokit/webhooks-methods/-/webhooks-methods-2.0.0.tgz#1108b9ea661ca6c81e4a8bfa63a09eb27d5bc2db" | ||
integrity sha512-35cfQ4YWlnZnmZKmIxlGPUPLtbkF8lr/A/1Sk1eC0ddLMwQN06dOuLc+dI3YLQS+T+MoNt3DIQ0NynwgKPilig== | ||
|
||
"@octokit/[email protected]": | ||
version "4.2.0" | ||
resolved "https://registry.yarnpkg.com/@octokit/webhooks-types/-/webhooks-types-4.2.0.tgz#7c3798fe2c469eb62c5fc3440301e34bf288e6b7" | ||
integrity sha512-BbWkXK0ZLE2BXF7OKlrK5B7nCqgawEiZ7orzLls5rLZlepHy1LtFlh2DSe3McqJznlBh0JRk+/eUowgXfmKmIw== | ||
|
||
"@octokit/webhooks@^9.10.0": | ||
version "9.11.0" | ||
resolved "https://registry.yarnpkg.com/@octokit/webhooks/-/webhooks-9.11.0.tgz#e2f491243dd2d0091a4aa24f683ac0958aa040e5" | ||
integrity sha512-0pgBcPtpSIfvJX4COVQbbAL2kndKYLC0kHxnqOEschoVUClLaU7f8xkNX9royJF4vg9dc2AVHVvd9QC8yVrdVw== | ||
dependencies: | ||
"@octokit/request-error" "^2.0.2" | ||
"@octokit/webhooks-definitions" "3.67.3" | ||
"@octokit/webhooks-methods" "^2.0.0" | ||
"@octokit/webhooks-types" "4.2.0" | ||
aggregate-error "^3.1.0" | ||
debug "^4.0.0" | ||
|
||
"@sinonjs/commons@^1.7.0": | ||
version "1.8.3" | ||
|
@@ -909,10 +919,10 @@ | |
"@typescript-eslint/types" "4.27.0" | ||
eslint-visitor-keys "^2.0.0" | ||
|
||
"@vercel/ncc@0.27.0": | ||
version "0.27.0" | ||
resolved "https://registry.yarnpkg.com/@vercel/ncc/-/ncc-0.27.0.tgz#c0cfeebb0bebb56052719efa4a0ecc090a932c76" | ||
integrity sha512-DllIJQapnU2YwewIhh/4dYesmMQw3h2cFtabECc/zSJHqUbNa0eJuEkRa6DXbZvh1YPWBtYQoPV17NlDpBw1Vw== | ||
"@vercel/ncc@0.29.0": | ||
version "0.29.0" | ||
resolved "https://registry.yarnpkg.com/@vercel/ncc/-/ncc-0.29.0.tgz#ac23fc23f1593b05c72360108bcf6d849d2f317a" | ||
integrity sha512-p+sB835wOSDdgm2mgFgSOcXJF84AqZ+vBEnnGS0sm8veA92Hia7sqH0qEnqeFilPl+cXtxbdh2er+WdlfbVCZA== | ||
|
||
abab@^2.0.3, abab@^2.0.5: | ||
version "2.0.5" | ||
|
@@ -1606,7 +1616,7 @@ [email protected], debug@^2.2.0, debug@^2.3.3: | |
dependencies: | ||
ms "2.0.0" | ||
|
||
debug@4, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1: | ||
debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1: | ||
version "4.3.1" | ||
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" | ||
integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== | ||
|