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

Support for multiple JIRA issue per commit #52

Open
VTrngNghia opened this issue Dec 7, 2021 · 9 comments
Open

Support for multiple JIRA issue per commit #52

VTrngNghia opened this issue Dec 7, 2021 · 9 comments
Labels
invalid This doesn't seem right question Further information is requested

Comments

@VTrngNghia
Copy link

Regex currently only allows 1 JIRA issue per commit. Sometimes one commit may affect multiple issues.
Even though it's recommended to keep commits atomic, commits with multiple issues should still available as an option, maybe with a strong warning.

@juliuscc
Copy link
Collaborator

Hi! How would you expect the behaviour of the tool to work? Should the user be able to input multiple JIRA tickets in one commit? How would you want the commit to look like?

@Saeger
Copy link

Saeger commented Feb 18, 2022

Hi @VTrngNghia ,

In Jira for example, I understand that you could relate such tickets with multiple ones internally. But in the end, when opening a PR and commit, you will do so towards a single ticket. Maybe you could use such Jira feature instead?

@Saeger Saeger added invalid This doesn't seem right question Further information is requested labels Mar 1, 2022
@VTrngNghia
Copy link
Author

It's possible, even if not very common, that a single code change could simultaneously fix 2 separate issues/bugs. In such case a message in the form of "fix: JIRA-123 JIRA-456 Fix these bugs..." could be helpful

@juliuscc
Copy link
Collaborator

juliuscc commented Apr 21, 2022

I am curious how often that happens. If it happens in 10% of the commits it makes sense to build in, but if it only happens in 0.1% of the commits it might make sense to not support it. And in that case, write a manual message.

Every feature is a tradeoff both in terms of maintenance and in terms of adding additional steps to the users. This step could be enabled with config so that it doesn't bother most users. But I wonder if it's very useful to ever have it.

If you would need the feature once a month, and the rest of the time the feature adds a more complex UX, I don't think it should be used.

Do you often have commits that solve multiple tickets?

@mateodelnorte
Copy link

This should absolutely be allowed. You can even see it in the visual example for a competing plugin: https://github.com/commitizen/cz-jira-smart-commit/blob/master/other/screenshot.png

@juliuscc
Copy link
Collaborator

Would it be enough to remove the validation regex in the prompt "Enter JIRA issue"? And you could write whatever you want there. Or are you envisioning another type of logic?

@VTrngNghia
Copy link
Author

VTrngNghia commented Apr 25, 2022

For simplicity, you could keep the current validation logic for Warning only, instead of Blocking invalid issues.
For now, there's the workaround of typing the other JIRA issues at the start of 'comment' section instead of 'jira issue' section. Although that wouldn't work with plugins such as @mateodelnorte 's

@juliuscc
Copy link
Collaborator

I am not sure if I fully understand but I interpret your suggestion like this:

  • If an issue is "incorrectly formatted" we shouldn't block anymore.
  • If an issue is "incorrectly formatted" we should write out a warning message.

I don't think that should be the default behaviour. The blocking behaviour is a feature and I think the plugin would be worse without the blocking behaviour. If we don't block and the user puts in something that's incorrect, then they have no way of correcting it. They would have to abort the commit and try it again. The warning doesn't help much in that case.

To me, it makes more sense to add an option that disables the formatting check so that users like you can write whatever issues you want. What are your thoughts about that?

@KnifeFed
Copy link

Would you be against adding support for entering multiple issues in the prompt separated by a space? Something like
/^[A-Z]{1,10}\-\d+( [A-Z]{1,10}\-\d+)*$/i.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants