-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat(changelog-tool): add changelog command line tool #1
Conversation
changelog.lua
Outdated
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. |
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.
Please explain what's the difference of preview
and release
.
changelog.lua
Outdated
local sources = { string.upper(ctx.commit.message), string.upper(ctx.pull.body) } | ||
for _, text in ipairs(sources) do | ||
match_pattern(text, "FTI%-%d+", jiras) | ||
match_pattern(text, "KAG%-%d+", jiras) |
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.
We have other projects. Suggest we do not hard code these prefixes.
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.
Kong/kong#11613. If the rule is too broad, then how can we avoid matching Sep-2023 ?
changelog.lua
Outdated
|
||
|
||
local function is_yaml(filename) | ||
return pl_stringx.endswith(filename, ".yaml") or |
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.
Remove the .yaml
support.
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 keep both file suffixes support here until one of them is completely gone.
changelog.lua
Outdated
end | ||
|
||
if folder == UNRELEASED then | ||
os.execute("mv " .. pl_path.join(path, UNRELEASED) .. " " .. target_path) |
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.
These does not really need to be so automatic, I would not feel too comfortable having a script mv
file on the disk for me, it is very easy to make a mistake in the command and cause damage.
Just print out the command and let user execute it themself.
I even argue this script should not even write the .md
file directly, use the KISS principal and let user do:
./changelog.lua 3.4.0. /path/to/kong/unreleased > CHANGELOG-3.4.0.md
is much better and safer.
If we really need to automate, Makefile and a shell script is much better idea.
Makefile
Outdated
@@ -0,0 +1,9 @@ | |||
test: |
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.
Only for demo, will be removed.
079fe1f
to
51ad01c
Compare
No description provided.