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

Obtain SCMHead from Item

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      In some cases an SCMSource implementation will receive a Job (branch project) from somewhere, such as a listener, and need to know which SCMHead it corresponds to. This information is not currently retrievable directly; you have to assume that every BranchProjectFactory creates children whose Job.name matches SCMHead.name, as both WorkflowMultiBranchProjectFactory and LiterateMultibranchProject.ProjectFactoryImpl in fact do, and as MultiBranchProject itself seems to require (cf. Javadoc for getOrCreateBranchItemsFor).

      Would be nicer for scm-api to include some API letting you map Item to SCMHead. The implementation in branch-api would just call BranchProjectFactory.getBranch. Thus you could reliably get this reverse mapping without a branch-api dependency.

        Attachments

          Issue Links

            Activity

            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            src/main/java/jenkins/scm/api/SCMHead.java
            http://jenkins-ci.org/commit/scm-api-plugin/401b49d02efabc050b18591528442ea924e14686
            Log:
            JENKINS-30595 API to get an SCMHead from an Item.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/jenkins/scm/api/SCMHead.java http://jenkins-ci.org/commit/scm-api-plugin/401b49d02efabc050b18591528442ea924e14686 Log: JENKINS-30595 API to get an SCMHead from an Item.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            src/main/java/jenkins/scm/api/SCMHead.java
            http://jenkins-ci.org/commit/scm-api-plugin/f86a38a18caed9f1abc9cff70842def9817308aa
            Log:
            Merge pull request #4 from jglick/HeadByItem-JENKINS-30595

            JENKINS-30595 API to get an SCMHead from an Item

            Compare: https://github.com/jenkinsci/scm-api-plugin/compare/07a57da6c14c...f86a38a18cae

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/jenkins/scm/api/SCMHead.java http://jenkins-ci.org/commit/scm-api-plugin/f86a38a18caed9f1abc9cff70842def9817308aa Log: Merge pull request #4 from jglick/HeadByItem- JENKINS-30595 JENKINS-30595 API to get an SCMHead from an Item Compare: https://github.com/jenkinsci/scm-api-plugin/compare/07a57da6c14c...f86a38a18cae
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            pom.xml
            src/main/java/jenkins/branch/BranchProjectFactory.java
            http://jenkins-ci.org/commit/branch-api-plugin/15057938e03783051ad115afc9bd3cfbcd732c3e
            Log:
            JENKINS-30595 Implemented API.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: pom.xml src/main/java/jenkins/branch/BranchProjectFactory.java http://jenkins-ci.org/commit/branch-api-plugin/15057938e03783051ad115afc9bd3cfbcd732c3e Log: JENKINS-30595 Implemented API.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            pom.xml
            src/main/java/jenkins/branch/BranchProjectFactory.java
            http://jenkins-ci.org/commit/branch-api-plugin/a0bd80aa4063e7e3c40b03af9bbace280c134c8a
            Log:
            Merge pull request #13 from jglick/HeadByItem-JENKINS-30595

            JENKINS-30595 Implemented API

            Compare: https://github.com/jenkinsci/branch-api-plugin/compare/4f02e07e4472...a0bd80aa4063

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: pom.xml src/main/java/jenkins/branch/BranchProjectFactory.java http://jenkins-ci.org/commit/branch-api-plugin/a0bd80aa4063e7e3c40b03af9bbace280c134c8a Log: Merge pull request #13 from jglick/HeadByItem- JENKINS-30595 JENKINS-30595 Implemented API Compare: https://github.com/jenkinsci/branch-api-plugin/compare/4f02e07e4472...a0bd80aa4063
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            multibranch/src/test/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowMultiBranchProjectTest.java
            http://jenkins-ci.org/commit/workflow-plugin/032782340f05226b36d800d2d51fdae8c0391a5a
            Log:
            JENKINS-30595 Tested API.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: multibranch/src/test/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowMultiBranchProjectTest.java http://jenkins-ci.org/commit/workflow-plugin/032782340f05226b36d800d2d51fdae8c0391a5a Log: JENKINS-30595 Tested API.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            multibranch/src/test/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowMultiBranchProjectTest.java
            http://jenkins-ci.org/commit/workflow-plugin/1b83632c5b8d44498abfcef4e752a749dad3f64d
            Log:
            Merge pull request #237 from jglick/HeadByItem-JENKINS-30595

            JENKINS-30595 Tested API

            Compare: https://github.com/jenkinsci/workflow-plugin/compare/8803a3e713d0...1b83632c5b8d

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: multibranch/src/test/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowMultiBranchProjectTest.java http://jenkins-ci.org/commit/workflow-plugin/1b83632c5b8d44498abfcef4e752a749dad3f64d Log: Merge pull request #237 from jglick/HeadByItem- JENKINS-30595 JENKINS-30595 Tested API Compare: https://github.com/jenkinsci/workflow-plugin/compare/8803a3e713d0...1b83632c5b8d
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            multibranch/src/test/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowMultiBranchProjectTest.java
            http://jenkins-ci.org/commit/workflow-multibranch-plugin/08ae885717fdb8d078bcb50e029e5a71a8bfb00e
            Log:
            JENKINS-30595 Tested API.
            Originally-Committed-As: 032782340f05226b36d800d2d51fdae8c0391a5a

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: multibranch/src/test/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowMultiBranchProjectTest.java http://jenkins-ci.org/commit/workflow-multibranch-plugin/08ae885717fdb8d078bcb50e029e5a71a8bfb00e Log: JENKINS-30595 Tested API. Originally-Committed-As: 032782340f05226b36d800d2d51fdae8c0391a5a
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            multibranch/src/test/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowMultiBranchProjectTest.java
            http://jenkins-ci.org/commit/workflow-multibranch-plugin/710f790b77b476bb32734f1ba1d385d91306c40e
            Log:
            Merge pull request #237 from jglick/HeadByItem-JENKINS-30595

            JENKINS-30595 Tested API
            Originally-Committed-As: 1b83632c5b8d44498abfcef4e752a749dad3f64d

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: multibranch/src/test/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowMultiBranchProjectTest.java http://jenkins-ci.org/commit/workflow-multibranch-plugin/710f790b77b476bb32734f1ba1d385d91306c40e Log: Merge pull request #237 from jglick/HeadByItem- JENKINS-30595 JENKINS-30595 Tested API Originally-Committed-As: 1b83632c5b8d44498abfcef4e752a749dad3f64d

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                jglick Jesse Glick
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: