Changelog Overhaul #18

Merged
lafriks merged 10 commits from jolheiser/changelog:master into master 2020-01-09 07:43:22 +00:00
Owner

Primarily this PR was to add the ability to skip PRs containing a certain label, in this case skip-changelog.
However, I decided to give it an overhaul since there's a good chance that this utility will continue to be our primary way to generate changelogs moving forward.

Full list of changes:

  • Add config option for skipping a PR based on a defined regex to match against labels
  • Convert to Go modules
  • Extract config to separate file for re-usability and better maintainability
  • Extract commands into their own .go files for better maintainability
  • Add auto-generated default config based on example config
  • Update all dependencies (and run go mod tidy a million times to make sure it's right)
  • Make CLI options global for re-usability
  • Re-word and update the README

Fixes #17

Primarily this PR was to add the ability to skip PRs containing a certain label, in this case `skip-changelog`. However, I decided to give it an overhaul since there's a good chance that this utility will continue to be our primary way to generate changelogs moving forward. Full list of changes: * Add config option for skipping a PR based on a defined regex to match against labels * Convert to Go modules * Extract config to separate file for re-usability and better maintainability * Extract commands into their own `.go` files for better maintainability * Add auto-generated default config based on example config * Update all dependencies (and run `go mod tidy` a million times to make sure it's right) * Make CLI options global for re-usability * Re-word and update the README Fixes #17
jolheiser added the
enhancement
label 2020-01-08 19:03:50 +00:00
Member

It would be nice to have possibility to set wildcard for label name for skip-label for example backport/*

It would be nice to have possibility to set wildcard for label name for `skip-label` for example `backport/*`
Author
Owner

@lafriks Would regex be acceptable rather than introducing globs?
skip-labels is now a regex field.

@lafriks ~~Would regex be acceptable rather than introducing globs?~~ `skip-labels` is now a regex field.
Member

I'm trying to run this with Gitea's conf but I'm getting an empty changelog (contributors are listed, tough):

$ ./changelog -m 1.11.0 -c ~/src/code.gitea.io/gitea/.changelog.yml generate
## [1.11.0](https://github.com/go-gitea/gitea/releases/tag/v1.11.0) - 2020-01-08
$ ./changelog -m 1.10.3 -c ~/src/code.gitea.io/gitea/.changelog.yml generate
## [1.10.3](https://github.com/go-gitea/gitea/releases/tag/v1.10.3) - 2020-01-08

Should I update the config somehow?

Also, the error messages need an extra \n at the end:

$ ./changelog
NAME:
   changelog - Changelog generator for Gitea

USAGE:
   changelog [global options] command [command options] [arguments...]

VERSION:
   0.2

COMMANDS:
   generate      generate changelog
   contributors  generate contributors list
   help, h       Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --milestone value, -m value  Targeted milestone
   --config value, -c value     Specify a config file
   --help, -h                   show help (default: false)
   --version, -v                print the version (default: false)
Failed to run app with []: Required flag "milestone" not set$

(Notice the prompt $ right after "not set")

I'm trying to run this with Gitea's conf but I'm getting an empty changelog (contributors are listed, tough): ``` $ ./changelog -m 1.11.0 -c ~/src/code.gitea.io/gitea/.changelog.yml generate ## [1.11.0](https://github.com/go-gitea/gitea/releases/tag/v1.11.0) - 2020-01-08 $ ./changelog -m 1.10.3 -c ~/src/code.gitea.io/gitea/.changelog.yml generate ## [1.10.3](https://github.com/go-gitea/gitea/releases/tag/v1.10.3) - 2020-01-08 ``` Should I update the config somehow? Also, the error messages need an extra `\n` at the end: ``` $ ./changelog NAME: changelog - Changelog generator for Gitea USAGE: changelog [global options] command [command options] [arguments...] VERSION: 0.2 COMMANDS: generate generate changelog contributors generate contributors list help, h Shows a list of commands or help for one command GLOBAL OPTIONS: --milestone value, -m value Targeted milestone --config value, -c value Specify a config file --help, -h show help (default: false) --version, -v print the version (default: false) Failed to run app with []: Required flag "milestone" not set$ ``` (Notice the prompt `$` right after "not set")
Author
Owner

@guillep2k both issues should be fixed now.

@guillep2k both issues should be fixed now.
guillep2k approved these changes 2020-01-08 21:38:49 +00:00
Dismissed
lafriks approved these changes 2020-01-09 07:42:06 +00:00
Dismissed
lafriks closed this pull request 2020-01-09 07:43:22 +00:00
6543 added this to the v0.1.0 milestone 2020-01-26 03:58:36 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: gitea/changelog#18
No description provided.