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 other Tracking Systems #23

Open
stevesparks opened this issue Sep 10, 2020 · 5 comments
Open

Support for other Tracking Systems #23

stevesparks opened this issue Sep 10, 2020 · 5 comments

Comments

@stevesparks
Copy link

stevesparks commented Sep 10, 2020

I am on a project that uses JIRA today. Their story format is XYZ-123, where XYZ is a project prefix and 123 is the story number. In my work, I would create branch sparks/xyz-123 and make all the commits prefixed thus:

[XYZ-123] Add sweet feature

I think the change that would work best would be to allow the user to specify the regex in init, eg.:

git tracker init '[A-Z]{2,5}-[0-9]{1,5}'
or if they're project specific...
git tracker init 'XYZ-[0-9]{1,5}'

@stevenharman
Copy link
Owner

stevenharman commented Sep 10, 2020

I wonder if allowing arbitrary patterns is a great idea from a UX perspective? I can image even things like folks shell expansion and escaping causing all kinds of confusion. I wonder if #7 was onto something with wanting "templates" or "modes" for various tools. If we went that route, I could image something like

git tracker init --template=tracker # this is also the default option if no `--template` is specified
git tracker init --template=jira

We could then also list possible templates as part of git --help.

I think once we've gone the route of having swappable "templates" - which I think only really impacts the Branch::story_number functionality we've got the nut cracked. Then adding new templates shouldn't (🤞) be too hard. And maybe even provides a seam to add something like --pattern='XYZ-[0-9]{1,5}' for "custom" patterns.

Thoughts? 🤔

@stevesparks
Copy link
Author

I had almost made that exact suggestion, but opted for the regex that was ultimately more flexible, even at the risk of having incompatibilities introduced. So, templates gets a 👍👍 from me.

@axelson
Copy link

axelson commented Oct 7, 2020

I would like to be able to support asana as well (although you have to use your own asana github workflow). The main issue with that is that there is not a simple issue number, instead you get a link like https://app.asana.com/0/039346075456211/119714138891232/f which doesn't fit well in the branch name. Would it be possible to use the git branch description instead of the branch name?

Edit: I have a version of that now working here: axelson@437e0b4

Edit 2: Creating the branch with the description can be facilitated with a git alias:

git config --global alias.newbr "!f() { if [ \"\$#\" -eq 2 ]; then git checkout -b \"\$1\"; git config \"branch.\$1.description\" \"\$2\"; fi; }; f"

And then use it when creating a new branch:

git newbr fix-bug-in-foobar https://app.asana.com/0/039346075456211/119714138891232/f

@stevenharman
Copy link
Owner

@axelson I've not used Asana, but it sure is surprising they don't give a shorter, human-friendly, identifier that could be used. 😖

I'm not opposed to adding something like this. Given your request, and the original question about adding JIRA support, and past requests for other systems, I think from a design perspective it might be best to build this in a way that each "other system," including Tracker, are implemented as a strategy. That is, if using the Tracker strategy, it would look up the "story number" based on branch name. The JIRA strategy would also use the branch name, but match on a different pattern. The Asana strategy would look up the info (a URL) via the description, as you've suggested.

@axelson
Copy link

axelson commented Oct 9, 2020

I think that approach makes sense 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants