node.jsbitbucketjiraagilescrum

How to solve Jira ticket dependency problem


I am building backend using Node.js and I'm working in a team of multiple people using sprint board in Jira with Bitbucket. Sometime we have tasks which have some dependency between tasks.

For example we have Task 1, Task 2 and Task 3. Task 2 is a continuation of Task 1 and Task 3 is a continuation of Task 2. Once any task is done there is a delay for review and merge to master branch.

Task dependency

Please suggest best practices while assigning these task in Scrum methodology considering each task have a separate branch and pull request.

What we follow is we take Task 1 branch from master, once Task 1 is done we raise PR for Task 1. Then we take branch for Task 2 from Task 1 and once done raise the PR to Task 1 itself. And do the same thing with Task 3. But this has a problem that we have to merge branch for Task 3 first then Task 2 and then Task 1.

Branch flow: Branch dependency

Merge flow: Task merge flow

If this technique is fine then is there any method in bitbucket to restrict merging pull request of Task 1 until pull request of Task 2 is merged. Same with Task 3 and Task 2.


Solution

  • The ideal workflow would be waiting for the Task 1 branch to be merged, and then starting working on Task 2, which will have a branch created from the master branch as well.

    I believe, since you do not want to wait for the Task 1 code review to be completed, you want to start working on Task 2. In that case, creating the Task 2 branch from Task 1 is a good practice, but you should not merge the Task 2 branch over the Task 1 branch, because, when you merge the Task 2 branch to the Task 1 branch, the Task 1 branch will start containing the code for both Task 1 and Task2; although Task 1 and Task 2 are dependent, their code should be in separate branches.

    So, I follow the following process;

    1. Create the Task 1 branch from the master branch
    2. When the Task 1 coding is completed, create the PR from the Task 1 branch to the master branch
    3. Create the Task 2 branch from the Task 1 branch
    4. When the Task 2 coding is completed, wait for the Task 1 PR to be merged.

    When the Task 1 PR is merged;

    1. Rebase/merge the Task 2 branch from the master branch
    2. Create the PR from the Task 2 branch to the master branch

    You can also follow this path for Task 3 and other upcoming dependent tasks.