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

First poll does not run on copied jobs which aren't yet saved or applied

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • core
    • None

      When i creat a new job by copying another job, the first poll does not run.
      Even when i click "poll now" the poll does not seem to run.
      If i open the configuration of the new job and save, the polling starts to work.

      Any ideas what the problem is? I am happy to provide logs but i am unsure which loggers to use?

      This is causing major problems for us because we have automated job creation to copy a template job. At the moment all these jobs need to be manually re-saved in order to run which is causing much delay.

          [JENKINS-30745] First poll does not run on copied jobs which aren't yet saved or applied

          yakobe please add this comments to JENKINS-30802 because i fully agree that this is bad and unexpected behaviour.

          Kanstantsin Shautsou added a comment - yakobe please add this comments to JENKINS-30802 because i fully agree that this is bad and unexpected behaviour.

          jake bishop added a comment - - edited

          What about the cases i mention?

          After the job has run [manually] the polling still does not work

          and

          if you restart jenkins. All those previously 'unbuildable' jobs suddenly become magically buildable and start running

          and also the fact that it used to work but now it does not

          jake bishop added a comment - - edited What about the cases i mention? After the job has run [manually] the polling still does not work and if you restart jenkins. All those previously 'unbuildable' jobs suddenly become magically buildable and start running and also the fact that it used to work but now it does not

          jake bishop added a comment -

          integer do you know of a way to force a copied job to be buildable over the api? Otherwise you cannot copy a job with the api anymore (you have to go in and save it manually). I really need to find a work-around for our issue

          jake bishop added a comment - integer do you know of a way to force a copied job to be buildable over the api? Otherwise you cannot copy a job with the api anymore (you have to go in and save it manually). I really need to find a work-around for our issue

          Mark Waite added a comment -

          Can't you use the jenkins-cli.jar copy-job command to perform the copy? Alternately, if you need to do it through some other programming language, you could read the source code of the jenkins-cli.jar copy-job command to see what additional steps it takes compared to the calls you're making with the API you are using.

          Mark Waite added a comment - Can't you use the jenkins-cli.jar copy-job command to perform the copy? Alternately, if you need to do it through some other programming language, you could read the source code of the jenkins-cli.jar copy-job command to see what additional steps it takes compared to the calls you're making with the API you are using.

          jake bishop added a comment -

          We are using a 3rd party script to control our jobs. This line is where the job is cloned: https://github.com/entagen/jenkins-build-per-branch/blob/master/src/main/groovy/com/entagen/jenkins/JenkinsApi.groovy#L54. The problem is that the new changes mean that new jobs cannot be created over the api anymore (unless there is some way to say they are buildable).

          jake bishop added a comment - We are using a 3rd party script to control our jobs. This line is where the job is cloned: https://github.com/entagen/jenkins-build-per-branch/blob/master/src/main/groovy/com/entagen/jenkins/JenkinsApi.groovy#L54 . The problem is that the new changes mean that new jobs cannot be created over the api anymore (unless there is some way to say they are buildable).

          Kanstantsin Shautsou added a comment - - edited

          Guys, that's all dirty hack and pure jenkins API/code place. Solution should be provided/resolved through JENKINS-30802

          Kanstantsin Shautsou added a comment - - edited Guys, that's all dirty hack and pure jenkins API/code place. Solution should be provided/resolved through JENKINS-30802

          jake bishop added a comment -

          integer I'm a bit confused again by what you mean. Are you saying that copying a job with the API is a hack? Or are you saying that JENKINS-30802 will provide a solution to allow jobs to be copied over the API? From my view it should be possible to copy jobs using the API...

          jake bishop added a comment - integer I'm a bit confused again by what you mean. Are you saying that copying a job with the API is a hack? Or are you saying that JENKINS-30802 will provide a solution to allow jobs to be copied over the API? From my view it should be possible to copy jobs using the API...

          jake bishop added a comment -

          integer I see you updated your message but it is still not clear what you mean. Even if i use the standard rest API (not the scripts from entagen) i am not able to copy a job and get it to a state where polling works (due to the changes with this activation stuff). It really feals like a bug

          jake bishop added a comment - integer I see you updated your message but it is still not clear what you mean. Even if i use the standard rest API (not the scripts from entagen) i am not able to copy a job and get it to a state where polling works (due to the changes with this activation stuff). It really feals like a bug

          Daniel Beck added a comment -

          yakobe IIRC newly copied jobs should have no "Build Now" link in the sidepanel until you save the config form. Are you saying that's not the case?

          Daniel Beck added a comment - yakobe IIRC newly copied jobs should have no "Build Now" link in the sidepanel until you save the config form. Are you saying that's not the case?

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          changelog.html
          http://jenkins-ci.org/commit/jenkins/f53b529fa0f7abb3e936b3c19214ee20116b811c
          Log:
          Noting the revert of https://github.com/jenkinsci/jenkins/pull/1617 in #1870 (JENKINS-30745)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: changelog.html http://jenkins-ci.org/commit/jenkins/f53b529fa0f7abb3e936b3c19214ee20116b811c Log: Noting the revert of https://github.com/jenkinsci/jenkins/pull/1617 in #1870 ( JENKINS-30745 )

            Unassigned Unassigned
            yakobe jake bishop
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: