Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

stash: feature workflow using branches uncertainty

Timm Meyer September 12, 2014

Hey,

we just started using jira/stash/bamboo for a small project. One thing we are not completely certain about is the feature workflow using branches.

For a new feature we do the following

  • create a feature issue
  • from jira, create a branch
  • in intellij idea, we checkout that branch as a new local branch
  • code the feature
  • commit the feature
  • push the current branch to origin

But, what happens now

  • do we merge locally to master and then push?
  • do we create a pull request and merge from there? do i then have to delete the feature branch locally too (sorry, new to git)? also, is there a way around the feature request since we are 2 developers inside that project only, and each works on his own subprojects
  • if that feature is merged (by a pull request, or manually?), is the state in JIRA automatically changed?

Is there somewhere some step by step explanation for how such workflows would usually work, or did i just not find that?

 

Best, Timm

2 answers

0 votes
ThiagoBomfim
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 14, 2014

Hi Timm,

This is a very good question and will help a lot of people.

There is no right and wrong workflow. You will need a mix of them all. Answering your question: yes, Atlassian wrote a very good guide on the workflows where you will be able to understand them and mix it up.

You will probably be interested in the Feature Branch Workflow. You will see that it is a good practice to utilise Pull Requests as it will generate discussion between people involved in the code review prior to the merge. As written on Merging a Pull Request, while creating a PR using Stash UI you are able to check Delete branch if you no longer need that branch in the repo. Stash will do that automatically for you once the Pull Request is merged.

Another advantage of using Pull Requests as part of your workflow, is that you can include Checks for merging Pull Requests. Stash will control those case scenarios. You could also install add-ons like the Stash Auto Unapprove plugin to return its status to unapproved in case someone push changes between the time it had been approved and the merge.

The choice for merging locally and pushing will obviously work, but it won't get all your developers involved and will bypass the features I just described - which add a lot of value to the code review and avoid merging "bad" code.

The state in JIRA is automatically changed when using Stash 3.2+ and JIRA 6.3.3+ together. This is described on our JIRA Integration document.

Let me know if that information helped you.

Best regards,
Thiago Bomfim
Atlassian Support - DevTools

0 votes
Balázs Szakmáry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 14, 2014

For the merge, these are the options:

  • create a pull request and merge it form the web interface
  • create a pull request and merge it by merging the branch in a git client (and pushing the merge)
  • do not create a pull request, just merge the branch in a git client (and push the merge)

In all cases above, it is up to you if you delete the feature branch afterwards, but you probably want to do that to keep the branch list manageable in the long run.

Not sure about the JIRA part, but I think it does change state automatically.

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events