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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Fixed
    • cli, core
    • None

    Description

      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.

      Attachments

        Issue Links

          Activity

            danielbeck 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_issue_link 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_issue_link 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 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 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.

            magjac 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.
            danielbeck 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.

            danielbeck 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.

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

            People

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

              Dates

                Created:
                Updated:
                Resolved: