-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
chore(changelog): new way to maintain the changelog #11279
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
e36e1a1
chore(changelog): Introduce a new way to maintain the changelog
vm-001 2e7a557
update
vm-001 d63d91b
update README.md
vm-001 679f1f3
update
vm-001 bc7551e
update
vm-001 a868bc9
update
vm-001 59c852b
update
vm-001 1151230
remove options for release and preview command
vm-001 3a1c0d6
Update CHANGELOG/changelog
hanshuebner f7774ff
cleanup
vm-001 1112ee0
Update .github/workflows/build_and_test.yml
vm-001 b9583e2
specific commit sha
vm-001 1264fb8
code style
vm-001 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Changelog | ||
|
||
on: | ||
pull_request: | ||
types: [ "opened", "synchronize", "labeled", "unlabeled" ] | ||
|
||
jobs: | ||
require-changelog: | ||
name: Is changelog required? | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 2 | ||
|
||
- name: Retrives changed files in CHANGELOG/unreleased/**/*.yaml | ||
id: changelog-check | ||
uses: tj-actions/changed-files@5817a9efb0d7cc34b917d8146ea10b9f32044968 # v37 | ||
with: | ||
files: 'CHANGELOG/unreleased/**/*.yaml' | ||
|
||
- name: Requires a changelog file if 'skip-changelog' label is not added | ||
if: ${{ !contains(github.event.*.labels.*.name, 'skip-changelog') }} | ||
run: > | ||
if [ "${{ steps.changelog-check.outputs.added_files_count }}" = "0" ]; then | ||
echo "PR should contain a changelog file" | ||
exit 1 | ||
fi | ||
|
||
validate-changelog: | ||
name: Validate changelog | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Validate changelogs | ||
uses: thiagodnf/yaml-schema-checker@228a5be72029114e3cd6301e0aaeef6b557fa033 # v0.0.8 | ||
with: | ||
jsonSchemaFile: CHANGELOG/schema.json | ||
yamlFiles: | | ||
CHANGELOG/unreleased/*/*.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
install_dependencies: | ||
luarocks install penlight --local | ||
luarocks install lyaml --local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# CHANGELOG | ||
|
||
The CHANGELOG directory is used for individual changelog file practice. | ||
The `kong/CHANGELOG.md` now is deprecated. | ||
|
||
|
||
## How to add a changelog file for your PR? | ||
|
||
hanshuebner marked this conversation as resolved.
Show resolved
Hide resolved
|
||
1/ Copy the `changelog-template.yaml` file and rename with your PR number or a short message as the filename. For example, `11279.yaml`, `introduce-a-new-changelog-system.yaml`. (Prefer using PR number as it's already unique and wouldn't introduce conflict) | ||
|
||
2/ Fill out the changelog template. | ||
|
||
|
||
The description of the changelog file field, please follow the `schema.json` for more details. | ||
|
||
- message: Message of the changelog | ||
- type: Changelog type. (`feature`, `bugfix`, `dependency`, `deprecation`, `breaking_change`) | ||
- scope: Changelog scope. (`Core`, `Plugin`, `PDK`, `Admin API`, `Performance`, `Configuration`, `Clustering`) | ||
- prs: List of associated GitHub PRs | ||
hanshuebner marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- issues: List of associated GitHub issues | ||
- jiras: List of associated Jira tickets for internal track | ||
|
||
Sample 1 | ||
```yaml | ||
message: Introduce the request id as core feature. | ||
type: feat | ||
scope: Core | ||
prs: | ||
- 11308 | ||
``` | ||
|
||
Sample 2 | ||
```yaml | ||
message: Fix response body gets repeated when `kong.response.get_raw_body()` is called multiple times in a request lifecycle. | ||
type: bugfix | ||
scope: PDK | ||
prs: | ||
- 11424 | ||
jiras: | ||
- "FTI-5296" | ||
``` | ||
|
||
|
||
## changelog command | ||
|
||
The `changelog` command tool provides `preview`, and `release` commands. | ||
|
||
### Prerequisites | ||
|
||
You can skip this part if you're at Kong Bazel virtual env. | ||
|
||
Install luajit | ||
|
||
Install luarocks libraries | ||
|
||
``` | ||
luarocks install penlight --local | ||
luarocks install lyaml --local | ||
``` | ||
|
||
### Usage | ||
|
||
```shell | ||
$ ./changelog -h | ||
|
||
Usage: changelog <command> [options] | ||
|
||
Commands: | ||
release <version> release a release note based on the files in the CHANGELOG/unreleased directory. | ||
preview <version> preview a release note based on the files in the CHANGELOG/unreleased directory. | ||
|
||
Options: | ||
-h, --help display help for command | ||
|
||
Examples: | ||
changelog preview 1.0.0 | ||
changelog release 1.0.0 | ||
``` | ||
|
||
**Preview a release note** | ||
```shell | ||
./changelog preview 1.0.0 | ||
``` | ||
|
||
**Release a release note** | ||
```shell | ||
./changelog release 1.0.0 | ||
``` |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will add another task in this file to auto create a changelog for PR, so I think
Changelog
is good to use