Skip to content

Commit cc92fa4

Browse files
committed
Incorporate review comments and fix build issue
1 parent 0f52a77 commit cc92fa4

File tree

4 files changed

+17
-22
lines changed

4 files changed

+17
-22
lines changed

CHANGELOG.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
# Changelog
22

3-
## Unreleased
4-
5-
### Bug fixes
6-
7-
* Use consistent reporting back to caller in the Webhook lambda
8-
* In runners lambda wait for scaleDown to have finished before calling callback
9-
* In runner-binary-syncer support a runner binary having releases but no prereleases
10-
* When the runner-binary-syncer encounters an error report that back up to the lambda.ts so that it can report that back to the caller.
11-
* Fix incorrect or incomplete tests, and remove duplicate tests
12-
* Fix CONTRIBUTION.md, as the user should base on the develop branch instead of the master branch
13-
143
### [0.15.1](https://github.com/philips-labs/terraform-aws-github-runner/compare/v0.15.0...v0.15.1) (2021-07-13)
154

165

CONTRIBUTING.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ Before you submit your merge request consider the following guidelines:
6363

6464
* Create your patch, **including appropriate test cases**.
6565
* Run the test suite and ensure that all tests pass.
66-
* Add a line in the CHANGELOG.md under Unreleased. This will be used form generating the release notes.
6766
* Install [pre-commit hooks](https://pre-commit.com/). The hooks runs some basic checks and update the docs. The commit will run the hooks, you can invoke the hooks manually `pre-commit run --all-files` as well.
6867
* Commit your changes using a descriptive commit message.
6968

@@ -137,5 +136,5 @@ Use the badge to sign-up.
137136
[![Slack](https://philips-software-slackin.now.sh/badge.svg)](https://philips-software-slackin.now.sh)
138137
139138
[contribute]: CONTRIBUTING.md
140-
[github]: https://github.com/philips-lam/terraform-aws-github-runner/issues
139+
[github]: https://github.com/philips-labs/terraform-aws-github-runner/issues
141140
[slack]: https://philips-software.slack.com/home

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

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,21 @@ export async function listRunners(filters: ListRunnerFilters | undefined = undef
3535
}
3636
}
3737
const runningInstances = await ec2.describeInstances({ Filters: ec2Filters }).promise();
38-
const runners = runningInstances.Reservations?.flatMap((r) => (
39-
r.Instances?.map((i) => ({
40-
instanceId: i.InstanceId as string,
41-
launchTime: i.LaunchTime,
42-
repo: i.Tags?.find((e) => e.Key === 'Repo')?.Value,
43-
org: i.Tags?.find((e) => e.Key === 'Org')?.Value,
44-
})) ?? []
45-
)) ?? [];
38+
const runners: RunnerInfo[] = [];
39+
if (runningInstances.Reservations) {
40+
for (const r of runningInstances.Reservations) {
41+
if (r.Instances) {
42+
for (const i of r.Instances) {
43+
runners.push({
44+
instanceId: i.InstanceId as string,
45+
launchTime: i.LaunchTime,
46+
repo: i.Tags?.find((e) => e.Key === 'Repo')?.Value,
47+
org: i.Tags?.find((e) => e.Key === 'Org')?.Value,
48+
});
49+
}
50+
}
51+
}
52+
}
4653
return runners;
4754
}
4855

modules/webhook/lambdas/webhook/src/webhook/handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export interface WorkflowJob {
2727
};
2828
}
2929

30-
export const handle = async (headers: IncomingHttpHeaders, payload: string): Promise<number> => {
30+
export const handle = async (headers: IncomingHttpHeaders, payload: any): Promise<number> => {
3131
// ensure header keys lower case since github headers can contain capitals.
3232
for (const key in headers) {
3333
headers[key.toLowerCase()] = headers[key];

0 commit comments

Comments
 (0)