Hi wbrode -I agree. I've been trying to get my head around the basic scenario's and the edge cases to those.
I'll discuss with the developers and get back to you.
My notes for me and devs.
Options:
- Pin at good build label? - A possible option but paramaterized builds or code in jenkinsfile could be used to implement this if really needed (not multibranch).
- Pin at current head? - Valid for the time the review is created updated and committed (pre-commit). Cannot see a negative.
- Pin at review CL? - What if the code has moved on and the review is then updated. Need to sync to the later code.
- Pin at head when review created/updated/comitted? - Would allow for delayed builds but why is this better than current head?
Reproduction steps for sync at review CL
(1) Create a multibranch job with a known Swarm project with branches defined that contain a Jenkinsfile as the branch sources.
(2) Create a review.
(3) Use 'Scan Multibranch Pipeline Now' to build review.
(4) Submit 5 seperate changelists to move the changelist counter on.
(5) Update the review with a new version of the file:
p4 unshelve -s REVIEWNUMBER
echo test >> FileInReview
p4 shelve FileInReview
Use the text #review-REVIEWNUMBER in the shelve description text.
(6) Use 'Scan Multibranch Pipeline Now' to build review.
(7) The review will sync to the REVIEWNUMBER. For example my review number was '2138' but my head changelist was 2224 for this branch (and whole server).
P4 Task: syncing files at change: 2138
... p4 sync /var/lib/jenkins/workspace/SwarmMultiBranch_2138-ABD46HS2B5QL7YUAEOKK7ZF263___ -p4 sync /var/lib/jenkins/workspace/SwarmMultiBranch_2138-ABD46HS2B5QL7YUAEOKK7ZF263QXSASZ4PXEGIEWBMTBRK3QG5AQ/...@2138
/var/lib/jenkins/workspace/SwarmMultiBranch_2138-ABD46HS2B5QL7YUAEOKK7ZF263QXSASZ4PXEGIEWBMTBRK3QG5AQ/...@2138 - file(s) up-to-date.
duration: (3ms)
P4 Task: unshelve review: 2138
... p4 unshelve -f -s2138 -cdefault +
Hi wbrode - Thanks for highlighting this.
I can see that we will need to cater for delayed builds so we probably want the review to build at HEAD when review was generated/updated/committed. I'll do some testing here and get back to you.
Karl