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

Choosing branch name/location #36

Open
jamesgraham opened this issue Jun 9, 2018 · 7 comments
Open

Choosing branch name/location #36

jamesgraham opened this issue Jun 9, 2018 · 7 comments

Comments

@jamesgraham
Copy link

Great plugin!

It would be nice if we could choose to create the branch with:

  • a name based on the issue title e.g. ABC-123-slugged-issue-title
  • a location based on the issue type e.g. a story creates in feature/ABC-123 and bug in hotfix/ABC-123 to support gitflow
@osowskit
Copy link
Owner

👋 @jamesgraham thanks for your suggestions. I have been tracking this in #20 (comment) but don't have short-term plans on implementing support for this:

Adding an Admin page will add additional complexity for this plugin. While I agree this feature should be added, I cannot commit resources to implementing this and prefer keeping this as a light-weight reference implementation. Workarounds:

  • Copy the Create a branch URL, edit the URL to contain the desired branch name, execute it in another browser window
  • Write a Chrome extension to replace this via JS
  • Fork this repository and a) hard-code the prefix, b) implement this via front-end code, or c) implement this as an Admin setting

@kbakk
Copy link

kbakk commented Sep 11, 2019

@osowskit Could this be reopened? From my understanding, #20 supports <issue key>/<custom title set from UI>. This issue requests <location based on issue type>/<issue key>-<custom title set from UI>. We are also interested in this pattern.

@osowskit osowskit reopened this Sep 11, 2019
@osowskit
Copy link
Owner

This is a bit trickier to offer because 1) every jira uses different identifiers for issue type and the text value isn't passed to the app and 2) this branch pattern would not be easy to look up in jira.

Could you manually enter the issue type where it would be SENG-1234/bug/manually-entered-title?

@kbakk
Copy link

kbakk commented Sep 13, 2019

We would like the location to be type - e.g. feature/MD-1234-fantastic-feature. This is according to how git-flow avh works

Could a mapping be added in .github/jira-bot.yaml? Something like

branch_pattern: 1
map_issue:
  Bug: bugfix
  Task: feature
  Story: feature

@osowskit
Copy link
Owner

@kbakk that is an interesting idea. The main issue is that it isn't easy to get the issue type - say Bug.

If you could provide the issue type id rather than Bug, Task, and Story, I could likely build a mapping to support this. Do you know how to lookup that mapping for your instance? Every Jira will likely be different.

@kbakk
Copy link

kbakk commented Sep 18, 2019

Sorry for the late response.

In the API it's at https://<instance>.atlassian.net/rest/api/2/project/<project id>, and it can be found by looking at https://<instance>.atlassian.net/secure/admin/ViewIssueTypes.jspa then Edit - the ID will be in the URL.

ID->branch may not be as clear as with names, but for us this should work well.

@osowskit
Copy link
Owner

@kbakk I'm back to this now. This plugin was designed with minimal permissions so cannot access the JIRA API. It's event-driven and atlassian is passing data via URL params. In this case, they pass a tenant-specific integer, issuetype.id, representing the type rather than the name.

Would users want to create all branches off a single location (static for the project), flexibility per JIRA ticket (i.e. a ticket would represent a 1:1 mapping for fixing in dev or hotfix or main), or would a single JIRA ticket have multiple branches on different locations.

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

No branches or pull requests

3 participants