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

feat(changelog-tool): add changelog command line tool #1

Merged
merged 3 commits into from
Sep 27, 2023
Merged

feat(changelog-tool): add changelog command line tool #1

merged 3 commits into from
Sep 27, 2023

Conversation

vm-001
Copy link
Contributor

@vm-001 vm-001 commented Sep 14, 2023

No description provided.

@CLAassistant
Copy link

CLAassistant commented Sep 14, 2023

CLA assistant check
All committers have signed the CLA.

@vm-001 vm-001 requested a review from dndx September 14, 2023 07:42
changelog.lua Outdated Show resolved Hide resolved
.github/workflows/generate.yml Outdated Show resolved Hide resolved
schema.json Outdated Show resolved Hide resolved
changelog.lua Outdated
Comment on lines 349 to 350
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.
Copy link
Member

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)
Copy link
Member

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.

Copy link
Contributor Author

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 Show resolved Hide resolved
changelog.lua Outdated Show resolved Hide resolved
changelog.lua Outdated


local function is_yaml(filename)
return pl_stringx.endswith(filename, ".yaml") or
Copy link
Member

Choose a reason for hiding this comment

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

Remove the .yaml support.

Copy link
Contributor Author

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 Show resolved Hide resolved
schema.json Outdated Show resolved Hide resolved
changelog.lua Outdated
end

if folder == UNRELEASED then
os.execute("mv " .. pl_path.join(path, UNRELEASED) .. " " .. target_path)
Copy link
Member

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:
Copy link
Contributor Author

@vm-001 vm-001 Sep 20, 2023

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.

@vm-001 vm-001 changed the title feat: init feat(changelog-tool): add changelog command line tool Sep 20, 2023
@dndx dndx merged commit b525126 into main Sep 27, 2023
@dndx dndx deleted the dev branch September 27, 2023 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants