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): overwrite file if configured, pass max file size in MB #67

Merged
merged 10 commits into from
May 8, 2021

Conversation

fwiedmann
Copy link
Collaborator

@fwiedmann fwiedmann commented Mar 11, 2021

For #55.

  • New option --max-file-size check if an existing file exceeds the limit. If yes the current file will be moved to filename-<1-n>.file-extension. The new changelog will be written to
  • New option --overwrite will overwrite the current changelog file with the new generated changelog.

Copy link
Owner

@Nightapes Nightapes left a comment

Choose a reason for hiding this comment

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

Maybe, when we append to the file, should we also add a file size limit? When the file gets to big, we start a new one and keep the old file under different name?

.github/workflows/main.yml Outdated Show resolved Hide resolved
pkg/semanticrelease/semantic-release.go Outdated Show resolved Hide resolved
@fwiedmann
Copy link
Collaborator Author

Maybe, when we append to the file, should we also add a file size limit? When the file gets to big, we start a new one and keep the old file under different name?

Yes, good idea! What would be a good file limit?

Or we could limit it by the count of existing release changelogs in a file. A separator for this kind of solution could be the markdown line --- I've added here 628aa27#diff-c731271bb5d6c90070f88c75b0a2f58cc896ec4aafafc7391b648a8c178bf874R205

When a file limit / or max count of releases exceed, I would copy the current file to -[0-9].md
A good example can be found here: https://github.com/terraform-providers/terraform-provider-azurerm

@Nightapes
Copy link
Owner

Maybe we can start with 10 MB? Else we can make it changeable via the config file.
The amount of releases is also a good idea, but when you have a lot of small releases the files are really small

@Nightapes
Copy link
Owner

@fwiedmann are you still working on it?

@fwiedmann
Copy link
Collaborator Author

Yes still WIP. I can work on this again next weekend ;)

@fwiedmann fwiedmann changed the title WIP: update changelog generation feat(changelog): overwrite file if configured, pass max file size in MB May 8, 2021
@fwiedmann
Copy link
Collaborator Author

fwiedmann commented May 8, 2021

@Nightapes The basics are done. Could you review the current changes?

What is still missing:

  • add range of tags for changelog generation
  • generate changelog for all tags + new version

cmd/go-semantic-release/commands/changelog.go Outdated Show resolved Hide resolved
@@ -8,7 +8,9 @@ import (

func init() {
changelogCmd.Flags().Bool("checks", false, "Check for missing values and envs")
changelogCmd.Flags().Bool("overwrite", false, "Overwrite the content of the changelog. Default is to prepend the new changelog to the existing file.")
Copy link
Owner

Choose a reason for hiding this comment

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

Should we add the flags to the release commands and write the changelog there too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This would only improve the workflow if the users running the release command on their local machine right?
So If yes, I think they can run two commands :D

Copy link
Owner

Choose a reason for hiding this comment

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

True, but there are custom setups. But this can be done in a extra PR

@Nightapes Nightapes self-requested a review May 8, 2021 21:48
@Nightapes Nightapes merged commit a6783f2 into master May 8, 2021
@Nightapes Nightapes deleted the feat/changelog branch May 8, 2021 21:52
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.

2 participants