• Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Major Major
    • pipeline

      The scm-api and branch-api plugins allow you to clearly organize a project by branches. Currently the Literate plugin and some others make use of them. It would be desirable for many flows to use this plugin so that builds from each branch of a repository are tracked independently.

      Cannot make flows enforce use of this in all cases (like Literate does), because general flows could check out from multiple repositories, do custom merge operations, and so onā€”things that cannot be statically represented as a set of branch subprojects. But for the common case where the flow is associated with a single repository, and it is going to do a standard CI clone/update step on a branch triggered by changes (like an AbstractProject with SCM enforces), it would be desirable to present a standard UI.

      The project configuration could specify the SCM sources and a label to check them out on, and the flow script would have to be run inside an implicit node block after checking out the branch. As a more flexible alternative, the current branch name could just be passed into the flow as a variable, which would then be responsible for doing the checkout itself. This is tricky because SCMSource.build(SCMHead, SCMRevision) is designed to return a live SCM, not metadata like branch names. Potentially the SCM itself (or its DescribableHelper.uninstantiate representation) could be passed as the variable, which you would pass with or without modification to the checkout step.

      As far as the existing APIs are concerned, a workflow could easily be an SCMSourceOwner. The main blocking issue is that MultiBranchProject and the like assume AbstractProject/AbstractBuild and so need to be refactored to allow Job/Run (perhaps with some further restrictions).

      SCMSource does not seem to support workspace-based polling, nor differentiating significant from insignificant changes (consider MercurialSCM.modules for example). However the literate plugin does not seem to use it directly for polling anyway; rather it creates the SCM and then uses that for polling.

          [JENKINS-26129] Multibranch workflow projects

          Jesse Glick created issue -
          Jesse Glick made changes -
          Link New: This issue is related to JENKINS-26100 [ JENKINS-26100 ]

          Jesse Glick added a comment -

          You would perhaps also want to be able to load the script from SCM (in the same branch), as in JENKINS-26101.

          Jesse Glick added a comment - You would perhaps also want to be able to load the script from SCM (in the same branch), as in JENKINS-26101 .
          Jesse Glick made changes -
          Link New: This issue is related to JENKINS-26101 [ JENKINS-26101 ]
          Jesse Glick made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Jesse Glick made changes -
          Remote Link New: This issue links to "branch-api PR 4 (Web Link)" [ 12959 ]
          Jesse Glick made changes -
          Remote Link New: This issue links to "literate-plugin PR 6 (Web Link)" [ 12960 ]
          Jesse Glick made changes -
          Remote Link New: This issue links to "workflow PR 147 (Web Link)" [ 12961 ]
          Jesse Glick made changes -
          Link New: This issue is related to JENKINS-29481 [ JENKINS-29481 ]

          Code changed in jenkins
          User: Jesse Glick
          Path:
          pom.xml
          src/main/java/jenkins/branch/BranchProjectFactory.java
          src/main/java/jenkins/branch/BranchProperty.java
          src/main/java/jenkins/branch/BranchPropertyDescriptor.java
          src/main/java/jenkins/branch/BranchPropertyStrategyDescriptor.java
          src/main/java/jenkins/branch/BuildRetentionBranchProperty.java
          src/main/java/jenkins/branch/DeadBranchStrategy.java
          src/main/java/jenkins/branch/DeadBranchStrategyDescriptor.java
          src/main/java/jenkins/branch/DefaultDeadBranchStrategy.java
          src/main/java/jenkins/branch/DescriptorOrder.java
          src/main/java/jenkins/branch/IndexAtLeastTrigger.java
          src/main/java/jenkins/branch/JobDecorator.java
          src/main/java/jenkins/branch/MultiBranchProject.java
          src/main/java/jenkins/branch/MultiBranchProjectDescriptor.java
          src/main/java/jenkins/branch/ParameterDefinitionBranchProperty.java
          src/main/java/jenkins/branch/ProjectDecorator.java
          src/main/java/jenkins/branch/RateLimitBranchProperty.java
          src/main/java/jenkins/branch/UntrustedBranchProperty.java
          src/main/resources/jenkins/branch/MultiBranchProject/configure-common.jelly
          src/main/resources/jenkins/branch/ParameterDefinitionBranchProperty/config.jelly
          http://jenkins-ci.org/commit/branch-api-plugin/06f1e2f8f3a22fd94b80a7306f4bb79be014c4e2
          Log:
          Merge pull request #4 from jenkinsci/multibranch-workflow-JENKINS-26129

          JENKINS-26129 Prepare for multibranch workflows

          Compare: https://github.com/jenkinsci/branch-api-plugin/compare/83a7d3242992...06f1e2f8f3a2

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: pom.xml src/main/java/jenkins/branch/BranchProjectFactory.java src/main/java/jenkins/branch/BranchProperty.java src/main/java/jenkins/branch/BranchPropertyDescriptor.java src/main/java/jenkins/branch/BranchPropertyStrategyDescriptor.java src/main/java/jenkins/branch/BuildRetentionBranchProperty.java src/main/java/jenkins/branch/DeadBranchStrategy.java src/main/java/jenkins/branch/DeadBranchStrategyDescriptor.java src/main/java/jenkins/branch/DefaultDeadBranchStrategy.java src/main/java/jenkins/branch/DescriptorOrder.java src/main/java/jenkins/branch/IndexAtLeastTrigger.java src/main/java/jenkins/branch/JobDecorator.java src/main/java/jenkins/branch/MultiBranchProject.java src/main/java/jenkins/branch/MultiBranchProjectDescriptor.java src/main/java/jenkins/branch/ParameterDefinitionBranchProperty.java src/main/java/jenkins/branch/ProjectDecorator.java src/main/java/jenkins/branch/RateLimitBranchProperty.java src/main/java/jenkins/branch/UntrustedBranchProperty.java src/main/resources/jenkins/branch/MultiBranchProject/configure-common.jelly src/main/resources/jenkins/branch/ParameterDefinitionBranchProperty/config.jelly http://jenkins-ci.org/commit/branch-api-plugin/06f1e2f8f3a22fd94b80a7306f4bb79be014c4e2 Log: Merge pull request #4 from jenkinsci/multibranch-workflow- JENKINS-26129 JENKINS-26129 Prepare for multibranch workflows Compare: https://github.com/jenkinsci/branch-api-plugin/compare/83a7d3242992...06f1e2f8f3a2

            jglick Jesse Glick
            jglick Jesse Glick
            Votes:
            4 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: