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

changelog-gen to generate changelog entries for local setup #13

Merged
merged 14 commits into from
Apr 5, 2022

Conversation

dhiaayachi
Copy link
Contributor

This PR add a tool for generating changelog entries based on input parameters and also the current git branch in the current directory. This tool can be helpful to streamline the changelog entries creation in a personal setup.

Feature wise the command:

  • create changelog entry file based on provided fields (type, service, body)
  • format based on template
  • fetch github pr information (#, issue url...) automatically based on current branch and fill the entry with those
  • issue url is optional

(see the added README for more details)

os.Exit(1)
}
}
typeValues := []string{"enhancement",
Copy link
Contributor

@mikemorris mikemorris Jun 11, 2021

Choose a reason for hiding this comment

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

Could this array be moved up somewhere external to this file and potentially used to generate the template in https://github.com/hashicorp/go-changelog/blob/master/cmd/changelog-build/changelog.tmpl so we can be sure to keep generation, validation and build in sync?

The TypeValid check is nice! I could see this helping with some of the issues we've had with typos in the type field causing entries to be skipped during changelog-build.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes good idea, I will see in which package it make more sense to move it. For the template generation, my knowledge with it is very limited, I will need some help to set it up.

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 extracted both the slice and the typecheck func and used them in both tools, I'm not sure how to use it in template though

Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM! I might poke at implementing the configurable types list proposed in #6 as a followup.


The changelog template by default is as follow but also can be passed as parameter:

```gotemplate
Copy link
Contributor

Choose a reason for hiding this comment

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

Would maybe link out to the file instead of having it inline here in case content changes, and rename to something like changelog-entry.tmpl to avoid confusion with https://github.com/hashicorp/go-changelog/blob/master/cmd/changelog-build/changelog.tmpl

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My fear is that it will add an extra install step at the user end (copy the template somewhere) or the other option was to embed the template in the repo but then we will risk having it diverge between different projects.
I'm less familiar with the other projects and what are their workflow so I'm not sure.

Copy link
Contributor

Choose a reason for hiding this comment

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

Looked again and I like the current default template embedding with optional template path CLI flag.

@dhiaayachi dhiaayachi changed the title changelog-gen to generate changelog entries for local setupe changelog-gen to generate changelog entries for local setup Jun 14, 2021
@hashicorp-cla
Copy link

hashicorp-cla commented Mar 12, 2022

CLA assistant check
All committers have signed the CLA.

@dhiaayachi
Copy link
Contributor Author

@mikemorris Thank you for the help and the review on this, please merge it as I don't have write permission on this repo.

@mikemorris
Copy link
Contributor

I don't either! Maybe @i0rek or @bflad could?

@hanshasselberg hanshasselberg merged commit c82c13e into hashicorp:main Apr 5, 2022
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.

4 participants