From 1c4dd205b16df33341ea9353cc71aa5c7fbfdd36 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Tue, 14 Feb 2023 17:03:59 +0000 Subject: [PATCH 1/3] ci: Add support for release/experimental label --- docs/CONTRIBUTING.md | 4 ++++ scripts/release.sh | 1 + scripts/release/check_commit_metadata.sh | 8 +++++++- scripts/release/generate_release_notes.sh | 5 +++++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index ce070eba749af..9521121775d2a 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -236,3 +236,7 @@ Breaking changes can be triggered in two ways: ### Security The [`security`](https://github.com/coder/coder/issues?q=sort%3Aupdated-desc+label%3Asecurity) label can be added to PRs that have, or will be, merged into `main`. Doing so will make sure the change stands out in the release notes. + +### Experimental + +The [`release/experimental`](https://github.com/coder/coder/issues?q=sort%3Aupdated-desc+label%3Arelease%2Fexperimental) label can be used to move the note to the bottom of the release notes under a separate title. diff --git a/scripts/release.sh b/scripts/release.sh index acc9a91131e0b..278e06468024d 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -25,6 +25,7 @@ either contain a known prefix with an exclamation mark ("feat!:", GitHub labels that affect release notes: - release/breaking: Shown under BREAKING CHANGES, prevents patch release. +- release/experimental: Shown at the bottom under Experimental. - security: Shown under SECURITY. Flags: diff --git a/scripts/release/check_commit_metadata.sh b/scripts/release/check_commit_metadata.sh index 9e6c2234be64e..c11f9d0b59abf 100755 --- a/scripts/release/check_commit_metadata.sh +++ b/scripts/release/check_commit_metadata.sh @@ -48,9 +48,12 @@ main() { breaking_title="^[a-z]+(\([a-z]*\))?!:" breaking_label=release/breaking breaking_category=breaking + experimental_label=release/experimental + experimental_category=experimental # Security related changes are labeled `security`. security_label=security + security_category=security # Get abbreviated and full commit hashes and titles for each commit. git_log_out="$(git log --no-merges --pretty=format:"%h %H %s" "$range")" @@ -120,7 +123,10 @@ main() { COMMIT_METADATA_BREAKING=1 continue elif [[ ${labels[$commit_sha_long]:-} = *"label:$security_label"* ]]; then - COMMIT_METADATA_CATEGORY[$commit_sha_short]=$security_label + COMMIT_METADATA_CATEGORY[$commit_sha_short]=$security_category + continue + elif [[ ${labels[$commit_sha_long]:-} = *"label:$experimental_label"* ]]; then + COMMIT_METADATA_CATEGORY[$commit_sha_short]=$experimental_category continue fi diff --git a/scripts/release/generate_release_notes.sh b/scripts/release/generate_release_notes.sh index 91ab16376aa3a..52522bed74848 100755 --- a/scripts/release/generate_release_notes.sh +++ b/scripts/release/generate_release_notes.sh @@ -81,6 +81,7 @@ declare -a section_order=( chore revert other + experimental ) declare -A section_titles=( @@ -97,6 +98,7 @@ declare -A section_titles=( [chore]='Chores' [revert]='Reverts' [other]='Other changes' + [experimental]='Experimental changes' ) # Verify that all items in section_order exist as keys in section_titles and @@ -134,6 +136,9 @@ changelog="$( changes="$(eval "echo -e \"\${${cat}_changelog:-}\"")" if ((${#changes} > 0)); then echo -e "\n### ${section_titles["$cat"]}\n" + if [[ $cat == experimental ]]; then + echo -e "These features or changes are experimental and may change or be removed in future releases.\n" + fi echo -e "$changes" fi done From 56eddfa69894b83d5962f33282817405e2d0dbc5 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Tue, 14 Feb 2023 20:21:38 +0200 Subject: [PATCH 2/3] Update scripts/release/generate_release_notes.sh Co-authored-by: Ben Potter --- scripts/release/generate_release_notes.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/release/generate_release_notes.sh b/scripts/release/generate_release_notes.sh index 52522bed74848..f04b5296d969b 100755 --- a/scripts/release/generate_release_notes.sh +++ b/scripts/release/generate_release_notes.sh @@ -137,7 +137,7 @@ changelog="$( if ((${#changes} > 0)); then echo -e "\n### ${section_titles["$cat"]}\n" if [[ $cat == experimental ]]; then - echo -e "These features or changes are experimental and may change or be removed in future releases.\n" + echo -e "These changes are feature-flagged and can be enabled with the `--experiments` server flag. They may change or be removed in future releases.\n" fi echo -e "$changes" fi From 4f136ac140ca4faaffd42d56ad18a2ad581bf1a5 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Tue, 14 Feb 2023 18:31:50 +0000 Subject: [PATCH 3/3] Fix backticks --- scripts/release/generate_release_notes.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/release/generate_release_notes.sh b/scripts/release/generate_release_notes.sh index f04b5296d969b..cb2f37bb09981 100755 --- a/scripts/release/generate_release_notes.sh +++ b/scripts/release/generate_release_notes.sh @@ -137,7 +137,7 @@ changelog="$( if ((${#changes} > 0)); then echo -e "\n### ${section_titles["$cat"]}\n" if [[ $cat == experimental ]]; then - echo -e "These changes are feature-flagged and can be enabled with the `--experiments` server flag. They may change or be removed in future releases.\n" + echo -e "These changes are feature-flagged and can be enabled with the \`--experiments\` server flag. They may change or be removed in future releases.\n" fi echo -e "$changes" fi