Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ci: Add support for release/experimental label #6208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
1 change: 1 addition & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 7 additions & 1 deletion scripts/release/check_commit_metadata.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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")"
Expand Down Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions scripts/release/generate_release_notes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ declare -a section_order=(
chore
revert
other
experimental
)

declare -A section_titles=(
Expand All @@ -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
Expand Down Expand Up @@ -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 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
done
Expand Down