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

Create New item copied from github org branch job should not be allowed

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • branch-api-plugin, (1)
      core
    • Jenkins v2.0
      GitHub Organization Folder Plugin v1.3
      GitHub Branch Source Plugin v1.6
      Pipeline: Multibranch v2.3
      Pipeline: Job v2.1

      Actions taken:
      When creating a new item, if one creates that job as a copy of an existing branch, the resulting job is not editable or deletable. There is no way that I can see to edit or delete the newly created job.

      Use Case:
      The reason one might want to do this is to turn a given branch build into a recurring task. What I thought was the obvious solution was to create a new item coped from the existing one, with the intention of adding in a schedule trigger.

      Expectation:
      Ideally, this would just work, but as a stop-gap it should probably have been prevented from happening in the first place by filtering out such immutable/generated jobs as copy-from candidates.

          [JENKINS-34691] Create New item copied from github org branch job should not be allowed

          Jesse Glick added a comment -

          remove the Branch property

          Not enough. You need to switch the definition from SCMBinder tp CpsScmFlowDefinition.

          Jesse Glick added a comment - remove the Branch property Not enough. You need to switch the definition from SCMBinder tp CpsScmFlowDefinition .

          jglick I decided we cannot even do that, as there is no guarantee that the branch job type is even supported outside of a multibranch... So I am now just vetoing completely with https://github.com/jenkinsci/branch-api-plugin/pull/95

          Stephen Connolly added a comment - jglick I decided we cannot even do that, as there is no guarantee that the branch job type is even supported outside of a multibranch... So I am now just vetoing completely with  https://github.com/jenkinsci/branch-api-plugin/pull/95

          Jesse Glick added a comment -

          Well in the primary case, of workflow-multibranch, it is.

          Jesse Glick added a comment - Well in the primary case, of workflow-multibranch , it is.

          Code changed in jenkins
          User: Stephen Connolly
          Path:
          core/src/main/java/hudson/model/ItemGroupMixIn.java
          core/src/main/java/hudson/model/listeners/ItemListener.java
          test/src/test/java/hudson/jobs/CreateItemTest.java
          http://jenkins-ci.org/commit/jenkins/258a42c7f22178a80a4a21f028843e7c47ea9df3
          Log:
          [FIXED JENKINS-34691] Add the ability for ItemListeners to veto copy operations

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: core/src/main/java/hudson/model/ItemGroupMixIn.java core/src/main/java/hudson/model/listeners/ItemListener.java test/src/test/java/hudson/jobs/CreateItemTest.java http://jenkins-ci.org/commit/jenkins/258a42c7f22178a80a4a21f028843e7c47ea9df3 Log: [FIXED JENKINS-34691] Add the ability for ItemListeners to veto copy operations

          Code changed in jenkins
          User: Stephen Connolly
          Path:
          src/main/java/jenkins/branch/MultiBranchProject.java
          src/main/resources/jenkins/branch/Messages.properties
          http://jenkins-ci.org/commit/branch-api-plugin/15a447f4a90a85c13771fac1e3f9bd92efcb72f6
          Log:
          JENKINS-34691 Adopt proposed veto mechanism

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: src/main/java/jenkins/branch/MultiBranchProject.java src/main/resources/jenkins/branch/Messages.properties http://jenkins-ci.org/commit/branch-api-plugin/15a447f4a90a85c13771fac1e3f9bd92efcb72f6 Log: JENKINS-34691 Adopt proposed veto mechanism

          Code changed in jenkins
          User: Stephen Connolly
          Path:
          src/main/java/jenkins/branch/MultiBranchProject.java
          http://jenkins-ci.org/commit/branch-api-plugin/7b2dafd1dcaa556fc6db14a7c23244df4dcbbbf1
          Log:
          JENKINS-34691 Noting core version

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: src/main/java/jenkins/branch/MultiBranchProject.java http://jenkins-ci.org/commit/branch-api-plugin/7b2dafd1dcaa556fc6db14a7c23244df4dcbbbf1 Log: JENKINS-34691 Noting core version

          Code changed in jenkins
          User: Stephen Connolly
          Path:
          src/main/java/jenkins/branch/MultiBranchProject.java
          src/main/resources/jenkins/branch/Messages.properties
          http://jenkins-ci.org/commit/branch-api-plugin/f4ffb3e2aa9464c4ce1cbfce455de94ba8d9e2a4
          Log:
          Merge pull request #95 from stephenc/jenkins-34691

          JENKINS-34691 Adopt proposed veto mechanism

          Compare: https://github.com/jenkinsci/branch-api-plugin/compare/d7f50ea7911a...f4ffb3e2aa94

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: src/main/java/jenkins/branch/MultiBranchProject.java src/main/resources/jenkins/branch/Messages.properties http://jenkins-ci.org/commit/branch-api-plugin/f4ffb3e2aa9464c4ce1cbfce455de94ba8d9e2a4 Log: Merge pull request #95 from stephenc/jenkins-34691 JENKINS-34691 Adopt proposed veto mechanism Compare: https://github.com/jenkinsci/branch-api-plugin/compare/d7f50ea7911a...f4ffb3e2aa94

          Code changed in jenkins
          User: Stephen Connolly
          Path:
          content/_data/changelogs/weekly.yml
          http://jenkins-ci.org/commit/jenkins.io/66b017017e91f7fff27a423f2d7ea10088465585
          Log:
          Noting merge of JENKINS-34691

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: content/_data/changelogs/weekly.yml http://jenkins-ci.org/commit/jenkins.io/66b017017e91f7fff27a423f2d7ea10088465585 Log: Noting merge of JENKINS-34691

          Code changed in jenkins
          User: R. Tyler Croy
          Path:
          content/_data/changelogs/weekly.yml
          http://jenkins-ci.org/commit/jenkins.io/91d352197897e24941b25ef4a20e0728da8b1e22
          Log:
          Merge pull request #755 from stephenc/patch-4

          Noting merge of JENKINS-34691

          Compare: https://github.com/jenkins-infra/jenkins.io/compare/525a918e2646...91d352197897

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: R. Tyler Croy Path: content/_data/changelogs/weekly.yml http://jenkins-ci.org/commit/jenkins.io/91d352197897e24941b25ef4a20e0728da8b1e22 Log: Merge pull request #755 from stephenc/patch-4 Noting merge of JENKINS-34691 Compare: https://github.com/jenkins-infra/jenkins.io/compare/525a918e2646...91d352197897

          Jesse Glick added a comment -

          Should this not be Fixed now?

          BTW you forgot to update the @since.

          Jesse Glick added a comment - Should this not be Fixed now? BTW you forgot to update the @since .

            stephenconnolly Stephen Connolly
            rmgraham Ryan Graham
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: