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

Changeset should not be calculated in each run in the job when P4DISABLESYNC has been set in environment

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • p4-plugin
    • jenkins - 1.599 perforce plugin - 1.3.24

      when P4DISABLESYNC is set it to environment, sync is not happening but changeset taking the latest changes in the respective branch.
      I am using P4DISABLECHANGELOG and P4DISABLESYNC env variable, in a job, p4 is not syncing the actual code from depot, but taking latest CL which is not sycned to workspace from the below command.
      p4 changes -s submitted -m 1 ///...

      i believe, we should not take the latest changeset when we have P4DISABLESYNC variable set. or let me know how to solve this issue if you have any idea to resolve the same.

      can some one please take a look.

      PerforceSCM.java : line 1009
      //use the latest submitted change from workspace, or depot
      try {
      List<Integer> workspaceChanges = depot.getChanges().getChangeNumbers(p4WorkspacePath, 0, 1);
      if (workspaceChanges != null && !workspaceChanges.isEmpty())

      { newestChange = workspaceChanges.get(0); }

      else {
      List<Integer> depotChanges = depot.getChanges().getChangeNumbers("//...", 0, 1);
      if (depotChanges != null && !depotChanges.isEmpty())

      { newestChange = depotChanges.get(0); }

      }

          [JENKINS-35369] Changeset should not be calculated in each run in the job when P4DISABLESYNC has been set in environment

          kalai arasan created issue -
          kalai arasan made changes -
          Epic Link New: JENKINS-32387 [ 167497 ]
          kalai arasan made changes -
          Description Original: when P4DISABLESYNC is set it to environment, sync is not happening but changeset taking the latest changes in the respective branch.
          I am using P4DISABLECHANGELOG and P4DISABLESYNC env variable, in a job, p4 is not syncing the actual code from depot, but taking latest CL which is not sycned to workspace from the below command.
          p4 changes -s submitted -m 1 ///...

          i believe, we should not take the latest changeset when we have P4DISABLESYNC variable set. or let me know how to solve this issue if you have any idea to resolve the same.

          can some one please take a look.
          New: when P4DISABLESYNC is set it to environment, sync is not happening but changeset taking the latest changes in the respective branch.
          I am using P4DISABLECHANGELOG and P4DISABLESYNC env variable, in a job, p4 is not syncing the actual code from depot, but taking latest CL which is not sycned to workspace from the below command.
          p4 changes -s submitted -m 1 ///...

          i believe, we should not take the latest changeset when we have P4DISABLESYNC variable set. or let me know how to solve this issue if you have any idea to resolve the same.

          can some one please take a look.

          PerforceSCM.java : line 1009
              //use the latest submitted change from workspace, or depot
                              try {
                                  List<Integer> workspaceChanges = depot.getChanges().getChangeNumbers(p4WorkspacePath, 0, 1);
                                  if (workspaceChanges != null && !workspaceChanges.isEmpty()) {
                                      newestChange = workspaceChanges.get(0);
                                  } else {
                                      List<Integer> depotChanges = depot.getChanges().getChangeNumbers("//...", 0, 1);
                                      if (depotChanges != null && !depotChanges.isEmpty()) {
                                          newestChange = depotChanges.get(0);
                                      }
                                  }
          Rob Petti made changes -
          Assignee Original: Rob Petti [ rpetti ]
          Rob Petti made changes -
          Priority Original: Critical [ 2 ] New: Trivial [ 5 ]

          Rob Petti added a comment -

          This plugin is deprecated. Please use the official one from Perforce. On the other had, since you don't want changelogs or syncing, you should probably not use an SCM plugin to begin with.

          Rob Petti added a comment - This plugin is deprecated. Please use the official one from Perforce. On the other had, since you don't want changelogs or syncing, you should probably not use an SCM plugin to begin with.
          kalai arasan made changes -
          Priority Original: Trivial [ 5 ] New: Major [ 3 ]
          kalai arasan made changes -
          Assignee New: Rob Petti [ rpetti ]

          kalai arasan added a comment - - edited

          Thanks for your valuable suggestion. we are using p4 plugin now.
          is there any way to trigger a job without sync, even though job configuration has sync workspace in it?
          our requirement is that, we want to run the same job whether the sync has to be done or not decided by the environment variable.
          Also, p4 plugin should not take latest changeset when disable sync happens.
          Could you please let us know how to resolve this issue.

          PS: our issue in perforce plugin is, eventhough we use P4DISABLESYNC, it is taking latest changeset ( from p4 changes -s submitted -m 1 //<job_name>/... ) at the end which might not built .

          kalai arasan added a comment - - edited Thanks for your valuable suggestion. we are using p4 plugin now. is there any way to trigger a job without sync, even though job configuration has sync workspace in it? our requirement is that, we want to run the same job whether the sync has to be done or not decided by the environment variable. Also, p4 plugin should not take latest changeset when disable sync happens. Could you please let us know how to resolve this issue. PS: our issue in perforce plugin is, eventhough we use P4DISABLESYNC, it is taking latest changeset ( from p4 changes -s submitted -m 1 //<job_name>/... ) at the end which might not built .
          Rob Petti made changes -
          Assignee Original: Rob Petti [ rpetti ]

            Unassigned Unassigned
            kalaiarasan kalai arasan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: