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

Wrong changelist number used in ant builder property

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: perforce-plugin
    • Labels:
      None
    • Environment:
      Platform: All, OS: All
    • Similar Issues:

      Description

      I'm trying to simplify moving some projects over from cruisecontrol. We've been
      using the Cruisecontrol P4ChangeListLabelIncrementer to define the 'label' build
      property to be the latest change, and we then use this in branding our jars,
      etc. with a version number.

      I observed a strange behaviour. The Hudson Perforce plugin seems to be using
      the wrong changelist number. Has anyone else observed it?

       <snipped from the hudson job console log>
      Changing P4 Client View to: //depot/sw/project/main/...
      //kelvin-dev2:hudson:main-nightly/...
      [workspace] $ p4 -s client -i
      Last sync'd change: 5953
      [workspace] $ p4 changes -m 25 //depot/sw/project/main/...
      [workspace] $ p4 describe -s 5955
      [workspace] $ p4 describe -s 5954
      Sync'ing workspace to depot.
      [workspace] $ p4 sync //depot/sw/project/main/...#head
      Sync complete, took 275 MS
      [workspace] $
      /localstorage/kedmison/hudson_home/jobs/main-incr/workspace/java/util/apache-ant/bin/ant
      -Dlabel=$P4_CHANGELIST clean fullbuild doc analyze
      Buildfile: build.xml

      And later on in the log file is evidence that label was defined as 5953 (the
      state of the workspace prior to syncing) rather than 5955 (the state of the
      workspace after syncing).

        Attachments

          Activity

          Hide
          kedmison kedmison added a comment -

          Perforce plugin version: 1.0.12
          Hudson version: 1.262

          Show
          kedmison kedmison added a comment - Perforce plugin version: 1.0.12 Hudson version: 1.262
          Hide
          kohsuke Kohsuke Kawaguchi added a comment -

          Un-assigning this from digerata per request by him.

          Show
          kohsuke Kohsuke Kawaguchi added a comment - Un-assigning this from digerata per request by him.
          Hide
          stimms stimms added a comment -

          I believe this is fixed now in the code in svn. P4_CHANGE use to reflect the
          changelist which was last built it now represents the change which is synced in
          this build. I can't imagine this will break anything for anybody but let me
          know if it does.

          Show
          stimms stimms added a comment - I believe this is fixed now in the code in svn. P4_CHANGE use to reflect the changelist which was last built it now represents the change which is synced in this build. I can't imagine this will break anything for anybody but let me know if it does.
          Hide
          yamo yamo added a comment -

          I am still seeing P4_CHANGELIST appear as the last synced changelist.

          Also, I selected use view mask but only selected "use mask when syncing".

          So I wanted the polling to poll the whole workspace to trigger a build but then I basically don't want the workspace sync-ed because I want the script to do the sync since it wants to capture the result of the sync for parsing and trigger specific actions based on what gets synced.

          However it appears that both polling and syncing are using the view mask.

          Maybe I am misunderstanding/abusing the use, but basically I hope I can have it "my way".

          It would be nice if perhaps there was an explicit "P4_LAST_CHANGELIST" and a "P4_THIS_CHANGELIST" to make things clearer?

          Show
          yamo yamo added a comment - I am still seeing P4_CHANGELIST appear as the last synced changelist. Also, I selected use view mask but only selected "use mask when syncing". So I wanted the polling to poll the whole workspace to trigger a build but then I basically don't want the workspace sync-ed because I want the script to do the sync since it wants to capture the result of the sync for parsing and trigger specific actions based on what gets synced. However it appears that both polling and syncing are using the view mask. Maybe I am misunderstanding/abusing the use, but basically I hope I can have it "my way". It would be nice if perhaps there was an explicit "P4_LAST_CHANGELIST" and a "P4_THIS_CHANGELIST" to make things clearer?
          Hide
          rpetti Rob Petti added a comment -

          Yes, I believe you are misunderstanding how the view mask option works. If you don't sync anything, it won't be able to update the changeset.

          I am not changing the functionality of P4_CHANGELIST, since this will break builds for pretty much everyone using the plugin. I will, however, consider adding a P4_LAST_CHANGELIST variable.

          Show
          rpetti Rob Petti added a comment - Yes, I believe you are misunderstanding how the view mask option works. If you don't sync anything, it won't be able to update the changeset. I am not changing the functionality of P4_CHANGELIST, since this will break builds for pretty much everyone using the plugin. I will, however, consider adding a P4_LAST_CHANGELIST variable.

            People

            • Assignee:
              Unassigned
              Reporter:
              kedmison kedmison
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: