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

chore(changelog): new way to maintain the changelog #11279

Merged
merged 13 commits into from
Aug 29, 2023
Merged

Conversation

vm-001
Copy link
Contributor

@vm-001 vm-001 commented Jul 25, 2023

Summary

Maintaining changelogs in a single markdown file in the repo is one of the easy ways to maintain and also keep consistency. Since Kong has multiple release versions, sometimes a bugfix needs to be backported to all the supported versions after it gets merged to the master branch. The backport bot is currently broken because of the git conflict.

I'm Introducing a new way to maintain Kong's changelog, which makes the changelog item become an individual file. The idea is, you don't get the conflict if you don't edit the same file.

Implementation details:

  • CHANGELOG/changelog is a Lua script that currently provides preview, and release commands. It only requires Penlight and lyaml libraries.
  • Using the template engine(provided by Penglight) which is similar to how Kong renders the nginx configuration.

Notes:

  • The changelog entry file is only for demonstration and will be deleted.

@github-actions github-actions bot added core/docs chore Not part of the core functionality of kong, but still needed labels Jul 25, 2023
@vm-001 vm-001 force-pushed the chore/changelog branch 2 times, most recently from b1d3e6d to e7eb0c1 Compare July 25, 2023 06:42
@vm-001 vm-001 marked this pull request as draft July 25, 2023 06:49
@vm-001 vm-001 force-pushed the chore/changelog branch 3 times, most recently from 0ea94c2 to 5b14d8a Compare July 25, 2023 06:56
@vm-001 vm-001 added pr/wip A work in progress PR opened to receive feedback pr/do not merge labels Jul 25, 2023
"breaking_change"
]
},
"scope": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you make this a string we may run into issues like:

plugin and plugins
Misspelled product names

What if you made this an enum with valid options, and included a misc keyword for things that dont fit into the options?

Copy link
Contributor Author

@vm-001 vm-001 Aug 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me. Updated. Enum value proposal is welcome. Regarding the misc, we can use null to replace it. changelog entry that set the scope to null or missing it will be grouped to a default scope.

For example

# 1.yaml
message: add a feature
type: feature
pr: 1

# 2.yaml
message: add b feature
type: feature
scope:
pr: 2

these two changelog entries will be grouped into a default scope.

@vm-001 vm-001 marked this pull request as ready for review August 2, 2023 07:30
@vm-001 vm-001 requested a review from hbagdi August 2, 2023 07:42
@Guaris Guaris self-requested a review August 2, 2023 15:42
@hanshuebner
Copy link
Contributor

Would you consider not requiring sequence numbers in file names? If order is important, prefixing with a date (YYYYMMDD) should do just fine. Sequence numbers in file names are not easy to maintain and create extra work in cases of conflict.

@vm-001
Copy link
Contributor Author

vm-001 commented Aug 3, 2023

Would you consider not requiring sequence numbers in file names? If order is important, prefixing with a date (YYYYMMDD) should do just fine. Sequence numbers in file names are not easy to maintain and create extra work in cases of conflict.

The changelog filename can be anything.(e.g. ${pr_number}.yaml or a-shot-description-message.yaml).

In the next phase, I will add a CI workflow to automatically extract the changelog message based on the PR title, and use the PR number as the filename, like 11279.yaml. Since PR number is already unique, so it wouldn't cause conflict.

CHANGELOG/schema.json Outdated Show resolved Hide resolved
@AndyZhang0707
Copy link
Collaborator

Please don't merge this PR. We will merge it on Aug 29th.

@windmgc windmgc merged commit 17c971b into master Aug 29, 2023
25 checks passed
@windmgc windmgc deleted the chore/changelog branch August 29, 2023 07:06
@team-gateway-bot
Copy link
Collaborator

The backport to release/2.8.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-release/2.8.x release/2.8.x
# Navigate to the new working tree
cd .worktrees/backport-release/2.8.x
# Create a new branch
git switch --create backport-11279-to-release/2.8.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 17c971b51a588d26c0c85dce11784ce516971024
# Push it to GitHub
git push --set-upstream origin backport-11279-to-release/2.8.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release/2.8.x

