vivaxy / vscode-conventional-commits

💬Conventional Commits for VSCode.
https://marketplace.visualstudio.com/items?itemName=vivaxy.vscode-conventional-commits
MIT License
322 stars 35 forks source link

[FEAT] Optional autoinsert of jira issue derived from branchname #186

Open sschneider-ihre-pvs opened 3 years ago

sschneider-ihre-pvs commented 3 years ago

Is your feature request related to a problem? Please describe

I always reference the jira issue like ABC-123 manually.

Describe the solution you'd like

It would be nice to have an option that would get the jira issue from the branchname that looks mostly like feature/ABC-123-long-description-of-issue

Describe alternatives you've considered

Maybe some kind of footer list like the scope list would work also so you can save a footer and insert it on every commit again.

yi-Xu-0100 commented 3 years ago

👋 Hi, @sschneider-ihre-pvs, Can you provide a sample repository or any docs about this specification? I am not familiar with the jira issue, so I need some advice about the matching mechanism. The regular matching specifications are better. 😁

sschneider-ihre-pvs commented 3 years ago

here you go :) https://bitbucket.org/snippets/atlassian/qedp7d

yi-Xu-0100 commented 3 years ago

@sschneider-ihre-pvs It should add ABC-123 into the footer as ref: #ABC-123 ? or ref: ABC-123 ?

sschneider-ihre-pvs commented 3 years ago

According to https://www.conventionalcommits.org/en/v1.0.0/#specification §8 both :)

sschneider-ihre-pvs commented 3 years ago

oh I mean both should be possible I would just add it in the footer and let the user decide

yi-Xu-0100 commented 3 years ago

@sschneider-ihre-pvs I mean that can the both be detected by the Jira? I do not use the Jira before. After I google it simply, I know that it is an "Issue & Project Tracking Software", but I can not make sure that they both can work well with it. 🧐

If they both can be detected by the Jira, I will add two configurations about it. The one is conventionalCommits.jira.appendFooter, and the other is conventionalCommits.jira.appendFooterFormat. 😊

vivaxy commented 3 years ago

Hi @sschneider-ihre-pvs, thank you for your suggestion.

I am not quite sure about what you are suggesting. Please supply any use case in detail to help us understand.

Here is some quick answers:

  1. If you'd like to insert a jira format footer manually which links to a jira issue, it is possible to do so right now. Please try add ref: #ABC-123 or ref: ABC-123 in the footer section. Actually you can right anything in the footer section.
  2. If you want a tool that automatically extract the issue id from the branch name, and append to the commit footer, is https://github.com/bk201-/jira-prepare-commit-msg helpful?
sschneider-ihre-pvs commented 3 years ago

I know that there are various ways to get the issue identifier out of the branchname. I was suggesting adding this as a feature to the extension.

fix(typescript): :bug: Disabled warnings for explicit any
\n
* Disabled warnings in eslinrc
* Fixed types in models
* Fixed typos
\n
JIRA #{{<jira-issue}}
or
JIRA: {{<jira-issue}}

so similar to breaking changes it would be nice to have something like this to have conventional commits for a group of ppl that work with jira.

@yi-Xu-0100 across the board, there are a lot of tools that can detect jira issues with plugins or extensions. For example, jenkins will add a link to the issue if it sees the jira issue key in a commit message.

yi-Xu-0100 commented 3 years ago

@sschneider-ihre-pvs I am confused about the example. 😅

So the JIRA #{{<jira-issue}} or JIRA: {{<jira-issue}} is right? Not ref #{{<jira-issue}} or ref: {{<jira-issue}} ?

sschneider-ihre-pvs commented 3 years ago

the prefix actually doesn't matter, I just picked JIRA to make it clearer and and all the {{}} should be replaced with the issue key.

kruzyk commented 3 years ago

Yep, automatic insertion to commit message a issue nr from branch would be perfect :)