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

Fallback Prefix? #49

Closed
Mike-E-angelo opened this issue Nov 20, 2019 · 6 comments
Closed

Fallback Prefix? #49

Mike-E-angelo opened this issue Nov 20, 2019 · 6 comments
Assignees

Comments

@Mike-E-angelo
Copy link

Mike-E-angelo commented Nov 20, 2019

Hey there... cool looking app. :) I was wondering if there is a way to set a default/fallback prefix for values configured.

Essentially, if there isn't a label that matches, I would like to create a branch that looks like issues/i<id> where <id> is the issue number.

Something like:

branches:
  - label: enhancement
    prefix: feature/
  - label: bug
    prefix: bugfix/
  - label: *
    prefix: issues/

Thank you for any assistance/consideration. 👍

@robvanderleek
Copy link
Owner

robvanderleek commented Nov 24, 2019

Hi @Mike-EEE

Thanks for your feedback.

Not too hard to implement, have your example config working, but I'm not sure about the exact syntax.
Asterisk has a special meaning in YAML, so the config needs to look like:

branches:
  ...
  - label: bug
    prefix: bugfix/
  - label: '*'
    prefix: issues/

Maybe it's best to quote all string values in the YAML examples anyway:

branches:
  ...
  - label: 'bug'
    prefix: 'bugfix/'
  - label: '*'
    prefix: 'issues/'

Another option is to have defaultPrefix as a separate field, but then I think there needs to be a field for defaultName as well:

branches:
  ...
  - label: bug
    prefix: bugfix/
  defaultPrefix: issues/
  defaultName: dev

This might be a bit confusing as GitHub has the notion of a "default branch" which is the fallback when the defaultName branch does not exist.

What do you think?

@robvanderleek robvanderleek self-assigned this Nov 24, 2019
@Mike-E-angelo
Copy link
Author

Woohoo! Excellent, @robvanderleek thank you for looking into this.

I am OK with using quotes around that asterisk. In fact, why not allow both asterisk and defaultPrefix? 😁

This might be a bit confusing as GitHub has the notion of a "default branch" which is the fallback when the defaultName branch does not exist.

This might be easy to solve if the field is named defaultLabel instead, as that is really what it is describing, correct?

@robvanderleek
Copy link
Owner

Hi @Mike-EEE

OK, let's go with a quoted asterisk then 😄 I'll keep defaultPrefix and defaultLabel/defaultName on the whiteboard for now.

Your requested behaviour should work, just add a - label: '*' entry to the YAML.

Let me know here how it works for you, closing this issue for now.

@Mike-E-angelo
Copy link
Author

Awesome! Thank you, @robvanderleek!

@Mike-E-angelo
Copy link
Author

Just a quick word here that this worked like a champ!

https://github.com/ExtendedXmlSerializer/home/blob/f9d1e2313821b3d89b1e726f1baad3fcd374a0d8/.github/issue-branch.yml

I just tried this on ExtendedXmlSerializer/home#276 and it created a issues/other/i276 branch after re-assigning the issue to me.

Thanks again. 👍

@robvanderleek
Copy link
Owner

Hey @Mike-EEE 😄

Thanks a lot for the nice feedback!
And thanks also for coining this feature in the first place.
Do not hesitate to create a new issue if you think this app can be further improved.

Rob

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

2 participants