-
Improvement
-
Resolution: Unresolved
-
Major
-
p4-plugin 1.11.0
When builds are triggered from Swarm using the 'review/build' URL you can provide a pass and fail URL to update the Swarm test status icon on job SUCCESS or FAIL.
These are then stored under the 'Branches' tab (doesnt matter if you use Brancgh source Swarm/Helix Branches or Streams).
If you use Helix Swarm as the branch source in Jenkins you get the reviews appearing under a 'Reviews' tab when the pipeline is scanned:
but you dont get the test status pased back to Swarm.
It would be great if either there was a new endpoint so reviews could be triggered from Swarm and the jobs be placed under a review tab, or that test status is updated in Swarm at the end of a Helix Swarm job.
Since we already have the p4Approve step (which could also be used to up-vote from the CI user), a simple p4ReviewState step along the same lines would allow this to be part of the pipeline script in both Multibranch Pipeline and normal Pipeline jobs.
It'd be nicer if this was automatically propagated back to a review at the end of a Multibranch Pipeline run from the Helix Swarm branch source triggered by a review (triggered once that is implemented, or multibranch scan), but it seems p4ReviewState is still useful for the remaining cases where the plugin doesn't know it's a review, but the Pipeline script writer does.
I see that the existing Build Review Action support passes URLs to post on success and failure. I can't see an obvious API method for adding to the testDetails and setting the testStatus of a Review, but I assume that is possible because Build Review Action flow provides such a URL. Hopefully that doesn't depend on embedding some secret token in that URL.
Edit: Ah, dagnabbit. There is a secret token:
Short of significant refactoring, I guess the best bet is either allowing an authenticated Swarm user to not require the secret token, or to have the relevant secret token (or full update URL) put into the scm object that the Helix Swarm branch source provides to the Multibranch Pipeline job, and could be consumed by a p4AddTestState step.