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

Includes an auto_branch_prefix property #2

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jessie-freenow
Copy link

Identifies the ticket type to create branches with prefixes like feature, bugfix, or refactor
Fixes #1

stdout=subprocess.PIPE)
process.communicate()
else:
print("No menu entry selected. Exiting.")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! :)

@@ -12,6 +12,13 @@

MAX_RESULT = 5

# Mapping of ticket types to branch prefixes
TICKET_TYPE_TO_PREFIX = {
Copy link
Collaborator

@neugartf neugartf Feb 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd honestly move this to an environment variable, so everyone can define the mapping themselves (more extendable).
JIRA_TYPE_MAPPING="Story=feature,Task=feature"
https://github.com/sloria/environs can read these maps.

def main(prefix: Annotated[str, typer.Option(help="Prefix that is being used for the new branch.")] = "feature",
no_prefix: Annotated[bool, typer.Option("--no-prefix", help="Will not use a prefix")] = False):
no_prefix: Annotated[bool, typer.Option("--no-prefix", help="Will not use a prefix")] = False,
auto_branch_prefix: Annotated[bool, typer.Option("--auto-branch-prefix", help="Automatically determine branch prefix based on ticket type")] = False):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you do https://github.com/freenowtech/git-jira/pull/2/files#r1477907772, I think you can drop this (=> only map if the variable is defined).

@neugartf
Copy link
Collaborator

neugartf commented Feb 5, 2024

Oh, also README.md update 🙇.

@neugartf
Copy link
Collaborator

Push

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

Successfully merging this pull request may close these issues.

Introduce Config Variable to Dynamically Name Branches Based on Jira Ticket Type
2 participants