-
Notifications
You must be signed in to change notification settings - Fork 238
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: add Jira integration #52
Conversation
@tsuyoshiwada Can you please take a look at this PR? |
Pull Request Test Coverage Report for Build 635345958
💛 - Coveralls |
Thank you for contributing!! I haven't used Jira so much, So I don't understand the use case well 😢 |
@tsuyoshiwada I think Jira integration is a standalone module. If a user doesn't use it, it doesn't affect existing functionality at all. |
2d417ae
to
53af2de
Compare
@tsuyoshiwada I have spent time updating tests, now all checks have passed. I also updated REAME.md, which will help you understand this feature. The logic is actually simple, if a Jira story can be matched from a commit header, then it auto fetches Jira data and store in Can you please take a look. I really hope this PR get merged. |
This would be really nice! |
@evanchaoli can you rebase this please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@evanchaoli Thank you for the contribution! We at @GoodwayGroup use Jira as our central tracking tool for our teams. This integration would fit in nicely with our SDLC. I left some feedback on the PR.
Can you please rebase from master
? We have updated urfave/cli
to v2
and this will require a minor change in your PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for sticking with this PR @evanchaoli
I think there is a good feature being added here. I do have some further change requests after pulling locally and testing it out.
Building locally and running a standard command to generate the changelog for the git-chglog
repo I am seeing the following error and trace. This is on mac osx 10.14 with go 1.15.
dsmith ~/github/forks/tmp/git-chglog (git::jira):
$ make build
go build -o git-chglog ./cmd/git-chglog
go: downloading github.com/andygrunwald/go-jira v1.13.0
go: downloading github.com/fatih/structs v1.0.0
go: downloading github.com/trivago/tgo v1.0.1
go: downloading github.com/dgrijalva/jwt-go v3.2.0+incompatible
go: downloading github.com/pkg/errors v0.8.0
go: downloading github.com/google/go-querystring v0.0.0-20170111101155-53e6ce116135
dsmith ~/github/forks/tmp/git-chglog (git::jira):
$ ./git-chglog
panic: runtime error: index out of range [2] with length 2
goroutine 1 [running]:
github.com/git-chglog/git-chglog.assignDynamicValues(0x1413540, 0xc0001fe380, 0xc0001fa570, 0x3, 0x3, 0xc0001fbbd0, 0x2, 0x2)
/Users/dsmith/github/forks/tmp/git-chglog/utils.go:45 +0x2fb
github.com/git-chglog/git-chglog.(*commitParser).processHeader(0xc000218a80, 0xc0001fe380, 0xc000232215, 0x1b)
/Users/dsmith/github/forks/tmp/git-chglog/commit_parser.go:194 +0x114
github.com/git-chglog/git-chglog.(*commitParser).parseCommit(0xc000218a80, 0xc000232139, 0x115, 0xc0001fe2a0)
/Users/dsmith/github/forks/tmp/git-chglog/commit_parser.go:138 +0x389
github.com/git-chglog/git-chglog.(*commitParser).Parse(0xc000218a80, 0xc0002124a0, 0xb, 0x14bb7a7, 0x6, 0xc0002124a0, 0xb, 0xc0000d0fc0)
/Users/dsmith/github/forks/tmp/git-chglog/commit_parser.go:106 +0x267
github.com/git-chglog/git-chglog.(*Generator).readUnreleased(0xc0000d1340, 0xc00019a800, 0xe, 0x10, 0xe, 0x10, 0x0)
/Users/dsmith/github/forks/tmp/git-chglog/chglog.go:228 +0x7e
github.com/git-chglog/git-chglog.(*Generator).Generate(0xc0000d1340, 0x1548ee0, 0xc0000ae008, 0x0, 0x0, 0x0, 0x0)
/Users/dsmith/github/forks/tmp/git-chglog/chglog.go:147 +0x11a
main.(*generatorImpl).Generate(0x17e98c8, 0xc0001fa120, 0x1548ee0, 0xc0000ae008, 0x0, 0x0, 0xc0000d0f40, 0xcc0000000149d580, 0xc0001c1c48)
/Users/dsmith/github/forks/tmp/git-chglog/cmd/git-chglog/generator.go:23 +0x6f
main.(*CLI).Run(0xc0000c2690, 0x1550b00)
/Users/dsmith/github/forks/tmp/git-chglog/cmd/git-chglog/cli.go:72 +0x15b
main.AppAction(0xc0000d0d00, 0xc0000a8e00, 0x10)
/Users/dsmith/github/forks/tmp/git-chglog/cmd/git-chglog/main.go:225 +0x65c
github.com/urfave/cli/v2.(*App).RunContext(0xc00009f6c0, 0x1550740, 0xc0000b2008, 0xc0000981b0, 0x1, 0x1, 0x0, 0x0)
/Users/dsmith/.gvm/pkgsets/go1.15/global/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:322 +0x70d
github.com/urfave/cli/v2.(*App).Run(...)
/Users/dsmith/.gvm/pkgsets/go1.15/global/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:224
main.main()
/Users/dsmith/github/forks/tmp/git-chglog/cmd/git-chglog/main.go:232 +0x77
It appears that this error stems from when you have JiraIssueId
within the pattern_maps
block, but there are no Jira supported patterns found. I created #110 to provide a follow up on this for the project to provide examples of different configs that demonstrate the features that are supported by the tool.
I think that a good path forward is rolling back the changes made to the .git-chglog/config.yml
in this PR and following up on #110 with an example of how you are using the Jira integration.
Further testing is showing that there is some other issue with how the config is generated when using the Expected:
When running the same command on the same repo with the compiled version from this branch, this is what I am seeing:
|
I believe the error is a regression that is caused by #108 because change to With my fix:
|
The panic was caused by the bad pattern. Actually I fixed the bad pattern in our real configure file but forgot to update the commit. After fixed the pattern, it compatible with comments that is with or without a Jira story ID.
|
This is on me. My initial testing did not produce this, but we did get a report from another user #111 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@evanchaoli Thank you for following up on the feedback and to pointing out (and fixing) the bug that is on master
. Very much appreciated.
The primary reason for the change request is for the modifications to the projects .chglog/config.yml
.
This feature is close and I really appreciate the work you are putting in! 💯
This flag specifies a regular expression and only matched tags will be included in change log. Closes git-chglog#43
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥳 @evanchaoli thank you for listening to the feedback and following up with the changes. Nice work! 🥳
@clok As you have approved, are you going to merge this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'll overrule the legacy check and merge :)
What does this do / why do we need it?
Jira is a popular project management system which can be used for tracking feature request and bug fix. Usually Jira has been filled with plenty of information which can be used to generate change log. To avoid effort of copy-paste things from Jira to git commit log, Jira integration should be very helpful.
How this PR fixes the problem?
This PR adds Jira integration. With including an Jira story id in git commit message, it can automatically fetch story type, summary and description from Jira, and user may include those info in change log.
What should your reviewer look out for in this PR?
Check lists
Additional Comments (if any)
{Please write here}
Which issue(s) does this PR fix?