Skip to content

Commit dd2c2d8

Browse files
aadrijnbergdependabot[bot]ravenolfravenolfnpalm
authored
chore: documentation and code improvements (#1035)
* chore: Bump aws-sdk (#752) (#909) Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.863.0 to 2.888.0. - [Release notes](https://github.com/aws/aws-sdk-js/releases) - [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md) - [Commits](aws/aws-sdk-js@v2.863.0...v2.888.0) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: Bump aws-sdk (#752) (#908) Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.863.0 to 2.888.0. - [Release notes](https://github.com/aws/aws-sdk-js/releases) - [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md) - [Commits](aws/aws-sdk-js@v2.863.0...v2.888.0) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: Bump aws-sdk (#752) (#887) Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.863.0 to 2.888.0. - [Release notes](https://github.com/aws/aws-sdk-js/releases) - [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md) - [Commits](aws/aws-sdk-js@v2.863.0...v2.888.0) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: Bump aws-sdk (#752) (#885) Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.863.0 to 2.888.0. - [Release notes](https://github.com/aws/aws-sdk-js/releases) - [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md) - [Commits](aws/aws-sdk-js@v2.863.0...v2.888.0) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: Bump aws-sdk (#752) (#889) Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.863.0 to 2.888.0. - [Release notes](https://github.com/aws/aws-sdk-js/releases) - [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md) - [Commits](aws/aws-sdk-js@v2.863.0...v2.888.0) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: Bump aws-sdk (#752) (#892) Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.863.0 to 2.888.0. - [Release notes](https://github.com/aws/aws-sdk-js/releases) - [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md) - [Commits](aws/aws-sdk-js@v2.863.0...v2.888.0) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: Bump aws-sdk (#752) (#907) Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.863.0 to 2.888.0. - [Release notes](https://github.com/aws/aws-sdk-js/releases) - [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md) - [Commits](aws/aws-sdk-js@v2.863.0...v2.888.0) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: Bump aws-sdk (#752) (#864) Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.863.0 to 2.888.0. - [Release notes](https://github.com/aws/aws-sdk-js/releases) - [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md) - [Commits](aws/aws-sdk-js@v2.863.0...v2.888.0) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: Bump eslint in /modules/webhook/lambdas/webhook (#918) Bumps [eslint](https://github.com/eslint/eslint) from 7.28.0 to 7.29.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](eslint/eslint@v7.28.0...v7.29.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: Bump typescript (#929) Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.3.3 to 4.3.4. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](microsoft/TypeScript@v4.3.3...v4.3.4) --- updated-dependencies: - dependency-name: typescript dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: Bump @typescript-eslint/eslint-plugin (#928) Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.27.0 to 4.28.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.28.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: Bump typescript in /modules/webhook/lambdas/webhook (#926) Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.3.3 to 4.3.4. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](microsoft/TypeScript@v4.3.3...v4.3.4) --- updated-dependencies: - dependency-name: typescript dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * feat: Added support for white listing of repositories (#915) * add white listing of repositories Signed-off-by: ravenolf <[email protected]> * fix variable naming Signed-off-by: ravenolf <[email protected]> * add unit test * update docs * add successful unit test Co-authored-by: ravenolf <[email protected]> * chore(examples): Upgrade default example to terraform 1.x.x * chore(doc): Remove org level admin permission #801 Org level admin permissions for the app are not required any more, removed from docs. * feat: make delay of webhook event configurable (#990) * 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 * fix: reduce permission required for session manager (#1018) * feat: Store lambda secrets paramaters in Paramater Store (#941) * fix(scale): Refactor Runner Type and Owner (#871) * fix(scale): Refactor Runner Type and Owner * `environment` should not be optional * feat: support multiple instance types (#898) * fix(scale): Refactor Runner Type and Owner * `environment` should not be optional * feat(runners): Support Multiple Instance Types * Correcting failed launch logic * Updating tests * Test for all launch templates failing * Marking `instance_type` as deprecated * docs: fix lambda_security_group_ids incorrect description #738 (#902) close #738 * fix: scale down runners (#905) * fix: scale down runners * fix: scale down runners * chore: group upgrade lambda dependencies (#906) * chore: upgrade dependencies for lambda's * fix auth-app to 3.4.0, issues #904 addresses the issue * feat(runner): Move Lambda Vars to Parameter Store * Add test for ssm module (#1) * Add test for ssm module * Fixing lint * Removing KMS/GH Auth from scale-down * Add SSM permissions to runner policy * Allow custom key_id * Fixing for loop * Move SSM policy to Lambdas * Fixing function call * chore: Bump aws-sdk (#752) (#909) Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.863.0 to 2.888.0. - [Release notes](https://github.com/aws/aws-sdk-js/releases) - [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md) - [Commits](aws/aws-sdk-js@v2.863.0...v2.888.0) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: Bump aws-sdk (#752) (#908) Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.863.0 to 2.888.0. - [Release notes](https://github.com/aws/aws-sdk-js/releases) - [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md) - [Commits](aws/aws-sdk-js@v2.863.0...v2.888.0) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: Bump aws-sdk (#752) (#887) Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.863.0 to 2.888.0. - [Release notes](https://github.com/aws/aws-sdk-js/releases) - [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md) - [Commits](aws/aws-sdk-js@v2.863.0...v2.888.0) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: Bump aws-sdk (#752) (#885) Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.863.0 to 2.888.0. - [Release notes](https://github.com/aws/aws-sdk-js/releases) - [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md) - [Commits](aws/aws-sdk-js@v2.863.0...v2.888.0) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: Bump aws-sdk (#752) (#889) Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.863.0 to 2.888.0. - [Release notes](https://github.com/aws/aws-sdk-js/releases) - [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md) - [Commits](aws/aws-sdk-js@v2.863.0...v2.888.0) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: Bump aws-sdk (#752) (#892) Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.863.0 to 2.888.0. - [Release notes](https://github.com/aws/aws-sdk-js/releases) - [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md) - [Commits](aws/aws-sdk-js@v2.863.0...v2.888.0) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: Bump aws-sdk (#752) (#907) Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.863.0 to 2.888.0. - [Release notes](https://github.com/aws/aws-sdk-js/releases) - [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md) - [Commits](aws/aws-sdk-js@v2.863.0...v2.888.0) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: Bump aws-sdk (#752) (#864) Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.863.0 to 2.888.0. - [Release notes](https://github.com/aws/aws-sdk-js/releases) - [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md) - [Commits](aws/aws-sdk-js@v2.863.0...v2.888.0) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: Bump eslint in /modules/webhook/lambdas/webhook (#918) Bumps [eslint](https://github.com/eslint/eslint) from 7.28.0 to 7.29.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](eslint/eslint@v7.28.0...v7.29.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: Bump typescript (#929) Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.3.3 to 4.3.4. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](microsoft/TypeScript@v4.3.3...v4.3.4) --- updated-dependencies: - dependency-name: typescript dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: Bump @typescript-eslint/eslint-plugin (#928) Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.27.0 to 4.28.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.28.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: Bump typescript in /modules/webhook/lambdas/webhook (#926) Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.3.3 to 4.3.4. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](microsoft/TypeScript@v4.3.3...v4.3.4) --- updated-dependencies: - dependency-name: typescript dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * feat: Added support for white listing of repositories (#915) * add white listing of repositories Signed-off-by: ravenolf <[email protected]> * fix variable naming Signed-off-by: ravenolf <[email protected]> * add unit test * update docs * add successful unit test Co-authored-by: ravenolf <[email protected]> * Need `,` after list item * Move Lambda Policy to data resource * Addressing PR comments, fixing lint * Refactoring Parameters to SSM Module * Fixing rebase * Using only key ARN as input value Co-authored-by: Niek Palm <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sofiane Benahmed <[email protected]> Co-authored-by: ravenolf <[email protected]> * feat: Adding support for new workflow_job event. (#1019) Added support for new workflow_job event, the check_run event will remain for backwards compatibility * chore: Bump @types/node in /modules/webhook/lambdas/webhook Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 15.14.7 to 16.4.12. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * chore: Bump tar from 4.4.13 to 4.4.15 in /.release Bumps [tar](https://github.com/npm/node-tar) from 4.4.13 to 4.4.15. - [Release notes](https://github.com/npm/node-tar/releases) - [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md) - [Commits](isaacs/node-tar@v4.4.13...v4.4.15) --- updated-dependencies: - dependency-name: tar dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> * chore: Bump jest-mock-extended in /modules/runners/lambdas/runners Bumps [jest-mock-extended](https://github.com/marchaos/jest-mock-extended) from 1.0.18 to 2.0.1. - [Release notes](https://github.com/marchaos/jest-mock-extended/releases) - [Commits](https://github.com/marchaos/jest-mock-extended/commits) --- updated-dependencies: - dependency-name: jest-mock-extended dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * chore: Bump @types/node Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 15.14.7 to 16.4.12. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * fix: handle situation of no prereleases correctly, and propagate lambda error to caller. * chore (doc): small improvements * fix: wait for scaleDown to have finished before calling callback Wait for scaleDown to have executed before returning to the caller that no error occurred. * chore: code consistency and improvements - use question mark after field name i.s.o. Type | undefined - use more functional approach i.s.o. for-loops - import all items from a single dependency on a single line - remove unused imports - add missing return type to function - change payload type from any to string * fix: tests were not always correct or incomplete or duplicate - add test for terminateRunner - removed duplicate tests for scale-down - use assertions consistently -> ".not" changed to ".not.toBeCalled()" - set process.env.ENABLE_ORGANIZATION_RUNNERS before calling scaleDown, and assert the right call to have been called - remove "Once" from the paginate mock, as it is called more than once - fix inconsistent asserts for both repo and org functions in the scaleUp tests - remove expectedRunnerParams field overriding when they are already overridden to same value at a higher level - add test for all launches failing in the repo level tests - add test for decryption failing in hte websocket handler - add checking of the payload to the SQS request - change the X-Github-Event to "check_run" to really test what was intended to be tested * fix: use consistent reporting back to caller * chore(release): 0.15.1 [skip ci] * apply patch for broken scale up lambda [#980](https://github.com/philips-labs/terraform-aws-github-runner/issues/980) ([b957e26](philips-labs/terraform-aws-github-runner@b957e26)) * Update CHANGELOG * fix: CONTRIBUTION.md should refer develop iso master branch * Cleanup * Incorporate review comments and fix build issue * Update modules/runners/README.md Co-authored-by: Gertjan Maas <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sofiane Benahmed <[email protected]> Co-authored-by: ravenolf <[email protected]> Co-authored-by: Niek Palm <[email protected]> Co-authored-by: Niek Palm <[email protected]> Co-authored-by: PatrickMennen <[email protected]> Co-authored-by: Nathaniel McAuliffe <[email protected]> Co-authored-by: semantic-release-bot <[email protected]> Co-authored-by: Gertjan Maas <[email protected]>
1 parent 153d699 commit dd2c2d8

File tree

21 files changed

+183
-144
lines changed

21 files changed

+183
-144
lines changed

CONTRIBUTING.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
We'd love for you to contribute to our source code and to make the Forest even better than it is today! Here are the guidelines we'd like you to follow:
44

5-
- [Question or Problem?](#question)
6-
- [Issues and Bugs](#issue)
7-
- [Feature Requests](#feature)
8-
- [Submission Guidelines](#submit)
9-
- [Further Info](#info)
5+
* [Question or Problem?](#question)
6+
* [Issues and Bugs](#issue)
7+
* [Feature Requests](#feature)
8+
* [Submission Guidelines](#submit)
9+
* [Further Info](#info)
1010

1111
## <a name="question"></a> Got a Question or Problem?
1212

@@ -27,7 +27,6 @@ You can request a new feature by submitting an issue to our [Github Repository][
2727
* **Major Changes** that you wish to contribute to the project should be discussed first on our [Slack group][slack] so that we can better coordinate our efforts, prevent duplication of work, and help you to craft the change so that it is successfully accepted into the project.
2828
* **Small Changes** can be crafted and submitted to the [Github Repository][github] as a Pull Request.
2929

30-
3130
## <a name="docs"></a> Want a Doc Fix?
3231

3332
If you want to help improve the docs, it's a good idea to let others know what you're working on to minimize duplication of effort. Create a new issue (or comment on a related existing one) to let others know what you're working on.
@@ -37,6 +36,7 @@ For large fixes, please build and test the documentation before submitting the M
3736
## <a name="submit"></a> Submission Guidelines
3837

3938
### Submitting an Issue
39+
4040
Before you submit your issue search the archive, maybe your question was already answered.
4141

4242
If your issue appears to be a bug, and hasn't been reported, open a new issue. Help us to maximize the effort we can spend fixing issues and adding new features, by not reporting duplicate issues. Providing the following information will increase the chances of your issue being dealt with quickly:
@@ -58,18 +58,18 @@ Before you submit your merge request consider the following guidelines:
5858
* Make your changes in a new git branch:
5959

6060
```shell
61-
git checkout -b my-fix-branch master
61+
git checkout -b my-fix-branch develop
6262
```
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

7069
```shell
7170
git commit -a
7271
```
72+
7373
Note: the optional commit `-a` command line option will automatically "add" and "rm" edited files.
7474

7575
* Build your changes locally to ensure all the tests pass:
@@ -79,7 +79,7 @@ Before you submit your merge request consider the following guidelines:
7979
git push origin my-fix-branch
8080
```
8181

82-
In Github, send a pull request to original master branch: f.e. `terraform-aws-vpc:master`.
82+
In Github, send a pull request to original develop branch: f.e. `terraform-aws-vpc:develop`.
8383
If we suggest changes, then:
8484

8585
* Make the required updates.
@@ -89,10 +89,10 @@ If we suggest changes, then:
8989

9090
If the PR gets too outdated we may ask you to rebase and force push to update the PR:
9191

92-
```shell
93-
git rebase master -i
94-
git push origin my-fix-branch -f
95-
```
92+
```shell
93+
git rebase develop -i
94+
git push origin my-fix-branch -f
95+
```
9696

9797
_WARNING: Squashing or reverting commits and force-pushing thereafter may remove Github comments on code that were previously made by you or others in your commits. Avoid any form of rebasing unless necessary._
9898

@@ -109,10 +109,10 @@ from the main (upstream) repository:
109109
git push origin --delete my-fix-branch
110110
```
111111
112-
* Check out the master branch:
112+
* Check out the develop branch:
113113
114114
```shell
115-
git checkout master -f
115+
git checkout develop -f
116116
```
117117
118118
* Delete the local branch:
@@ -121,10 +121,10 @@ from the main (upstream) repository:
121121
git branch -D my-fix-branch
122122
```
123123
124-
* Update your master with the latest upstream version:
124+
* Update your develop with the latest upstream version:
125125
126126
```shell
127-
git pull --ff upstream master
127+
git pull --ff upstream develop
128128
```
129129
130130
## <a name="info"></a> Info
@@ -136,5 +136,5 @@ Use the badge to sign-up.
136136
[![Slack](https://philips-software-slackin.now.sh/badge.svg)](https://philips-software-slackin.now.sh)
137137
138138
[contribute]: CONTRIBUTING.md
139-
[github]: https://github.com/philips-lam/terraform-aws-github-runner/issues
139+
[github]: https://github.com/philips-labs/terraform-aws-github-runner/issues
140140
[slack]: https://philips-software.slack.com/home

examples/default/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Action runners deployment default example
22

3-
This modules shows how to create GitHub action runners. Lambda release will be downloaded from GitHub.
3+
This module shows how to create GitHub action runners. Lambda release will be downloaded from GitHub.
44

55
## Usages
66

7-
Steps for the full setup, such as creating a GitHub app can be found in the root module's [README](../../README.md). First download the Lambda releases from GitHub. Alternatively you can build the lambdas locally with Node or Docker, there is a simple build script in `<root>/.ci/build.sh`. In the `main.tf` you can simple remove the location of the lambda zip files, the default location will work in this case.
7+
Steps for the full setup, such as creating a GitHub app can be found in the root module's [README](../../README.md). First download the Lambda releases from GitHub. Alternatively you can build the lambdas locally with Node or Docker, there is a simple build script in `<root>/.ci/build.sh`. In the `main.tf` you can simply remove the location of the lambda zip files, the default location will work in this case.
88

99
> Ensure you have set the version in `lambdas-download/main.tf` for running the example. The version needs to be set to a GitHub release version, see https://github.com/philips-labs/terraform-aws-github-runner/releases
1010

examples/permissions-boundary/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Action runners deployed with permissions boundary
22

3-
This modules shows how to create GitHub action runners with permissions boundaries and paths used in role, policies, and instance profiles.
3+
This module shows how to create GitHub action runners with permissions boundaries and paths used in role, policies, and instance profiles.
44

55
## Usages
66

7-
Steps for the full setup, such as creating a GitHub app can be find the module [README](../../README.md). First create the deploy role and boundary policies. This steps required an admin user.
7+
Steps for the full setup, such as creating a GitHub app can be find the module [README](../../README.md). First create the deploy role and boundary policies. These steps require an admin user.
88

99
> Ensure you have set the version in `lambdas-download/main.tf` for running the example. The version needs to be set to a GitHub release version, see https://github.com/philips-labs/terraform-aws-github-runner/releases
1010

examples/ubuntu/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Action runners deployment ubuntu example
22

3-
This modules shows how to create GitHub action runners using an Ubuntu AMI. Lambda release will be downloaded from GitHub.
3+
This module shows how to create GitHub action runners using an Ubuntu AMI. Lambda release will be downloaded from GitHub.
44

55
## Usages
66

7-
Steps for the full setup, such as creating a GitHub app can be found in the root module's [README](../../README.md). First download the Lambda releases from GitHub. Alternatively you can build the lambdas locally with Node or Docker, there is a simple build script in `<root>/.ci/build.sh`. In the `main.tf` you can simple remove the location of the lambda zip files, the default location will work in this case.
7+
Steps for the full setup, such as creating a GitHub app can be found in the root module's [README](../../README.md). First download the Lambda releases from GitHub. Alternatively you can build the lambdas locally with Node or Docker, there is a simple build script in `<root>/.ci/build.sh`. In the `main.tf` you can simply remove the location of the lambda zip files, the default location will work in this case.
88

99
> Ensure you have set the version in `lambdas-download/main.tf` for running the example. The version needs to be set to a GitHub release version, see https://github.com/philips-labs/terraform-aws-github-runner/releases
1010

examples/ubuntu/providers.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ terraform {
1313
provider "aws" {
1414
region = local.aws_region
1515

16-
// If you use roles with specific permissons please add your role
16+
// If you use roles with specific permissions please add your role
1717
// assume_role {
1818
// role_arn = "arn:aws:iam::123456789012:role/MyAdminRole"
1919
// }

modules/runner-binaries-syncer/lambdas/runner-binaries-syncer/src/lambda.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import { handle } from './syncer/handler';
22

33
// eslint-disable-next-line
44
export const handler = async (event: any, context: any, callback: any): Promise<void> => {
5-
await handle();
6-
callback();
5+
try {
6+
await handle();
7+
callback(null);
8+
} catch (e) {
9+
callback(e);
10+
}
711
};

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

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,30 @@ describe('Synchronize action distribution.', () => {
5656
expect(mockS3.upload).toBeCalledTimes(0);
5757
});
5858

59+
it('Distribution is up-to-date with latest release when there are no prereleases.', async () => {
60+
process.env.GITHUB_RUNNER_ALLOW_PRERELEASE_BINARIES = 'true';
61+
const releases = listReleases.slice(1);
62+
63+
mockOctokit.repos.listReleases.mockImplementation(() => ({
64+
data: releases,
65+
}));
66+
mockS3.getObjectTagging.mockImplementation(() => {
67+
return {
68+
promise() {
69+
return Promise.resolve({ TagSet: [{ Key: 'name', Value: 'actions-runner-linux-x64-2.272.0.tar.gz' }] });
70+
},
71+
};
72+
});
73+
74+
await handle();
75+
expect(mockOctokit.repos.listReleases).toBeCalledTimes(1);
76+
expect(mockS3.getObjectTagging).toBeCalledWith({
77+
Bucket: bucketName,
78+
Key: bucketObjectKey,
79+
});
80+
expect(mockS3.upload).toBeCalledTimes(0);
81+
});
82+
5983
it('Distribution is up-to-date with latest prerelease.', async () => {
6084
process.env.GITHUB_RUNNER_ALLOW_PRERELEASE_BINARIES = 'true';
6185
mockS3.getObjectTagging.mockImplementation(() => {
@@ -95,6 +119,32 @@ describe('Synchronize action distribution.', () => {
95119
expect(s3JsonBody['Tagging']).toEqual('name=actions-runner-linux-x64-2.272.0.tar.gz');
96120
});
97121

122+
it('Distribution should update to release if there are no pre-releases.', async () => {
123+
process.env.GITHUB_RUNNER_ALLOW_PRERELEASE_BINARIES = 'true';
124+
const releases = listReleases.slice(1);
125+
126+
mockOctokit.repos.listReleases.mockImplementation(() => ({
127+
data: releases,
128+
}));
129+
mockS3.getObjectTagging.mockImplementation(() => {
130+
return {
131+
promise() {
132+
return Promise.resolve({ TagSet: [{ Key: 'name', Value: 'actions-runner-linux-x64-0.tar.gz' }] });
133+
},
134+
};
135+
});
136+
137+
await handle();
138+
expect(mockOctokit.repos.listReleases).toBeCalledTimes(1);
139+
expect(mockS3.getObjectTagging).toBeCalledWith({
140+
Bucket: bucketName,
141+
Key: bucketObjectKey,
142+
});
143+
expect(mockS3.upload).toBeCalledTimes(1);
144+
const s3JsonBody = mockS3.upload.mock.calls[0][0];
145+
expect(s3JsonBody['Tagging']).toEqual('name=actions-runner-linux-x64-2.272.0.tar.gz');
146+
});
147+
98148
it('Distribution should update to prerelease.', async () => {
99149
process.env.GITHUB_RUNNER_ALLOW_PRERELEASE_BINARIES = 'true';
100150
mockS3.getObjectTagging.mockImplementation(() => {

modules/runner-binaries-syncer/lambdas/runner-binaries-syncer/src/syncer/handler.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ async function getLinuxReleaseAsset(
4949
const latestReleaseIndex = assetsList.data.findIndex((a) => a.prerelease === false);
5050

5151
let asset = undefined;
52-
if (fetchPrereleaseBinaries && latestPrereleaseIndex < latestReleaseIndex) {
52+
if (fetchPrereleaseBinaries && latestPrereleaseIndex != -1 && latestPrereleaseIndex < latestReleaseIndex) {
5353
asset = assetsList.data[latestPrereleaseIndex];
5454
} else if (latestReleaseIndex != -1) {
5555
asset = assetsList.data[latestReleaseIndex];
@@ -86,6 +86,7 @@ async function uploadToS3(s3: S3, cacheObject: CacheObject, actionRunnerReleaseA
8686
});
8787
}).catch((error) => {
8888
console.error(`Exception: ${error}`);
89+
throw error;
8990
});
9091
}
9192

modules/runners/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ This module creates resources required to run the GitHub action runner on AWS EC
66

77
### Action runners on EC2
88

9-
The action runners are created via a launch template, on launch template only the subnet needs to be provided. During launch the installation is handled via a user data script. The configuration is fetched from SSM parameter store.
9+
The action runners are created via a launch template; in the launch template only the subnet needs to be provided. During launch the installation is handled via a user data script. The configuration is fetched from SSM parameter store.
1010

1111
### Lambda scale up
1212

13-
The scale up lambda is triggered by events on a SQS queue. Events on this queued are delayed, which will will give the workflow some time to start running on available runners. For each event the lambda will check the workflow is still queued and no other limits are reached. In that case the lambda will create a new EC2 instance. The lambda only needs to know which launch template to use and which subnets are available. From the available subnets a random one will be chosen. Once the instance is created the event is assumed as handled, and we assume the workflow wil start at some moment once the created instance is ready.
13+
The scale up lambda is triggered by events on a SQS queue. Events on this queue are delayed, which will give the workflow some time to start running on available runners. For each event the lambda will check if the workflow is still queued and no other limits are reached. In that case the lambda will create a new EC2 instance. The lambda only needs to know which launch template to use and which subnets are available. From the available subnets a random one will be chosen. Once the instance is created the event is assumed as handled, and we assume the workflow wil start at some moment once the created instance is ready.
1414

1515
### Lambda scale down
1616

modules/runners/lambdas/runners/src/lambda.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const scaleUp = async (event: SQSEvent, context: Context, callback: any):
1818

1919
export const scaleDown = async (event: ScheduledEvent, context: Context, callback: any): Promise<void> => {
2020
try {
21-
scaleDownAction();
21+
await scaleDownAction();
2222
callback(null);
2323
} catch (e) {
2424
console.error(e);

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

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { listRunners, createRunner } from './runners';
1+
import { listRunners, createRunner, terminateRunner, RunnerInfo } from './runners';
22

3-
const mockEC2 = { describeInstances: jest.fn(), runInstances: jest.fn() };
3+
const mockEC2 = { describeInstances: jest.fn(), runInstances: jest.fn(), terminateInstances: jest.fn() };
44
const mockSSM = { putParameter: jest.fn() };
55
jest.mock('aws-sdk', () => ({
66
EC2: jest.fn().mockImplementation(() => mockEC2),
@@ -102,6 +102,23 @@ describe('list instances', () => {
102102
});
103103
});
104104

105+
describe('terminate runner', () => {
106+
const mockTerminateInstances = { promise: jest.fn() };
107+
beforeEach(() => {
108+
jest.clearAllMocks();
109+
mockEC2.terminateInstances.mockImplementation(() => mockTerminateInstances);
110+
mockTerminateInstances.promise.mockReturnThis();
111+
});
112+
it('calls terminate instances with the right instance ids', async () => {
113+
const runner: RunnerInfo = {
114+
instanceId: 'instance-2',
115+
};
116+
await terminateRunner(runner);
117+
118+
expect(mockEC2.terminateInstances).toBeCalledWith({ InstanceIds: [runner.instanceId] });
119+
});
120+
});
121+
105122
describe('create runner', () => {
106123
const mockRunInstances = { promise: jest.fn() };
107124
const mockPutParameter = { promise: jest.fn() };

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ import { EC2, SSM } from 'aws-sdk';
22

33
export interface RunnerInfo {
44
instanceId: string;
5-
launchTime: Date | undefined;
6-
repo: string | undefined;
7-
org: string | undefined;
5+
launchTime?: Date;
6+
repo?: string;
7+
org?: string;
88
}
99

1010
export interface ListRunnerFilters {
1111
runnerType?: 'Org' | 'Repo';
1212
runnerOwner?: string;
13-
environment: string | undefined;
13+
environment?: string;
1414
}
1515

1616
export interface RunnerInputParameters {

modules/runners/lambdas/runners/src/scale-runners/scale-down-config.test.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,11 @@ const DEFAULT_IDLE_COUNT = 1;
66
const now = moment.tz(new Date(), 'America/Los_Angeles');
77

88
function getConfig(cronTabs: string[]): ScalingDownConfigList {
9-
const result: ScalingDownConfigList = [];
10-
for (const cron of cronTabs) {
11-
result.push({
12-
cron: cron,
13-
idleCount: DEFAULT_IDLE_COUNT,
14-
timeZone: DEFAULT_TIMEZONE,
15-
});
16-
}
17-
return result;
9+
return cronTabs.map((cron) => ({
10+
cron: cron,
11+
idleCount: DEFAULT_IDLE_COUNT,
12+
timeZone: DEFAULT_TIMEZONE,
13+
}));
1814
}
1915

2016
describe('scaleDownConfig', () => {

0 commit comments

Comments
 (0)