Then, create a pull request where the base branch is release/2.8.x and the compare/head branch is backport-11279-to-release/2.8.x.

@team-gateway-bot
Copy link
Collaborator

The backport to release/3.0.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-release/3.0.x release/3.0.x
# Navigate to the new working tree
cd .worktrees/backport-release/3.0.x
# Create a new branch
git switch --create backport-11279-to-release/3.0.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 17c971b51a588d26c0c85dce11784ce516971024
# Push it to GitHub
git push --set-upstream origin backport-11279-to-release/3.0.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release/3.0.x

Then, create a pull request where the base branch is release/3.0.x and the compare/head branch is backport-11279-to-release/3.0.x.

@team-gateway-bot
Copy link
Collaborator

The backport to release/3.1.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-release/3.1.x release/3.1.x
# Navigate to the new working tree
cd .worktrees/backport-release/3.1.x
# Create a new branch
git switch --create backport-11279-to-release/3.1.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 17c971b51a588d26c0c85dce11784ce516971024
# Push it to GitHub
git push --set-upstream origin backport-11279-to-release/3.1.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release/3.1.x

Then, create a pull request where the base branch is release/3.1.x and the compare/head branch is backport-11279-to-release/3.1.x.

team-gateway-bot pushed a commit that referenced this pull request Aug 29, 2023
Summary
Maintaining changelogs in a single markdown file in the repo is one of the easy ways to maintain and also keep consistency. Since Kong has multiple release versions, sometimes a bug fix needs to be backported to all the supported versions after it gets merged to the master branch. The backport bot is currently broken because of the git conflict.

We're Introducing a new way to maintain Kong's changelog, which makes the changelog item become an individual file. The idea is, that you don't get the conflict if you don't edit the same file.

---------

Co-authored-by: Hans Hübner <hans.huebner@gmail.com>
Co-authored-by: Wangchong Zhou <wangchong@konghq.com>
(cherry picked from commit 17c971b)
team-gateway-bot pushed a commit that referenced this pull request Aug 29, 2023
Summary
Maintaining changelogs in a single markdown file in the repo is one of the easy ways to maintain and also keep consistency. Since Kong has multiple release versions, sometimes a bug fix needs to be backported to all the supported versions after it gets merged to the master branch. The backport bot is currently broken because of the git conflict.

We're Introducing a new way to maintain Kong's changelog, which makes the changelog item become an individual file. The idea is, that you don't get the conflict if you don't edit the same file.

---------

Co-authored-by: Hans Hübner <hans.huebner@gmail.com>
Co-authored-by: Wangchong Zhou <wangchong@konghq.com>
(cherry picked from commit 17c971b)
team-gateway-bot pushed a commit that referenced this pull request Aug 29, 2023
Summary
Maintaining changelogs in a single markdown file in the repo is one of the easy ways to maintain and also keep consistency. Since Kong has multiple release versions, sometimes a bug fix needs to be backported to all the supported versions after it gets merged to the master branch. The backport bot is currently broken because of the git conflict.

We're Introducing a new way to maintain Kong's changelog, which makes the changelog item become an individual file. The idea is, that you don't get the conflict if you don't edit the same file.

---------

Co-authored-by: Hans Hübner <hans.huebner@gmail.com>
Co-authored-by: Wangchong Zhou <wangchong@konghq.com>
(cherry picked from commit 17c971b)
vm-001 added a commit that referenced this pull request Aug 29, 2023
Summary
Maintaining changelogs in a single markdown file in the repo is one of the easy ways to maintain and also keep consistency. Since Kong has multiple release versions, sometimes a bug fix needs to be backported to all the supported versions after it gets merged to the master branch. The backport bot is currently broken because of the git conflict.

We're Introducing a new way to maintain Kong's changelog, which makes the changelog item become an individual file. The idea is, that you don't get the conflict if you don't edit the same file.

---------

Co-authored-by: Hans Hübner <hans.huebner@gmail.com>
Co-authored-by: Wangchong Zhou <wangchong@konghq.com>
(cherry picked from commit 17c971b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Not part of the core functionality of kong, but still needed core/docs pr/wip A work in progress PR opened to receive feedback size/XL skip-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants