Skip to content
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

doc: Update dev docs for development and releases #63

Merged
merged 3 commits into from
Feb 28, 2024
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
6 changes: 2 additions & 4 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ If this change should be part of the Release Notes,
**replace this entire paragraph** with 1-3 sentences about the changes.
Otherwise, you **MUST** remove this section entirely.

## Breaking Changes

Does this PR contain any breaking changes?
If so **replace this entire paragraph** with a description of these changes.
Otherwise, you **MUST** remove this section entirely.
If so, add `## Breaking Changes` header and list the introduced changes there.

3 changes: 0 additions & 3 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ autolabeler:
- label: breaking-change
body:
- '/^## Breaking Changes/im'
- label: release-notes
body:
- '/^## Release Notes/im'
# Version labels.
- label: minor
title:
Expand Down
12 changes: 5 additions & 7 deletions .github/scripts/release-notes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ extract_header() {
local header_name="$2"
awk "
/^\s?$/ {next}
/## $header_name/ {rn=1}
rn && !/^##/ {print};
/##/ && !/## $header_name/ {rn=0}" <<<"$commit"
/^## $header_name/ {rn=1}
rn && !/^##/ && !/^--+/ {print};
/^--+/ {rn=0};
/^##/ && !/^## $header_name/ {rn=0}" <<<"$commit"
}

indent() {
Expand All @@ -45,10 +46,7 @@ while IFS= read -r line; do
fi
rls_header="${BASH_REMATCH[1]}"
fi
if [[ $rls_header == "" ]]; then
continue
fi
if [[ $line != -* ]]; then
if [[ $rls_header == "" ]] || [[ $line != -* ]] || [[ $line == *"@renovate"* ]]; then
continue
fi
if ! [[ $line =~ $commit_message_re ]]; then
Expand Down
10 changes: 10 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
MD010:
code_blocks: false
spaces_per_tab: 1
MD013:
line_length: 80
heading_line_length: 80
code_block_line_length: 120
code_blocks: true
MD024:
siblings_only: true
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ check/trailing:
check/markdown:
$(call _print_step,Verifying Markdown files)
$(call _ensure_installed,yarn,markdownlint)
yarn --silent markdownlint '*.md' --disable MD010 # MD010 does not handle code blocks well.
yarn --silent markdownlint '**/*.md' --ignore node_modules

## Check for potential vulnerabilities across all Go dependencies.
check/vulns:
Expand Down
31 changes: 15 additions & 16 deletions DEVELOPMENT.md → docs/DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Development

This document describes the intricacies of sloctl development workflow.
If you see anything missing, feel free to contribute :)

## Pull requests

[Pull request template](.github/pull_request_template.md)
is provided when you create new PR.
Section worth noting and getting familiar with is located under
`## Release Notes` header.

## Makefile

Expand All @@ -13,6 +21,12 @@ versions declaration located in Makefile.
If you see any discrepancies between CI and your local runs, remove the
binaries from `bin` and let Makefile reinstall them with the latest version.

## CI

Continuous integration pipelines utilize the same Makefile commands which
you run locally. This ensures consistent behavior of the executed checks
and makes local debugging easier.

## Testing

In addition to standard unit tests, sloctl is tested with
Expand Down Expand Up @@ -48,22 +62,7 @@ how they're executed.

## Releases

We're using [Release Drafter](https://github.com/release-drafter/release-drafter)
to automate release notes creation. Drafter also does its best to propose
the next release version based on commit messages from `main` branch.

Release Drafter is also responsible for auto-labeling of pull requests.
It checks both title and body of pull request and adds appropriate labels. \
**NOTE:** The auto-labeling mechanism will not remove labels once they're
created. For example, If you end up changing PR title from `sec:` to `fix:`
you'll have to manually remove `security` label.

On each commit to `main` branch, Release Drafter will update the next release
draft. Once you're ready to create new version, simply publish the draft.

In addition to Release Drafter, we're also running a script which extracts
explicitly listed release notes and breaking changes which are optionally
defined in `## Release Notes` and `## Breaking Changes` headers.
Refer to [RELEASE.md](./RELEASE.md) for more information on release process.

## Dependencies

Expand Down
25 changes: 25 additions & 0 deletions docs/RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Release process

The internal release process is described in great detail
[here](http://go/sloctl-release).

## Release automation details

We're using [Release Drafter](https://github.com/release-drafter/release-drafter)
to automate release notes creation. Drafter also does its best to propose
the next release version based on commit messages from `main` branch.

Release Drafter is also responsible for auto-labeling pull requests.
It checks both title and body of the pull request and adds appropriate labels. \
**NOTE:** The auto-labeling mechanism will not remove labels once they're
created. For example, If you end up changing PR title from `sec:` to `fix:`
you'll have to manually remove `security` label.

On each commit to `main` branch, Release Drafter will update the next release
draft. Once you're ready to create new version, simply publish this draft.

In addition to Release Drafter, we're also running a script which extracts
explicitly listed release notes and breaking changes which are optionally
defined in `## Release Notes` and `## Breaking Changes` headers.
It also performs a cleanup of the PR draft mitigating Release Drafter
shortcomings.
Loading