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

New job starts running before I have a chance to configure the job

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • p4-plugin
    • None
    • Windows Server 2003

      I have an existing job (job1) which is configured to poll SCM every minute.
      Now I create a new job (job2) and I select "copy existing job" and I specify "copy from job1"
      As soon as I hit OK I get the job configuration page.
      Now I start making a few edits to the job configuration page and I notice Hudson just started a build for job2 but I never had a chance to save my edits.

          [JENKINS-5975] New job starts running before I have a chance to configure the job

          Rob Petti added a comment -

          This is probably more of a problem for core, since it involves polling behavior, but I'll change the behavior so it won't trigger a build if the job has never been run before.

          Rob Petti added a comment - This is probably more of a problem for core, since it involves polling behavior, but I'll change the behavior so it won't trigger a build if the job has never been run before.

          Code changed in hudson
          User: : rpetti
          Path:
          trunk/hudson/plugins/perforce/src/main/java/hudson/plugins/perforce/PerforceSCM.java
          http://jenkins-ci.org/commit/28813
          Log:
          [FIXED JENKINS-5975] polling will now not trigger builds for a job if it has never been run before

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : rpetti Path: trunk/hudson/plugins/perforce/src/main/java/hudson/plugins/perforce/PerforceSCM.java http://jenkins-ci.org/commit/28813 Log: [FIXED JENKINS-5975] polling will now not trigger builds for a job if it has never been run before

          torbent added a comment -

          Has this been released? I saw it happening yesterday with plugin version 1.0.28 ...

          torbent added a comment - Has this been released? I saw it happening yesterday with plugin version 1.0.28 ...

          Rob Petti added a comment -

          Yeah, I guess I just messed up or something. I'll take a look, though it seems like JENKINS-2494 should cover this.

          Rob Petti added a comment - Yeah, I guess I just messed up or something. I'll take a look, though it seems like JENKINS-2494 should cover this.

          Code changed in hudson
          User: : rpetti
          Path:
          trunk/hudson/plugins/perforce/src/main/java/hudson/plugins/perforce/PerforceSCM.java
          http://jenkins-ci.org/commit/30325
          Log:
          [FIXED JENKINS-5975] prevent builds from not being triggered by polling when the job has never been run before

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : rpetti Path: trunk/hudson/plugins/perforce/src/main/java/hudson/plugins/perforce/PerforceSCM.java http://jenkins-ci.org/commit/30325 Log: [FIXED JENKINS-5975] prevent builds from not being triggered by polling when the job has never been run before

          torbent added a comment -

          I totally agree that JENKINS-2494 covers this, and is a "better" (more general) solution. However, it appears that not much is happening on that, so I'll gladly take your fix

          torbent added a comment - I totally agree that JENKINS-2494 covers this, and is a "better" (more general) solution. However, it appears that not much is happening on that, so I'll gladly take your fix

          mdillon added a comment -

          Looking at the diffs, this appears to make it so that a manual run of the job is required before triggers will take effect. Is that true? If so, that doesn't seem like a real fix to me. We (Yahoo!) happen to have someone looking at JENKINS-2494 again this week; perhaps it would be best to just fix that bug and revert these changes.

          mdillon added a comment - Looking at the diffs, this appears to make it so that a manual run of the job is required before triggers will take effect. Is that true? If so, that doesn't seem like a real fix to me. We (Yahoo!) happen to have someone looking at JENKINS-2494 again this week; perhaps it would be best to just fix that bug and revert these changes.

          Rob Petti added a comment -

          Yes, that's exactly what it does (it even says that in the commit log). I'm limited to changing only the perforce plugin code, which can't get any information about whether or not the job has just been copied and not saved yet.

          Perforce requires that a workspace be created on a slave in order to run any perforce commands for polling, so a build must be run anyways if there isn't one. It used to run the job right away, but people with short polling intervals were running into issues when copying jobs, so this was the only way I could 'fix' it.

          I've reopened this bug, so we can revert the changes once you've fixed JENKINS-2494. Thanks!

          Rob Petti added a comment - Yes, that's exactly what it does (it even says that in the commit log). I'm limited to changing only the perforce plugin code, which can't get any information about whether or not the job has just been copied and not saved yet. Perforce requires that a workspace be created on a slave in order to run any perforce commands for polling, so a build must be run anyways if there isn't one. It used to run the job right away, but people with short polling intervals were running into issues when copying jobs, so this was the only way I could 'fix' it. I've reopened this bug, so we can revert the changes once you've fixed JENKINS-2494 . Thanks!

          Alan Harder added a comment -

          fix for JENKINS-2494 in for 1.361 so you can revert the perforce changes you mentioned pretty soon..

          Alan Harder added a comment - fix for JENKINS-2494 in for 1.361 so you can revert the perforce changes you mentioned pretty soon..

          Code changed in hudson
          User: : rpetti
          Path:
          trunk/hudson/plugins/perforce/src/main/java/hudson/plugins/perforce/PerforceSCM.java
          http://jenkins-ci.org/commit/32023
          Log:
          [FIXED JENKINS-5975] reverting 30325, since this is managed by hudson core now (since 1.361)

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : rpetti Path: trunk/hudson/plugins/perforce/src/main/java/hudson/plugins/perforce/PerforceSCM.java http://jenkins-ci.org/commit/32023 Log: [FIXED JENKINS-5975] reverting 30325, since this is managed by hudson core now (since 1.361)

            rpetti Rob Petti
            mchartier mchartier
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: