1
votes

I am part of a development team that uses git and Azure DevOps to manage our work.

Our work items in Azure DevOps show updates by way of added links well beyond the point we have merged the related code into our release branch. I don't know if we have a problem with our work item or transition configuration or with our development processes or, perhaps, both.

Symptoms:

  1. When we merge code from our working development branch to the release branch (both long-lived git branches managed with policies), we see dozens or hundreds of past work items going back for months, and long since completed, associated with the merge PR. Maybe this is related to this issue?
  2. On most closed work items, we see continual updates in the form of added links for different types of seemingly unrelated activity or activity on one of the long-lived branches.

The net result are zombie work items that clutter the merges between long-lived branches.

What we would like to achieve is a merge into our release branch with a PR that has only the work items related to the new code in that release. And once a piece of work is deployed, the related work items are no longer updated.

Our code process looks like this:

  • Developers work in local branches and submit PRs to commit their work into our shared development branch.
  • The PR is squash-committed into the shared development branch after code review and approval.
  • At code freeze, we merge the shared development branch into the release branch, using the Merge (no fast-forward) strategy.
  • The QA team certifies the release candidate. Bugs are fixed and merged directly into the release branch with squash commits.
  • After the deployment, changes to the release branch are merged back down to shared development with the Merge (no fast-forward) strategy.

Are there any changes we can make to clean up our work item management?

Update:

We associate work items to pull requests (enforced by branch policies), never explicitly to branches. When a PR is approved, the work item is associated to both a commit and a PR: enter image description here

To restate the issue, unless we manually intervene in some way, Azure Devops now creates a new commit link and PR link every time we merge code between long-lived branches.

In the example below, showing commit links (PR links also look like this), a user story was approved and committed to the development branch on July 9 and the merge to release was done later that day. Ideally, that would be the last link, but instead we see a link created for every subsequent merge between the two long-lived branches.

enter image description here

If you focus just on the July 16 merge from release back to development, this is why I suspect that the way diffs are determined is at fault. This work item is already in development, so the only way the two branches are different would be if you looked at the history. Which, if I understand correctly, is the way Azure Devops works, but which is also a source of pain for many organizations.

1
Hi @Stuart. You can refer to my answer and check if it has the same problem as you. Feel free to let me know if it could give you some help. If no, please point out my error in my test process. - Kevin Lu-MSFT
I have created a feature request here: developercommunity.visualstudio.com/idea/1288282/… - Stuart
Hi @Stuart. Awesome! I will vote on it. If the answer could give you some help, you may consider accepting it. Thanks. - Kevin Lu-MSFT
@Stuart we are stuck at the very same problem - which lead me to this question. Sadly no answer at the moment, but opening a new pull request is getting slower and slower due to the page blocks for rendering 200+ items - noobed
@noobed, it's not ideal, but we are manually managing work items when merging across long-lived branches. - Stuart

1 Answers

2
votes

I think there is no problem with your Pull Request process.

Update:

According to your description, I do further test and got the same result as you.

enter image description here

When the workitem is connected to the pull request, it will connect to the PR and PR related commits after completion.

In this case, when you create a new pull request (PR -> commits contains the previous merged PR commit), it will automatically connect all related work items (regardless of the status of the work item). This could be the default way of working

enter image description here

As you said, this is caused by the difference between branches. But even more because even if the work item status is closed, it can still be connected and updated.

I am afraid that the work item cannot be closed completely at present. It only supports making a few fields read-only by using rules(like Title, assign to).

You could add your request for this feature on our UserVoice site, which is our main forum for product suggestions.