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

Custom name for branch created in chatops mode #127

Closed
mmokeev opened this issue Apr 5, 2020 · 7 comments
Closed

Custom name for branch created in chatops mode #127

mmokeev opened this issue Apr 5, 2020 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@mmokeev
Copy link

mmokeev commented Apr 5, 2020

Hello! Is it possible to set my own branch name for each problem? As far as I know, now when you call the /cib command, a branch is created with the name in the format specified in the branchName property. But, I did not find how to configure the creation of the branch in such a way that the command like "/cib anotner-branch-name" creates a branch with t name "issue-15-another-branch-name". Is this feature missing or is it I inattentively read the documentation? :)

@robvanderleek
Copy link
Owner

robvanderleek commented Apr 5, 2020

Hi @mmokeev 😄

By default, the branch name is based on the title of your issue. So if your issue has the title "Add input validation for zipcode field", when you call /cib a branch will be created that is named something like: issue-123-Add_input_validation_for_zipcode_field.

Do you have a use-case where you want the name of the branch to be very different from the issue title?

There is no option for the /cib command that let's you change the branch name, so you read the documentation correctly 😉 The main purpose of this app is to quickly create branches for issues with a consistent naming convention. Do let me know about your specific use-case though.

@mmokeev
Copy link
Author

mmokeev commented Apr 5, 2020

Yes :)
The most important example is that the language in the title is not English. This is the main reason why I even asked such a question.
Next, the title does not always reflect a brief essence or short enough for the capacious name of the branch. I would like to be able to automatically substitute the prefix with the problem number, and set the rest of the name by myself (something like this was done in jira)
I think command like /cib simple-npe-fix that creates the branch named issue-123-simple-npe-fix would be quickly enough.
I would be very grateful for such an opportunity (unfortunately, my knowledge in javascript is not enough for pull request with this feature...)

@robvanderleek
Copy link
Owner

It's not too difficult to take the text that follows /cib and use that as the title part of the branch name.
I'm not sure about the exact syntax and if this feature should be on by default or enabled with a flag.
In principle this can work:

/cib Simple NPE fix

The branch name would then be something like this: issue-123-Simple_NPE_fix
Your example would also still work, this command:

/cib simple-npe-fix

would create a branch titled issue-123-simple-npe-fix
But having the functionality on by default may surprise users, so I'm considering to put this behind a configuration parameter. Alternatively the syntax of the command could be more explicit, such as:

/cib title: Simple NPE fix

What do you think?

@mmokeev
Copy link
Author

mmokeev commented Apr 7, 2020

Thank you for attention :)
It seems to me that the option of explicitly indicating the "title" option will be redundant, especially if this option is enabled by the flag. I think if commands "/cib Simple NPE fix" and "/cib simple-npe-fix" will work - it will be very cool!

@robvanderleek robvanderleek added the enhancement New feature or request label Apr 13, 2020
@robvanderleek robvanderleek self-assigned this Apr 21, 2020
@create-issue-branch
Copy link

@robvanderleek
Copy link
Owner

Hi @mmokeev

Hope you are well.

It took me some time, had to refactor the code quite a bit, but I have an implementation ready in the staging environment.
I think you can test it using the issues in this repo: https://github.com/robvanderleek/create-issue-branch-staging
But you can also install the staging version of the app on your own repos: https://github.com/apps/create-issue-branch-staging

The current implementation doesn't require a configuration flag to be enabled. By default everything that follows /cib (or /create-issue-branch) is taken as the issue title.

Let me know how this work out for you.

@robvanderleek
Copy link
Owner

Hey @mmokeev

Gentle reminder, let me know when you have some time to look at this feature.
Closing this issue for now, just ping me when you can do a review 😄

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

No branches or pull requests

2 participants