From 8ebbf1c7f74082a04f8df25e2d4d58461840b02d Mon Sep 17 00:00:00 2001 From: Datong Sun Date: Fri, 13 Oct 2023 01:33:32 -0700 Subject: [PATCH 01/13] chore(actions): enforce new changelog format and convention --- .github/workflows/changelog-requirement.yml | 52 +++++++++++++++++---- 1 file changed, 44 insertions(+), 8 deletions(-) diff --git a/.github/workflows/changelog-requirement.yml b/.github/workflows/changelog-requirement.yml index 5acc705dea3..dbe6d84801e 100644 --- a/.github/workflows/changelog-requirement.yml +++ b/.github/workflows/changelog-requirement.yml @@ -7,6 +7,7 @@ on: - 'kong/**' - '**.rockspec' - '.requirements' + - 'changelog/**' jobs: require-changelog: @@ -18,15 +19,50 @@ jobs: with: fetch-depth: 2 - - name: computes changed files - id: changelog-check + - name: Find changelog files + id: changelog-list uses: tj-actions/changed-files@db153baf731265ad02cd490b07f470e2d55e3345 # v37 with: - files: 'changelog/unreleased/**/*.yml' + all_yml: | + changelogs: + - 'changelog/unreleased/**/*.yml' + upper_case: + - 'CHANGELOG/**' + numbered: + - 'CHANGELOG/unreleased/**/[0-9]+.yml' - - name: asserts changelog added + - name: Check changelog existence + if: steps.changelog-list.outputs.all_yml_any_changed == 'true' run: > - if [ "${{ steps.changelog-check.outputs.all_changed_and_modified_files_count }}" = "0" ]; then - echo "Should contain at least one changelog file in changelog/unreleased/*/ directory" - exit 1 - fi + echo "Changelog file expected but found none. If you believe this PR requires no changelog entry, attach the \"skip-changelog\" tag to the PR." + echo "Refer to https://github.com/Kong/gateway-changelog for format guidelines." + exit 1 + + - name: Check incorrect case for changelog directory + if: steps.changelog-list.outputs.upper_case_any_changed == 'true' + run: | + echo "Please use \"changelog\" (all lowercase) for changelog modifications." + echo "Refer to https://github.com/Kong/gateway-changelog for format guidelines." + echo "Bad file(s): ${{ steps.changelog-list.outputs.upper_case_all_changed_files }}" + exit 1 + + - name: Check incorrect case for changelog directory + if: steps.changelog-list.outputs.numbered_any_changed == 'true' + run: | + echo "Please use short descriptive name for changelog files instead of numbers." + echo "E.g. bump_openresty.yml instead of 12345.yml." + echo "Refer to https://github.com/Kong/gateway-changelog for format guidelines." + echo "Bad file(s): ${{ steps.changelog-list.outputs.numbered_all_changed_files }}" + exit 1 + + - name: Check deprecated YAML keys + if: steps.changelog-list.outputs.all_yml_any_changed == 'true' + run: > + for file in ${{ steps.changelog-list.outputs.all_yml_all_changed_files }}; do + if grep -q "prs:" $file || grep -q "jiras:" $file; then + echo "Please do not include prs or jiras keys in new changelogs, put the JIRA number inside commit message and PR description instead." + echo "Refer to https://github.com/Kong/gateway-changelog for format guidelines." + echo "Bad file: $file" + exit 1 + fi + done From 28754a363aafe55985a43619f2dab59e3330f321 Mon Sep 17 00:00:00 2001 From: Datong Sun Date: Fri, 13 Oct 2023 01:36:04 -0700 Subject: [PATCH 02/13] temp for test --- changelog/unreleased/kong/fix_patch_order.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog/unreleased/kong/fix_patch_order.yml b/changelog/unreleased/kong/fix_patch_order.yml index 00089c0d848..65298f8c0f7 100644 --- a/changelog/unreleased/kong/fix_patch_order.yml +++ b/changelog/unreleased/kong/fix_patch_order.yml @@ -5,3 +5,4 @@ prs: - 11696 jiras: - KAG-2712 + From 5b6a422570d0674d10c904226edfa4ace5001a11 Mon Sep 17 00:00:00 2001 From: Datong Sun Date: Fri, 13 Oct 2023 01:37:52 -0700 Subject: [PATCH 03/13] fix syntax error --- .github/workflows/changelog-requirement.yml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/changelog-requirement.yml b/.github/workflows/changelog-requirement.yml index dbe6d84801e..0667b62f6bf 100644 --- a/.github/workflows/changelog-requirement.yml +++ b/.github/workflows/changelog-requirement.yml @@ -23,16 +23,16 @@ jobs: id: changelog-list uses: tj-actions/changed-files@db153baf731265ad02cd490b07f470e2d55e3345 # v37 with: - all_yml: | - changelogs: - - 'changelog/unreleased/**/*.yml' - upper_case: - - 'CHANGELOG/**' - numbered: - - 'CHANGELOG/unreleased/**/[0-9]+.yml' + files_yaml: | + changelogs: + - 'changelog/unreleased/**/*.yml' + upper_case: + - 'CHANGELOG/**' + numbered: + - 'CHANGELOG/unreleased/**/[0-9]+.yml' - name: Check changelog existence - if: steps.changelog-list.outputs.all_yml_any_changed == 'true' + if: steps.changelog-list.outputs.changelogs_any_changed == 'false' run: > echo "Changelog file expected but found none. If you believe this PR requires no changelog entry, attach the \"skip-changelog\" tag to the PR." echo "Refer to https://github.com/Kong/gateway-changelog for format guidelines." @@ -56,11 +56,10 @@ jobs: exit 1 - name: Check deprecated YAML keys - if: steps.changelog-list.outputs.all_yml_any_changed == 'true' run: > - for file in ${{ steps.changelog-list.outputs.all_yml_all_changed_files }}; do + for file in ${{ steps.changelog-list.outputs.changelogs_all_changed_files }}; do if grep -q "prs:" $file || grep -q "jiras:" $file; then - echo "Please do not include prs or jiras keys in new changelogs, put the JIRA number inside commit message and PR description instead." + echo "Please do not include \"prs\" or \"jiras\" keys in new changelogs, put the JIRA number inside commit message and PR description instead." echo "Refer to https://github.com/Kong/gateway-changelog for format guidelines." echo "Bad file: $file" exit 1 From 76e5524dbdd4726ed32c347c9cd1d663b46c8a17 Mon Sep 17 00:00:00 2001 From: Datong Sun Date: Fri, 13 Oct 2023 01:43:45 -0700 Subject: [PATCH 04/13] test --- changelog/unreleased/kong/fix_patch_order.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/changelog/unreleased/kong/fix_patch_order.yml b/changelog/unreleased/kong/fix_patch_order.yml index 65298f8c0f7..4928a8fabb4 100644 --- a/changelog/unreleased/kong/fix_patch_order.yml +++ b/changelog/unreleased/kong/fix_patch_order.yml @@ -1,8 +1,3 @@ message: fix the building failure when applying patches type: bugfix scope: Core -prs: - - 11696 -jiras: - - KAG-2712 - From 17c0b2eaf708f20490c1e252d8c2c4f1f7624c57 Mon Sep 17 00:00:00 2001 From: Datong Sun Date: Fri, 13 Oct 2023 01:48:12 -0700 Subject: [PATCH 05/13] fix title --- .github/workflows/changelog-requirement.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/changelog-requirement.yml b/.github/workflows/changelog-requirement.yml index 0667b62f6bf..f54da1e1d2d 100644 --- a/.github/workflows/changelog-requirement.yml +++ b/.github/workflows/changelog-requirement.yml @@ -46,7 +46,7 @@ jobs: echo "Bad file(s): ${{ steps.changelog-list.outputs.upper_case_all_changed_files }}" exit 1 - - name: Check incorrect case for changelog directory + - name: Check numbered filename for changelog entry if: steps.changelog-list.outputs.numbered_any_changed == 'true' run: | echo "Please use short descriptive name for changelog files instead of numbers." From 55c27480391853b8bf5558320be3243ca4177114 Mon Sep 17 00:00:00 2001 From: Datong Sun Date: Fri, 13 Oct 2023 01:49:32 -0700 Subject: [PATCH 06/13] change message wording --- .github/workflows/changelog-requirement.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/changelog-requirement.yml b/.github/workflows/changelog-requirement.yml index f54da1e1d2d..33242536bf7 100644 --- a/.github/workflows/changelog-requirement.yml +++ b/.github/workflows/changelog-requirement.yml @@ -34,7 +34,7 @@ jobs: - name: Check changelog existence if: steps.changelog-list.outputs.changelogs_any_changed == 'false' run: > - echo "Changelog file expected but found none. If you believe this PR requires no changelog entry, attach the \"skip-changelog\" tag to the PR." + echo "Changelog file expected but found none. If you believe this PR requires no changelog entry, label it with \"skip-changelog\"." echo "Refer to https://github.com/Kong/gateway-changelog for format guidelines." exit 1 From ac619feb961b2cda4e12f48d06933fa122290bc7 Mon Sep 17 00:00:00 2001 From: Datong Sun Date: Fri, 13 Oct 2023 01:59:59 -0700 Subject: [PATCH 07/13] test --- changelog/unreleased/kong/11625.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog/unreleased/kong/11625.yml b/changelog/unreleased/kong/11625.yml index e4b14f81e2e..9e90b84a2a4 100644 --- a/changelog/unreleased/kong/11625.yml +++ b/changelog/unreleased/kong/11625.yml @@ -5,3 +5,4 @@ - 11625 "jiras": - "KAG-2444" + From 2dbf71248d71ac12223464f8d3c8d196f446ad38 Mon Sep 17 00:00:00 2001 From: Datong Sun Date: Fri, 13 Oct 2023 02:02:37 -0700 Subject: [PATCH 08/13] fix path --- .github/workflows/changelog-requirement.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/changelog-requirement.yml b/.github/workflows/changelog-requirement.yml index 33242536bf7..fb4cecbeb55 100644 --- a/.github/workflows/changelog-requirement.yml +++ b/.github/workflows/changelog-requirement.yml @@ -29,7 +29,7 @@ jobs: upper_case: - 'CHANGELOG/**' numbered: - - 'CHANGELOG/unreleased/**/[0-9]+.yml' + - 'changelog/unreleased/**/[0-9]+.yml' - name: Check changelog existence if: steps.changelog-list.outputs.changelogs_any_changed == 'false' From a570467c7568cbe2f974e13b9a26b78f46802b22 Mon Sep 17 00:00:00 2001 From: Datong Sun Date: Fri, 13 Oct 2023 02:04:46 -0700 Subject: [PATCH 09/13] rename file --- .../unreleased/kong/{11625.yml => on_prem_dp_metadata.yml} | 5 ----- 1 file changed, 5 deletions(-) rename changelog/unreleased/kong/{11625.yml => on_prem_dp_metadata.yml} (77%) diff --git a/changelog/unreleased/kong/11625.yml b/changelog/unreleased/kong/on_prem_dp_metadata.yml similarity index 77% rename from changelog/unreleased/kong/11625.yml rename to changelog/unreleased/kong/on_prem_dp_metadata.yml index 9e90b84a2a4..0540c597678 100644 --- a/changelog/unreleased/kong/11625.yml +++ b/changelog/unreleased/kong/on_prem_dp_metadata.yml @@ -1,8 +1,3 @@ "message": "**Clustering**: Allow configuring DP metadata labels for on-premise CP Gateway" "type": "feature" "scope": "Clustering" -"prs": -- 11625 -"jiras": -- "KAG-2444" - From d02e6a7229cd015f37590bfb73a25890015ebc12 Mon Sep 17 00:00:00 2001 From: Datong Sun Date: Fri, 13 Oct 2023 02:05:27 -0700 Subject: [PATCH 10/13] remove prs --- changelog/unreleased/kong/wasm-filter-config-schemas.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/changelog/unreleased/kong/wasm-filter-config-schemas.yml b/changelog/unreleased/kong/wasm-filter-config-schemas.yml index daaa21ff7f6..afaadc295b7 100644 --- a/changelog/unreleased/kong/wasm-filter-config-schemas.yml +++ b/changelog/unreleased/kong/wasm-filter-config-schemas.yml @@ -1,7 +1,3 @@ message: Add support for optional Wasm filter configuration schemas type: feature scope: Core -prs: - - 11568 -jiras: - - KAG-662 From d1054556dea809908abb602b48616977297e2cee Mon Sep 17 00:00:00 2001 From: Datong Sun Date: Tue, 17 Oct 2023 02:44:52 -0500 Subject: [PATCH 11/13] Update .github/workflows/changelog-requirement.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Hans Hübner --- .github/workflows/changelog-requirement.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/changelog-requirement.yml b/.github/workflows/changelog-requirement.yml index fb4cecbeb55..6ef1329aaf2 100644 --- a/.github/workflows/changelog-requirement.yml +++ b/.github/workflows/changelog-requirement.yml @@ -38,7 +38,7 @@ jobs: echo "Refer to https://github.com/Kong/gateway-changelog for format guidelines." exit 1 - - name: Check incorrect case for changelog directory + - name: Check correct case for changelog directory if: steps.changelog-list.outputs.upper_case_any_changed == 'true' run: | echo "Please use \"changelog\" (all lowercase) for changelog modifications." From 6f37f6579845808f3ea1f07fec8dd455419dd28e Mon Sep 17 00:00:00 2001 From: Datong Sun Date: Tue, 17 Oct 2023 02:44:58 -0500 Subject: [PATCH 12/13] Update .github/workflows/changelog-requirement.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Hans Hübner --- .github/workflows/changelog-requirement.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/changelog-requirement.yml b/.github/workflows/changelog-requirement.yml index 6ef1329aaf2..ddc165d5410 100644 --- a/.github/workflows/changelog-requirement.yml +++ b/.github/workflows/changelog-requirement.yml @@ -55,7 +55,7 @@ jobs: echo "Bad file(s): ${{ steps.changelog-list.outputs.numbered_all_changed_files }}" exit 1 - - name: Check deprecated YAML keys + - name: Fail when deprecated YAML keys are used run: > for file in ${{ steps.changelog-list.outputs.changelogs_all_changed_files }}; do if grep -q "prs:" $file || grep -q "jiras:" $file; then From 31b9c0dea295ec1b1906d2d88cfcd56b0d692606 Mon Sep 17 00:00:00 2001 From: Datong Sun Date: Tue, 17 Oct 2023 02:45:03 -0500 Subject: [PATCH 13/13] Update .github/workflows/changelog-requirement.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Hans Hübner --- .github/workflows/changelog-requirement.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/changelog-requirement.yml b/.github/workflows/changelog-requirement.yml index ddc165d5410..dc318badaba 100644 --- a/.github/workflows/changelog-requirement.yml +++ b/.github/workflows/changelog-requirement.yml @@ -46,7 +46,7 @@ jobs: echo "Bad file(s): ${{ steps.changelog-list.outputs.upper_case_all_changed_files }}" exit 1 - - name: Check numbered filename for changelog entry + - name: Check descriptive filename for changelog entry if: steps.changelog-list.outputs.numbered_any_changed == 'true' run: | echo "Please use short descriptive name for changelog files instead of numbers."