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

Don't hold off building until saved for jobs copied from CLI

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • cli, core
    • None

      By default, Jenkins does not allow building jobs that have just been copied until they are re-saved. This is to prevent accidentally scheduled builds before the user is able to customize a newly cloned job (JENKINS-2494).

      Jobs copied from the CLI don't need the same protection after copying. In fact, as there is no simple way to save a job without changing anything about its configuration using the CLI, it needs to behave differently.

          [JENKINS-20744] Don't hold off building until saved for jobs copied from CLI

          Daniel Beck added a comment -

          Daniel Beck added a comment - https://github.com/jenkinsci/jenkins/pull/1034

          Code changed in jenkins
          User: Daniel Beck
          Path:
          core/src/main/java/hudson/cli/CopyJobCommand.java
          test/src/test/java/hudson/cli/CopyJobCommandTest.java
          http://jenkins-ci.org/commit/jenkins/19a2246fe67d938b7f4574dce9180b1d37bd3201
          Log:
          [FIXED JENKINS-20744] Don't hold off building jobs copied from CLI

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: core/src/main/java/hudson/cli/CopyJobCommand.java test/src/test/java/hudson/cli/CopyJobCommandTest.java http://jenkins-ci.org/commit/jenkins/19a2246fe67d938b7f4574dce9180b1d37bd3201 Log: [FIXED JENKINS-20744] Don't hold off building jobs copied from CLI

          Code changed in jenkins
          User: Oliver Gondža
          Path:
          core/src/main/java/hudson/cli/CopyJobCommand.java
          test/src/test/java/hudson/cli/CopyJobCommandTest.java
          http://jenkins-ci.org/commit/jenkins/67f2fe64098f0ff683d2242d48a272a1bfbb3488
          Log:
          Merge pull request #1034 from daniel-beck/fix-copy-job-command

          [FIXED JENKINS-20744] Don't hold off building jobs copied from CLI

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: core/src/main/java/hudson/cli/CopyJobCommand.java test/src/test/java/hudson/cli/CopyJobCommandTest.java http://jenkins-ci.org/commit/jenkins/67f2fe64098f0ff683d2242d48a272a1bfbb3488 Log: Merge pull request #1034 from daniel-beck/fix-copy-job-command [FIXED JENKINS-20744] Don't hold off building jobs copied from CLI

          dogfood added a comment -

          Integrated in jenkins_main_trunk #3076
          [FIXED JENKINS-20744] Don't hold off building jobs copied from CLI (Revision 19a2246fe67d938b7f4574dce9180b1d37bd3201)

          Result = UNSTABLE
          daniel-beck : 19a2246fe67d938b7f4574dce9180b1d37bd3201
          Files :

          • test/src/test/java/hudson/cli/CopyJobCommandTest.java
          • core/src/main/java/hudson/cli/CopyJobCommand.java

          dogfood added a comment - Integrated in jenkins_main_trunk #3076 [FIXED JENKINS-20744] Don't hold off building jobs copied from CLI (Revision 19a2246fe67d938b7f4574dce9180b1d37bd3201) Result = UNSTABLE daniel-beck : 19a2246fe67d938b7f4574dce9180b1d37bd3201 Files : test/src/test/java/hudson/cli/CopyJobCommandTest.java core/src/main/java/hudson/cli/CopyJobCommand.java

          This still seems to be a problem. I use the python jenkinsapi to copy a job and then get it's config, modify it and update it.

          After that, the job is not buildable. If I disable it and reenable it, it's buildable again.

          Magnus Jacobsson added a comment - This still seems to be a problem. I use the python jenkinsapi to copy a job and then get it's config, modify it and update it. After that, the job is not buildable. If I disable it and reenable it, it's buildable again.

          Daniel Beck added a comment -

          The third party 'JenkinsAPI' for Python uses the Jenkins XML API, which is outside the scope of this issue. This is just about the Jenkins CLI (using jenkins-cli.jar).

          AFAICT JenkinsAPI even uses the same HTTP request as users on the UI would to copy jobs, which means at least the copy alone would be infeasible to change without breaking the 'hold off build' feature in web browsers.

          Daniel Beck added a comment - The third party 'JenkinsAPI' for Python uses the Jenkins XML API, which is outside the scope of this issue. This is just about the Jenkins CLI (using jenkins-cli.jar ). AFAICT JenkinsAPI even uses the same HTTP request as users on the UI would to copy jobs, which means at least the copy alone would be infeasible to change without breaking the 'hold off build' feature in web browsers.

          OK, thanks. I filed JENKINS-21087 to deal with the REST API.

          Magnus Jacobsson added a comment - OK, thanks. I filed JENKINS-21087 to deal with the REST API.

            danielbeck Daniel Beck
            danielbeck Daniel Beck
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: