-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
124 additions
and
155 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# github-actions-standards | ||
# GitHub Actions Standards | ||
|
||
Turo development standards when using GitHub Actions. | ||
|
||
See [docs](./docs) |
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 |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# Action Repos | ||
|
||
Open-Turo has two different types of action repos: | ||
|
||
- single actions | ||
- action suites | ||
|
||
## Single action repos | ||
|
||
These are the default standard for actions. They are appropriate when you have a standalone action that does not have | ||
other related actions. Examples of this: | ||
|
||
- [action-pre-commit]() | ||
- [action-???] | ||
|
||
## Action Suites | ||
|
||
We have found that it is quite common to want to have sets of related actions that either apply to a platform (jvm, | ||
node, terraform, etc.) or apply to a function (semantic-release). In these cases, we use directories inside of action | ||
repos to group actions together. | ||
|
||
For example, the actions-jvm repo provides four different high level actions: | ||
|
||
- lint | ||
- test | ||
- prerelease | ||
- build-docker | ||
|
||
This provides two functions: | ||
|
||
1. it groups like actions together where they are easier to maintain | ||
2. the high level actions allow for code repos to have very simple github action workflow files | ||
|
||
There is an example of a jvm based repo's CI yaml file | ||
|
||
```yaml | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: [self-hosted, general-ubuntu] | ||
steps: | ||
- uses: open-turo/actions-jvm/lint@v1 | ||
with: | ||
checkout-repo: true | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
artifactory-username: ${{ secrets.ARTIFACTORY_USERNAME }} | ||
artifactory-auth-token: ${{ secrets.ARTIFACTORY_AUTH_TOKEN }} | ||
|
||
test: | ||
name: Test | ||
runs-on: [self-hosted, general-ubuntu] | ||
steps: | ||
- uses: open-turo/actions-jvm/test@v1 | ||
with: | ||
checkout-repo: true | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
artifactory-username: ${{ secrets.ARTIFACTORY_USERNAME }} | ||
artifactory-auth-token: ${{ secrets.ARTIFACTORY_AUTH_TOKEN }} | ||
``` | ||
### Language & Platform Action Suites | ||
When creating actions for repos, we suggest erring on the side of having simple action workflow files in the workflows | ||
that utilize appropriate action suites to abstract away functionality. This makes it easier for people to onboard new | ||
repositories and makes it easier to perform maintenance actions across all repos that are using these actions. |
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,90 +1,40 @@ | ||
# Conventional Commit message structure | ||
|
||
Commit messages are expected to follow the conventional-commit standards as defined | ||
Commit messages in code repositories are expected to follow the conventional-commit standards as defined | ||
by [conventionalcommits.org](https://www.conventionalcommits.org/en/v1.0.0/). | ||
|
||
Terraform is not exactly `code` so the meaning of `fix` and `feat` are slightly different than in a code repository. | ||
This is expressed in the tables below. | ||
### GitHub Actions | ||
|
||
### Terraform workspaces | ||
The following table describes the meaning of our conventional commits within the usage of a GitHub Action repository. | ||
|
||
The following table describes the meaning of our conventional commits within the usage of a Terraform workspace. | ||
Remember that the purpose of conventional commits is to track the API changes. In the case of GitHub actions, that | ||
includes the inputs, outputs, functional behavior, calling context etc. | ||
|
||
| Type | Release? | Description | | ||
| -------- | ---------------------- | --------------------------------------------------------------------------------------- | | ||
| feat | :white-check-mark: yes | Adding resources | | ||
| fix | :white-check-mark: yes | Modifying an existing resource | | ||
| docs | :x: no | Changes to documentation - both markdown files and comments | | ||
| chore | :x: no | Changes that don't modify resource or test files - modifying scripts, repository config | | ||
| ci | :x: no | Changes to continuous integration - GHA workflows | | ||
| refactor | :x: no | Changes which do not affect the public behavior | | ||
| revert | :x: no | Permanently revert a change | | ||
| style | :x: no | Changes due to code style, whitespace, or documentation linting | | ||
| build | :x: no | Do not use - build is unused with terraform workspaces | | ||
| perf | :x: no | Do not use | | ||
| test | :x: no | Do not use - workspaces do not have tests | | ||
|
||
#### Removing resources | ||
|
||
When removing a resource, you can choose whether or not you want it to be a `feat` or `fix`. This is a judgement call | ||
based on the size and scope of the change. | ||
|
||
- **fix** – When you are removing an unused and easily re-creatable or recoverable resource with no state | ||
the change would be considered a fix. For example: removing an unused security group or IAM role. | ||
- **feat** – When you are removing a resource that has state where recreation would be substantial. For example: | ||
removing an RDS instance. | ||
| Type | Release? | Description | | ||
| -------- | ---------------------- | ------------------------------------------------------------------------------------------------ | | ||
| feat | :white-check-mark: yes | Adding new functionality, in particular to the API. New inputs & outputs would be a new feature. | | ||
| fix | :white-check-mark: yes | Modifying existing functionality or fixing a bug. | | ||
| docs | :x: no | Changes to documentation - both markdown files and comments | | ||
| chore | :x: no | Changes that don't modify resource or test files - modifying scripts, repository config | | ||
| ci | :x: no | Changes to continuous integration - GHA workflows | | ||
| refactor | :x: no | Changes which do not affect the public behavior | | ||
| revert | :x: no | Permanently revert a change | | ||
| style | :x: no | Changes due to code style, whitespace, or documentation linting | | ||
| build | :x: no | Do not use - use CI instead | | ||
| perf | :x: no | Do not use | | ||
| test | :x: no | Do not use - deployments do not have tests at this time. | | ||
|
||
#### Scope | ||
|
||
- _may_ be `environment` when changes apply to one environment | ||
- _may_ be the type of file changed for chores (for example script or workflow) | ||
|
||
#### Breaking change | ||
|
||
A breaking change may be used to call out substantial changes that others might want to be made aware of. | ||
|
||
This is particularly important if there are other, external dependencies to the workspace - such as remote state - which | ||
require other workspaces to be updated in sync. | ||
|
||
### Terraform modules | ||
|
||
The following table describes the meaning of our conventional commits within the usage of a Terraform workspace. | ||
|
||
| type | creates release | description | | ||
| -------- | --------------- | ---------------------------------------------------------------------------------------------- | | ||
| feat | yes | Adding new functionality and/or resources | | ||
| fix | yes | Modifying an existing resource or functionality | | ||
| test | no | Modifying only test resources or the actual tests | | ||
| docs | no | Changes to documentation - either descriptions & comments in `tf` files or in other docs files | | ||
| chore | no | Other changes that don't modify src or test files - modifying scripts | | ||
| ci | no | Changes to continuous integration - GHA workflows | | ||
| refactor | no | Changes which do not affect the public behavior | | ||
| revert | no | Permanently revert a change | | ||
| style | no | Changes due to code style, whitespace, or documentation linting | | ||
| build | no | Do not use - build is unused with terraform workspaces | | ||
| perf | no | Do not use | | ||
|
||
#### Removing resources | ||
|
||
When removing a resource, you can choose whether or not you want it to be a `feat` or `fix`. This is a judgement call | ||
based on the size and scope of the change. | ||
|
||
- **fix** – When you are removing an unused and easily re-creatable or recoverable resource with no state | ||
the change would be considered a fix. For example: removing an unused security group or IAM role. | ||
- **feat** – When you are removing a resource that has state where recreation would be substantial. For example: | ||
removing an RDS instance. | ||
- undefined at this time | ||
|
||
#### Breaking change | ||
|
||
This must be specified if the change will break any current usages of the module. | ||
This must be specified if the change will break any current usages of the GitHub action. | ||
|
||
This is best implemented through deprecation first to add new/replacement functionality followed up with remove of the | ||
now unused functionality. | ||
|
||
When creating a breaking change - you MUST include a markdown document in the `docs/breaking-changes` directory. It | ||
should be named `v<version>.md` where `<version>` is the new/breakign version. This document should explain the breaking | ||
should be named `v<version>.md` where `<version>` is the new/breaking version. This document should explain the breaking | ||
change and how to migrate to the new version. | ||
|
||
#### Scope | ||
|
||
Use of scope is optional. It may reflect a fucntional area or component that matches the change. |
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,4 +1,3 @@ | ||
# Sources of Inspiration | ||
|
||
- https://developer.hashicorp.com/terraform/language | ||
- https://www.terraform-best-practices.com/ | ||
- |
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