VSTS builds includes all previous commits as associated changes

南笙酒味 提交于 2020-05-29 07:53:14

问题


I have an issue that makes all my previous commits show as associated changes in each new build. I believe the issue is related to the automatic triggering of the build definition using a wildcard branch pattern. I trigger our release builds on any commits on a branch name with the pattern 'release/*'. Each production release of our software starts with a new release branch with the following naming convention 'release/1', 'release/2', etc. where the number matches our released software version.

The problem is that when the 'release/2' build gets ran, the associated changes show all commits that lead up to 'release/2' including the commits that led up to 'release/1'. This continues with every new release.

I thought the way that it was supposed to work, was to only show the changes that occurred between the current build and the previous successful build.

Any insight into this issue would be appreciated.

Steps to reproduce this issue:

  1. In VSTS create a git repo w/ add readme
  2. Create new build definition (empty), set 'Get Sources' step to the repo you just created and the branch to master
    • go to options and set 'Automatically link new work in this build' to enabled
    • go to 'Triggers' > Continuous Integration > Trigger Status > Enabled > Branch Filters > set Branch specification to 'release/*' (excluding single quotes)
  3. Clone new repo to your computer
  4. Create a file that will be used to make modifications in the repo, add and commit the file. For example I will use ver.txt
  5. Push updated master branch to server (git push origin)
  6. Perform the first build by just queing it up through the VSTS build area of the project
  7. Create first release branch

    • git checkout -b release/1
    • make modifications to ver.txt (I just increment the value)
    • git commit -am "Updated to version 1"
    • git push origin release/1
    • build should be triggered once this branch is pushed to the server
    • Once build is finished, view build Summary > Associated changes, notice that all commits for this new repo are listed
    • Merge release branch back into master
      • git checkout master
      • git merge release/1
      • git branch -d release/1
      • git push origin -d release/1
  8. Create second release branch

    • git checkout -b release/2
    • make modifications to ver.txt (I just increment the value)
    • git commit -am "Updated to version 2"
    • git push origin release/2
    • build should be triggered once this branch is pushed to the server
  9. At this point when looking at the latest builds' Associated changes you will see that it continues to cumulate the entire history of the repository as opposed to just the commits between the current build and the last successful build despite the fact that it is the same build definition being ran


回答1:


It is also based on the source, not just build, so regarding release/2, it compares current build with last successful build of the release/2 branch source, so it includes the commit in release/1.

I recommend that you can merge changes through Pull Request with a successful build, and check the changes in this build. (Branch policy)



来源:https://stackoverflow.com/questions/46368770/vsts-builds-includes-all-previous-commits-as-associated-changes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!