From 37e441d2b5d273e202f558b8ff15e479ea708d19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Tue, 10 Dec 2024 11:24:53 +0100 Subject: [PATCH 1/8] chore: add security as valid convention PR title --- .github/workflows/conventions.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/conventions.yml b/.github/workflows/conventions.yml index 9821e904c8..3a1fb6fa3c 100644 --- a/.github/workflows/conventions.yml +++ b/.github/workflows/conventions.yml @@ -41,6 +41,7 @@ jobs: doesn't start with an uppercase character. types: | break + security fix feat bug From 4816e2cd9582e76f53d87a437b0d109123867b9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Tue, 10 Dec 2024 11:29:25 +0100 Subject: [PATCH 2/8] chore: add labels based on PR title --- .github/release-drafter.yml | 22 ++++++++++++++++++++++ .github/workflows/release-drafter.yml | 6 ++++++ 2 files changed, 28 insertions(+) diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 1fe773fb46..f5f1e37cfa 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -26,3 +26,25 @@ categories: - 'test flakiness' - title: 📦 Dependency updates label: 'dependencies' +autolabeler: + - label: 'breaking change' + title: + - '/^break(\(.+\))?\:/i' + - label: 'security' + title: + - '/^security(\(.+\))?\:/i' + - label: 'feature' + title: + - '/^feat(\(.+\))?\:/i' + - label: 'bug' + title: + - '/^(fix|bug)(\(.+\))?\:/i' + - label: 'documentation' + title: + - '/^docs(\(.+\))?\:/i' + - label: 'chore' + title: + - '/^chore(\(.+\))?\:/i' + - label: 'dependencies' + title: + - '/^deps(\(.+\))?\:/i' diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 7bab45a5aa..43cb9ad9d2 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -5,6 +5,10 @@ on: push: branches: - main + # pull_request event is required only for autolabeler + pull_request: + # Only following types are handled by the action, but one can default to all as well + types: [opened, reopened, synchronize] permissions: contents: read @@ -17,5 +21,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: release-drafter/release-drafter@3f0f87098bd6b5c5b9a36d49c41d998ea58f9348 # v5.19.0 + with: + disable-autolabeler: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 4693160d8f888fcc7d6aa4ca2341f13a9f38bed7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Tue, 10 Dec 2024 12:37:12 +0100 Subject: [PATCH 3/8] docs: document the existing conventions for commits categories --- docs/contributing.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/contributing.md b/docs/contributing.md index 617b724b11..63bd033df4 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -29,12 +29,19 @@ Please just be sure to: * follow the style, naming and structure conventions of the rest of the project. * make commits atomic and easy to merge. * use [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) for the PR title. This will help us to understand the nature of the changes, and to generate the changelog after all the commits in the PR are squashed. + * Please use the `break` type for breaking changes, as these categories are considered as `breaking change` in the changelog. + * Please use the `security` type for security fixes, as these categories are considered as `security` in the changelog. + * Please use the `feat` type for new features, as these categories are considered as `feature` in the changelog. + * Please use the `fix` type for bug fixes, as these categories are considered as `bug` in the changelog. + * Please use the `docs` type for documentation updates, as these categories are considered as `documentation` in the changelog. + * Please use the `chore` type for housekeeping commits, including `build`, `ci`, `style`, `refactor`, `test`, `perf` and so on, as these categories are considered as `chore` in the changelog. + * Please use the `deps` type for dependency updates, as these categories are considered as `dependencies` in the changelog. !!!important There is a GitHub Actions workflow that will check if your PR title follows the conventional commits convention. If not, it contributes a failed check to your PR. To know more about the conventions, please refer to the [workflow file](https://github.com/testcontainers/testcontainers-go/blob/main/.github/workflows/conventions.yml). -* use [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) for your commit messages, as it improves the readability of the commit history, and the review process. +* use [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) for your commit messages, as it improves the readability of the commit history, and the review process. Please follow the above conventions for the PR title. * unless necessary, please try to **avoid pushing --force** to the published branch you submitted a PR from, as it makes it harder to review the changes from a given previous state. * apply format running `make lint-all`. It will run `golangci-lint` for the core and modules with the configuration set in the root directory of the project. Please be aware that the lint stage on CI could fail if this is not done. * For linting just the modules: `make -C modules lint-modules` From 49def8c7f24d49f5051dd33cc2f874a0c2a0c649 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Tue, 10 Dec 2024 12:40:50 +0100 Subject: [PATCH 4/8] fix: follow convention for breaking changes --- .github/release-drafter.yml | 2 +- .github/workflows/conventions.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index f5f1e37cfa..ae72781d55 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -29,7 +29,7 @@ categories: autolabeler: - label: 'breaking change' title: - - '/^break(\(.+\))?\:/i' + - '/^[a-z]+(\(.+\))?!\:/i' - label: 'security' title: - '/^security(\(.+\))?\:/i' diff --git a/.github/workflows/conventions.yml b/.github/workflows/conventions.yml index 3a1fb6fa3c..3d083e313c 100644 --- a/.github/workflows/conventions.yml +++ b/.github/workflows/conventions.yml @@ -22,13 +22,14 @@ jobs: with: # We may not need a scope on every commit (i.e. repo-level change). # + # feat!: read config consistenly # feat(redis): support for clustering # chore(redis): update tests # fix(redis): trim connection string # ^ ^ ^ # | | |__ Subject # | |_______ Scope - # |____________ Type + # |____________ Type: it can end with a ! to denote a breaking change. requireScope: false # Scope should be lowercase. disallowScopes: | @@ -40,7 +41,6 @@ jobs: didn't match the configured pattern. Please ensure that the subject doesn't start with an uppercase character. types: | - break security fix feat From 55e3f7d518fa73c5d1fc4ed6af0bad14649d1603 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Tue, 10 Dec 2024 12:44:10 +0100 Subject: [PATCH 5/8] chore: capture breaking changes in the different sections when adding labels --- .github/release-drafter.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index ae72781d55..62823686e8 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -32,19 +32,19 @@ autolabeler: - '/^[a-z]+(\(.+\))?!\:/i' - label: 'security' title: - - '/^security(\(.+\))?\:/i' + - '/^security(\(.+\))?!?\:/i' - label: 'feature' title: - - '/^feat(\(.+\))?\:/i' + - '/^feat(\(.+\))?!?\:/i' - label: 'bug' title: - - '/^(fix|bug)(\(.+\))?\:/i' + - '/^(fix|bug)(\(.+\))?!?\:/i' - label: 'documentation' title: - - '/^docs(\(.+\))?\:/i' + - '/^docs(\(.+\))?!?\:/i' - label: 'chore' title: - - '/^chore(\(.+\))?\:/i' + - '/^chore(\(.+\))?!?\:/i' - label: 'dependencies' title: - - '/^deps(\(.+\))?\:/i' + - '/^deps(\(.+\))?!?\:/i' From dd31b6300489f9465c9ed479335722b1400a421b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Tue, 10 Dec 2024 17:00:42 +0100 Subject: [PATCH 6/8] chore: do not admit uppercase types --- .github/release-drafter.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 62823686e8..b786b4945a 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -29,22 +29,22 @@ categories: autolabeler: - label: 'breaking change' title: - - '/^[a-z]+(\(.+\))?!\:/i' + - '/^[a-z]+(\(.+\))?!\:/' - label: 'security' title: - - '/^security(\(.+\))?!?\:/i' + - '/^security(\(.+\))?!?\:/' - label: 'feature' title: - - '/^feat(\(.+\))?!?\:/i' + - '/^feat(\(.+\))?!?\:/' - label: 'bug' title: - - '/^(fix|bug)(\(.+\))?!?\:/i' + - '/^(fix|bug)(\(.+\))?!?\:/' - label: 'documentation' title: - - '/^docs(\(.+\))?!?\:/i' + - '/^docs(\(.+\))?!?\:/' - label: 'chore' title: - - '/^chore(\(.+\))?!?\:/i' + - '/^chore(\(.+\))?!?\:/' - label: 'dependencies' title: - - '/^deps(\(.+\))?!?\:/i' + - '/^deps(\(.+\))?!?\:/' From 1da093ca0177e6829f0fd4e5e486ab5f254d2b79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Tue, 10 Dec 2024 17:01:22 +0100 Subject: [PATCH 7/8] dix: do not admit bug as type --- .github/release-drafter.yml | 2 +- .github/workflows/conventions.yml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index b786b4945a..2e5efff2b1 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -38,7 +38,7 @@ autolabeler: - '/^feat(\(.+\))?!?\:/' - label: 'bug' title: - - '/^(fix|bug)(\(.+\))?!?\:/' + - '/^(fix)(\(.+\))?!?\:/' - label: 'documentation' title: - '/^docs(\(.+\))?!?\:/' diff --git a/.github/workflows/conventions.yml b/.github/workflows/conventions.yml index 3d083e313c..ef858a42b6 100644 --- a/.github/workflows/conventions.yml +++ b/.github/workflows/conventions.yml @@ -44,7 +44,6 @@ jobs: security fix feat - bug docs chore deps From c09bd411d2d947eda64f5a92a0658f7640c3836f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Wed, 11 Dec 2024 07:44:11 +0100 Subject: [PATCH 8/8] docs: remove breaking from the contributing guide --- docs/contributing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/contributing.md b/docs/contributing.md index 63bd033df4..5bc9802e4f 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -29,7 +29,7 @@ Please just be sure to: * follow the style, naming and structure conventions of the rest of the project. * make commits atomic and easy to merge. * use [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) for the PR title. This will help us to understand the nature of the changes, and to generate the changelog after all the commits in the PR are squashed. - * Please use the `break` type for breaking changes, as these categories are considered as `breaking change` in the changelog. + * Please use the `feat!`, `chore!`, `fix!`... types for breaking changes, as these categories are considered as `breaking change` in the changelog. Please use the `!` to denote a breaking change. * Please use the `security` type for security fixes, as these categories are considered as `security` in the changelog. * Please use the `feat` type for new features, as these categories are considered as `feature` in the changelog. * Please use the `fix` type for bug fixes, as these categories are considered as `bug` in the changelog.