From discussion in https://jira.atlassian.com/browse/BSERV-5112
Jan Nylund:
I have a workflow that includes doing static analysis on the master, and differential static analysis on PR's, where the result of the analysis is automatically added into Bitbucket PR as code comments.
Typically developers create branches from within JIRA and start working on them. Each time they commit we build to ensure that tests are passing, etc. but at this stage no analysis is run. When the developer thinks code is ready to merge, he/she creates a PR and then need to manually trigger the feature plan branch to run again, so we can get differential analysis run and code comments into code review.
Using Bamboo 6.0.x this could work if I skipped the idea of building my branches before making a PR, but that is not something that we are currently ready to do.
Jan Nylund:
I got one branch where the last command does different things depending on:
- if branch == master run static analysis and store to server for historic followup
- if branch != master and PR exists run diff analysis and comment on code
- if branch != master and nor PR exist skip analysis
I've considered two plans, but that means that either:
- Plan A is a subset of plan B. (which is kinda useless, especially from a maintenance point of view), or:
- Plan B relies on artifacts from plan A (test-results, binaries, etc). Which can cause an synchronisation error if PR is created ruing build of plan A.
This ticket can be closed as the Bamboo feature "Create plan branch on PR creation" is essentially solving this. The variables are still missing but can stay in the other ticket.