Add generate from issues argument #44
No reviewers
Labels
No Label
breaking
bug
build
duplicate
enhancement
feature
help wanted
invalid
lgtm
done
lgtm
need 1
question
skip-changelog
wontfix
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: gitea/changelog#44
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "jaqra/changelog:generate_from_issues"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In small projects we push direct to branch (does not send pr), we should create changelog from closed issues
This looks fine to me - I would say that the number of arguments to:
service/service.go:15:func New(...)
is getting a little unwieldy and perhapsnext time we should move to an Options based approach.
@ -69,2 +66,2 @@
prs = append(prs, p)
for _, issue := range issues {
if issue != nil {
This needs to take into account that, if it's a PR, it needs to be merged rather than simply closed.
@ -80,0 +80,4 @@
return tagURL, entries, nil
}
func convertToEntiry(issue gitea.Issue) Entry {
typo
convertToEntry
@ -29,3 +30,3 @@
prs := make([]PullRequest, 0)
prs := make([]Entry, 0)
query := fmt.Sprintf(`repo:%s is:merged milestone:"%s"`, gh.Repo, gh.Milestone)
I think you will need to refactor this query since
is:merged
may not return issues.@ -46,3 +49,2 @@
for _, pr := range result.Issues {
if pr.IsPullRequest() {
p := PullRequest{
if pr.IsPullRequest() == isPull {
true
false
false
true
false
true
false
true
false
false
true
true
pr.IsPullRequest() != gh.Issues
I thought that will confuse in future. Do i should change?
I personally prefer mine only because then I don't need to work out multiple negations in my head while I read the code.
One more nit, then I think it LGTM
@ -69,2 +66,2 @@
prs = append(prs, p)
for _, issue := range issues {
if options.Type == gitea.IssueTypePull && issue.PullRequest != nil && !(issue.PullRequest.HasMerged) {
Now you are checking for
issue.pullRequest
before asserting thatissue
isn'tnil
(side-note, I don't know if nil issues are still a problem or not)Sorry. I am not familar to golang. I have started to learn. Done