Skip to content

[AXON-257] Added {{{username}}} keyword for Jira's custom branch template #315

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

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

Conversation

marcomura
Copy link
Contributor

What Is This Change?

Addresses #250 .

This change adds the {{{username}}} keyword for building the Jira's custom branch template.
E.g.: {{{username}}}/{{{prefix}}}}{{{issuekey}}}-{{{{summary}}}}

The username is retrieved from the 'username' part of the git's user.email configuration.

This change also fixes the {{{prefix}}} not working correctly.

How Has This Been Tested?

Basic checks:

  • npm run lint
  • npm run test

Advanced checks:

  • If Atlassian employee & Bitbucket changes: did you test with DC in mind? See Instructions

Recommendations:

  • Update the CHANGELOG if making a user facing change

@@ -38,13 +42,24 @@ export const StartWorkSettings: React.FunctionComponent<StartWorkSettings> = ({
}, [changes, controller]);

const getTemplatePreview = useCallback(() => {
const usernameBase = 'trevinavery';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@TrevinAvery double checking if you are ok with this :)

Choose a reason for hiding this comment

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

Sure. I don't mind the credit. Haha.

E.g. <code>{'{{{username}}}/{{{prefix}}}{{{issueKey}}}-{{{summary}}}'}</code> will generate
something of the format:{' '}
<code>
{'trevinavery/feature/VSCODE-1005-allow-users-to-configure-the-way-branch-name-is-co'}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@TrevinAvery double checking if you are ok with this :)

Choose a reason for hiding this comment

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

Also fine

@jeremyfiel
Copy link

The username is retrieved from the 'username' part of the git's user.email configuration.

is this the same as the bitbucket username? I don't think it is, and I think it would be better to retrieve the username assigned in the BB instance.

I know my own BB username is different than my email address.

email: jeremy.fiel@company.com
user: fieljere

Copy link
Collaborator

@bwieger-atlassian-com bwieger-atlassian-com left a comment

Choose a reason for hiding this comment

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

LGTM

@jeremyfiel
Copy link

@marcomura can you clarify my concern with the git user info rather than calling the users api for jira or bb?

@marcomura
Copy link
Contributor Author

hi @jeremyfiel,
I have paused this change after your comment, as you made a great point.

I believe that this change should be changed as following:

  • if the current repo is a BB repo, then take the BB username
  • otherwise, take the username from the configured git email

Unfortunately, I didn't have time to apply the required changes yet.

FYI: @TrevinAvery

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

Successfully merging this pull request may close these issues.

5 participants