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

WIP: Generate Changelog automagically #1298

Closed
wants to merge 4 commits into from

Conversation

bkcsoft
Copy link
Member

@bkcsoft bkcsoft commented Mar 17, 2017

What it does:

Automagically generate changelog on make release 🎉

TODO:

  • Generate changelog
  • Append historical changelog (kept in changelog/HISTORICAL.md
  • Move unreleased-section in current changelog to yaml-files
  • Updated the Makefile
  • Make it efficient 😂
  • Document it :trollface:

Format: (stolen from #505)

kind: enhancement # Mandatory! Possible values: breaking, feature, bugfixes, enhancement, misc
title: A short title that explains the change # Mandatory
pull_request: 256 # Mandatory. Number to indicate which PR this was made in.
issue: 234 # Optional. Issue number that got closed by this.
author: tboerger # Optional. The author/authors of the PR

Current implementation is extremely write-intensive... That should be fixed 🙄

Please be brutal when reviewing this, since it needs to work 100% flawless

I assigned all Owners to review, since we deal with this pain. Also assigned Team maintainers since I want more eyes on this code 😆

Closes #505

@bkcsoft bkcsoft added issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail pr/wip This PR is not ready for review labels Mar 17, 2017
@bkcsoft bkcsoft added this to the 1.2.0 milestone Mar 17, 2017
@bkcsoft
Copy link
Member Author

bkcsoft commented Mar 17, 2017

@strk Since I moved your changelog to a file, do you want your full name in there or nickname? (or both)

@tboerger tboerger added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 17, 2017
Copy link
Member

@tboerger tboerger left a comment

Choose a reason for hiding this comment

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

Maybe generally use log instead of fmt?

)

var (
version = flag.String("version", "", "Version for changelog")
Copy link
Member

Choose a reason for hiding this comment

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

The definition into main to avoid conflicts?

)

func init() {
flag.Parse()
Copy link
Member

Choose a reason for hiding this comment

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

Within the other scripts I have moved that into main as well

os.Exit(1)
}
if err := cl.Write(*outputFile); err != nil {
fmt.Printf("Error: writing changelog: %v\n", err)
Copy link
Member

Choose a reason for hiding this comment

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

Exit?

prUrlFormat = "https://github.com/go-gitea/gitea/pull/%d"
tagUrlFormat = "https://github.com/go-gitea/gitea/releases/tags/v%s"

cleTmpl = `
Copy link
Member

Choose a reason for hiding this comment

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

Incomplete or unused?

Copy link
Member Author

Choose a reason for hiding this comment

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

Unused

@@ -0,0 +1,162 @@
# Changelog

## Unreleased
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't be part of the historical file

Makefile Outdated

.PHONY: CHANGELOG.md
CHANGELOG.md: changelog/unreleased/*.md changelog/HISTORICAL.md
cat changelog/HISTORICAL.md >> CHANGELOG.md
Copy link
Member

Choose a reason for hiding this comment

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

This sounds brutal. A Makefile target that always unconditionally appends to a file ?
I see that file is created by the unreleased/*.md target, but it isn't at all intutitive.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've updated it so it hopefully makes more sense :)

@lunny
Copy link
Member

lunny commented Mar 17, 2017

ChangeLog codes maybe should be in modules/changelog so that we can add a feature to gitea as generate a changelog. Then when we eat dogfood, we could use it and no need write twice.

@bkcsoft
Copy link
Member Author

bkcsoft commented Mar 19, 2017

@lunny I thought go run didn't like modules. But now that I think about it, it makes a lot of sense to make it a package 😄

@bkcsoft
Copy link
Member Author

bkcsoft commented Mar 19, 2017

@lunny Maybe even it's own repo?

@lunny
Copy link
Member

lunny commented Mar 20, 2017

@bkcsoft I just give an advice to reuse the functions. But I cannot give you some ideas about how to do that.

@bkcsoft
Copy link
Member Author

bkcsoft commented Mar 20, 2017

@tboerger I've updated according to your request :)

@bkcsoft
Copy link
Member Author

bkcsoft commented Mar 24, 2017

@lunny @tboerger I made it into it's own repo. You can find it here: https://gitlab.com/bkc/changelogger

@lunny
Copy link
Member

lunny commented Mar 25, 2017

@bkcsoft great!

@lunny
Copy link
Member

lunny commented Apr 7, 2017

build failed.

@lunny lunny modified the milestones: 1.x.x, 1.2.0 Apr 20, 2017
@bkcsoft
Copy link
Member Author

bkcsoft commented Jun 15, 2017

I'm closing this in favour of the actual package.

@bkcsoft bkcsoft closed this Jun 15, 2017
@bkcsoft bkcsoft deleted the bkcsoft/changelog-generator branch June 15, 2017 02:42
@lunny lunny removed this from the 1.x.x milestone Jun 15, 2017
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. pr/wip This PR is not ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Manage the changelog automatically
4 participants