Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-17304

When using label to sync, list of changes is incorrect

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • p4-plugin
    • None
    • Jenkins ver. 1.480.3
      Perforce Plugin 1.3.20

      I've setup a job to sync to a label. When someone tags the label, then a new build happens. The Changes section in Jenkins is reporting changes that are not a part of the label though.

      This is from job console log:

      Started by an SCM change
      [EnvInject] - Loading node environment variables.
      Building remotely on eng203 in workspace /acc1/jenkins/workspace/apps-release-from-label
      Using remote perforce client: jenkins-apps-release--1298717673
      [apps-release-from-label] $ /usr/local/bin/p4 workspace -o jenkins-apps-release--1298717673
      Saving modified client jenkins-apps-release--1298717673
      [apps-release-from-label] $ /usr/local/bin/p4 -s client -i
      Last build changeset: 90881
      [apps-release-from-label] $ /usr/local/bin/p4 -s changes -s submitted -m 1 //jenkins-apps-release--1298717673/...@release-13.2-eagleeye
      [apps-release-from-label] $ /usr/local/bin/p4 -s changes -s submitted //jenkins-apps-release--1298717673/...@90882,@91151
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 91151
      [apps-release-from-label] $ /usr/local/bin/p4 -G where //...
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 91146
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 91131
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 91130
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 91119
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 91118
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 91114
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 91112
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 91111
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 91106
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 91104
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 91100
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 91097
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 91078
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 91077
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 91076
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 91074
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 91072
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 91071
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 91070
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 91069
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 91067
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 91065
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 91063
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 91062
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 91061
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 90979
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 90975
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 90973
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 90957
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 90952
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 90951
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 90950
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 90948
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 90946
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 90941
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 90935
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 90933
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 90932
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 90930
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 90927
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 90905
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 90902
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 90890
      [apps-release-from-label] $ /usr/local/bin/p4 describe -s 90882
      [apps-release-from-label] $ /usr/local/bin/p4 -s users XXX
      [apps-release-from-label] $ /usr/local/bin/p4 user -o XXX
      .
      .
      .
      [apps-release-from-label] $ /usr/local/bin/p4 -s users YYY
      [apps-release-from-label] $ /usr/local/bin/p4 user -o YYY
      Sync'ing workspace to label release-13.2-eagleeye.
      [apps-release-from-label] $ /usr/local/bin/p4 -s sync //jenkins-apps-release--1298717673/...@release-13.2-eagleeye
      Sync complete, took 2159 ms
      

      Here is my output from command-line:

      agus:util swolk$ p4 changes -m10 //depot/...@release-13.2-eagleeye
      Change 91151 on 2013/03/20 by XXX '<OPS-1163>Change the facebook d'
      Change 90881 on 2013/03/18 by XXX '<GT-9362> make RateLimit serial'
      Change 90879 on 2013/03/18 by XXX '<CB-9118> <CB-9130> fix rate li'
      Change 90727 on 2013/03/15 by XXX 'INT-591, EagleEye release UI dr'
      Change 90719 on 2013/03/15 by XXX 'CB-9113, Twitter DCI - Tweet su'
      Change 90717 on 2013/03/15 by XXX 'CB-8340, Random sort and Time s'
      Change 90713 on 2013/03/15 by XXX 'CB-9106, CB 2.0 | DCI | Timelin'
      Change 90706 on 2013/03/14 by XXX '<CB-8683> 1. fix test case '
      Change 90703 on 2013/03/14 by XXX '<CB-8683> 1. fix: early checkin'
      Change 90691 on 2013/03/14 by XXX '[maven-release-plugin] prepare '
      

          [JENKINS-17304] When using label to sync, list of changes is incorrect

          Rob Petti added a comment -

          This is unfortunately a known limitation of the perforce plugin. Change logs are only accurate between changelist numbers or complete/automatic labels. This is due to the perforce's ability to sync different parts of the workspace to different changeset numbers without providing a local way of keeping track of what file revisions are synced. There are methods to get around this limitation, but they are computationally expensive for the server to process, and in some cases not even possible.

          Rob Petti added a comment - This is unfortunately a known limitation of the perforce plugin. Change logs are only accurate between changelist numbers or complete/automatic labels. This is due to the perforce's ability to sync different parts of the workspace to different changeset numbers without providing a local way of keeping track of what file revisions are synced. There are methods to get around this limitation, but they are computationally expensive for the server to process, and in some cases not even possible.

          swolk added a comment -

          Hi Rob, this wouldn't be too bad except that when you have incremental builds enabled, this leads to building modules that have changes outside of the label. If a label is involved can't we just compare with the last changelist and instead of including all changes between last build changelist and latest changelist, include only the changes in the label? p4 changes -m25 //depot/...@release-13.10-krypto will give you just the changes for the label. If the diff is too many changes, ie. new label, just be safe build all modules

          swolk added a comment - Hi Rob, this wouldn't be too bad except that when you have incremental builds enabled, this leads to building modules that have changes outside of the label. If a label is involved can't we just compare with the last changelist and instead of including all changes between last build changelist and latest changelist, include only the changes in the label? p4 changes -m25 //depot/...@release-13.10-krypto will give you just the changes for the label. If the diff is too many changes, ie. new label, just be safe build all modules

          Rob Petti added a comment -

          I've thought of that, but it will still not be very accurate.

          You need to compare the changes in one label to the changes of the label that was used in the previous build. This, as far as I know, cannot be done in perforce. Even if it could, it would require that the labels be unique and immutable (so that you can guarantee that the previous build's label actually represents the last build) A common use-case is to use a single label that updates continuously, which the build runs off of.

          The only way I can see of doing this is to record the entire state of the synced client on disk somewhere, and compare that to what is on the label being built. This is non-trivial to do, and is a real performance killer.

          Rob Petti added a comment - I've thought of that, but it will still not be very accurate. You need to compare the changes in one label to the changes of the label that was used in the previous build. This, as far as I know, cannot be done in perforce. Even if it could, it would require that the labels be unique and immutable (so that you can guarantee that the previous build's label actually represents the last build) A common use-case is to use a single label that updates continuously, which the build runs off of. The only way I can see of doing this is to record the entire state of the synced client on disk somewhere, and compare that to what is on the label being built. This is non-trivial to do, and is a real performance killer.

            Unassigned Unassigned
            swolk swolk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: