Add generate from issues argument #44

Merged
jolheiser merged 9 commits from jaqra/changelog:generate_from_issues into master 2020-08-04 13:30:22 +00:00
Member

In small projects we push direct to branch (does not send pr), we should create changelog from closed issues

In small projects we push direct to branch (does not send pr), we should create changelog from closed issues
jaqra added 1 commit 2020-07-29 21:02:55 +00:00
Add generate from issues argument
Some checks failed
continuous-integration/drone/pr Build is failing
3db2d400ff
jaqra added 1 commit 2020-07-29 21:19:24 +00:00
Fix lint error
Some checks failed
continuous-integration/drone/pr Build is failing
1e13513ec2
jaqra added 2 commits 2020-07-29 22:13:12 +00:00
Split function & fix lint
All checks were successful
continuous-integration/drone/pr Build is passing
9db8c10ff9
zeripath approved these changes 2020-07-30 13:44:46 +00:00
Dismissed
zeripath left a comment
Owner

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 perhaps
next time we should move to an Options based approach.

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 perhaps next time we should move to an Options based approach.
jolheiser requested changes 2020-07-30 13:49:48 +00:00
Dismissed
service/gitea.go Outdated
@ -69,2 +66,2 @@
prs = append(prs, p)
for _, issue := range issues {
if issue != nil {
Owner

This needs to take into account that, if it's a PR, it needs to be merged rather than simply closed.

This needs to take into account that, if it's a PR, it needs to be merged rather than simply closed.
service/gitea.go Outdated
@ -80,0 +80,4 @@
return tagURL, entries, nil
}
func convertToEntiry(issue gitea.Issue) Entry {
Owner

typo
convertToEntry

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)
Owner

I think you will need to refactor this query since is:merged may not return issues.

I think you will need to refactor this query since `is:merged` may not return issues.
jaqra reviewed 2020-07-30 13:58:22 +00:00
Dismissed
@ -46,3 +49,2 @@
for _, pr := range result.Issues {
if pr.IsPullRequest() {
p := PullRequest{
if pr.IsPullRequest() == isPull {
Author
Member
gh.Issues isPull pr.IsPullRequest() Take
true false false 👍
true false true 👎
false true false 👎
false true true 👍
| gh.Issues | isPull | pr.IsPullRequest() | Take | | --------- | ------- | ------------------ | ---- | | `true` | `false` | `false` | :+1: | | `true` | `false` | `true` | :-1: | | `false` | `true` | `false` | :-1: | | `false` | `true` | `true` | :+1: |
Owner

pr.IsPullRequest() != gh.Issues

`pr.IsPullRequest() != gh.Issues`
Author
Member

I thought that will confuse in future. Do i should change?

I thought that will confuse in future. Do i should change?
Owner

I personally prefer mine only because then I don't need to work out multiple negations in my head while I read the code.

I personally prefer mine only because then I don't need to work out multiple negations in my head while I read the code.
jaqra added 4 commits 2020-07-30 17:02:18 +00:00
jaqra requested review from jolheiser 2020-07-30 17:03:52 +00:00
jolheiser requested changes 2020-07-30 18:33:00 +00:00
Dismissed
jolheiser left a comment
Owner

One more nit, then I think it LGTM

One more nit, then I think it LGTM
service/gitea.go Outdated
@ -69,2 +66,2 @@
prs = append(prs, p)
for _, issue := range issues {
if options.Type == gitea.IssueTypePull && issue.PullRequest != nil && !(issue.PullRequest.HasMerged) {
Owner

Now you are checking for issue.pullRequest before asserting that issue isn't nil (side-note, I don't know if nil issues are still a problem or not)

Now you are checking for `issue.pullRequest` before asserting that `issue` isn't `nil` (side-note, I don't know if nil issues are still a problem or not)
Author
Member

Sorry. I am not familar to golang. I have started to learn. Done

Sorry. I am not familar to golang. I have started to learn. Done
jaqra added 1 commit 2020-07-30 19:31:26 +00:00
Fix posible nil problem
All checks were successful
continuous-integration/drone/pr Build is passing
c68fed0d8f
jolheiser approved these changes 2020-08-04 13:29:54 +00:00
Dismissed
jolheiser merged commit e532c4d5cd into master 2020-08-04 13:30:22 +00:00
6543 added this to the v0.2.0 milestone 2020-08-07 11:38:53 +00:00
6543 added the
feature
label 2020-08-07 11:39:04 +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#44
No description provided.