• Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • scm-api-plugin

      SCMHead could extend Actionable, or simply have a getAction(Class) method which can call TransientActionFactory. This would be useful for defining and implementing APIs for associating information with branches without forcing callers to cast to a subtype of SCMHead. For example, for any SCMSource supporting something like pull requests, you would like to be able to define an action listing the author and so on.

      To expose this kind of information directly via REST (Stapler exporting), it would suffice to make BranchJobProperty an @ExportedBean, same for Branch and SCMHead, etc.

          [JENKINS-33309] Make SCMHead Actionable

          jglick My vote is to go for extending Actionable, yes it is more inheritance tree linkage, but it seems reasonable in this case

          Stephen Connolly added a comment - jglick My vote is to go for extending Actionable, yes it is more inheritance tree linkage, but it seems reasonable in this case

          Maybe related? PR

          Manuel Recena Soto added a comment - Maybe related? PR

          Jesse Glick added a comment -

          I investigated actually extending Actionable but decided against it for reasons described in JENKINS-33399: it brings in quite a lot of unwanted baggage.

          Jesse Glick added a comment - I investigated actually extending Actionable but decided against it for reasons described in JENKINS-33399 : it brings in quite a lot of unwanted baggage.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/main/java/jenkins/scm/api/SCMHead.java
          src/main/java/jenkins/scm/api/actions/ChangeRequestAction.java
          http://jenkins-ci.org/commit/scm-api-plugin/6f50426f828c4aceeccd10e0af941d712d65f294
          Log:
          JENKINS-33309 Allow SCMHead to have actions, and define ChangeRequestAction.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/jenkins/scm/api/SCMHead.java src/main/java/jenkins/scm/api/actions/ChangeRequestAction.java http://jenkins-ci.org/commit/scm-api-plugin/6f50426f828c4aceeccd10e0af941d712d65f294 Log: JENKINS-33309 Allow SCMHead to have actions, and define ChangeRequestAction.

          Code changed in jenkins
          User: Stephen Connolly
          Path:
          src/main/java/jenkins/scm/api/SCMHead.java
          src/main/java/jenkins/scm/api/actions/ChangeRequestAction.java
          http://jenkins-ci.org/commit/scm-api-plugin/891ef066e09ceced578f97995b2492633e93c43c
          Log:
          Merge pull request #7 from jglick/SCMHead-Actionable-JENKINS-33309

          JENKINS-33309 Allow SCMHead to have actions, and define ChangeRequestAction

          Compare: https://github.com/jenkinsci/scm-api-plugin/compare/b82237184965...891ef066e09c

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: src/main/java/jenkins/scm/api/SCMHead.java src/main/java/jenkins/scm/api/actions/ChangeRequestAction.java http://jenkins-ci.org/commit/scm-api-plugin/891ef066e09ceced578f97995b2492633e93c43c Log: Merge pull request #7 from jglick/SCMHead-Actionable- JENKINS-33309 JENKINS-33309 Allow SCMHead to have actions, and define ChangeRequestAction Compare: https://github.com/jenkinsci/scm-api-plugin/compare/b82237184965...891ef066e09c

          Code changed in jenkins
          User: Jesse Glick
          Path:
          pom.xml
          src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java
          src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestAction.java
          src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestSCMHead.java
          http://jenkins-ci.org/commit/github-branch-source-plugin/0d2f289c93eef349e510e725f45abfb87e89897f
          Log:
          JENKINS-33309 Implement ChangeRequestAction.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: pom.xml src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestAction.java src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestSCMHead.java http://jenkins-ci.org/commit/github-branch-source-plugin/0d2f289c93eef349e510e725f45abfb87e89897f Log: JENKINS-33309 Implement ChangeRequestAction.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          pom.xml
          src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java
          src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestAction.java
          src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestSCMHead.java
          http://jenkins-ci.org/commit/github-branch-source-plugin/3486aa81e9468357f9a1902740de0d8a15d53f4d
          Log:
          Merge pull request #31 from jglick/SCMHead-Actionable-JENKINS-33309

          JENKINS-33309 Implement ChangeRequestAction

          Compare: https://github.com/jenkinsci/github-branch-source-plugin/compare/e3784380a29f...3486aa81e946

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: pom.xml src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestAction.java src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestSCMHead.java http://jenkins-ci.org/commit/github-branch-source-plugin/3486aa81e9468357f9a1902740de0d8a15d53f4d Log: Merge pull request #31 from jglick/SCMHead-Actionable- JENKINS-33309 JENKINS-33309 Implement ChangeRequestAction Compare: https://github.com/jenkinsci/github-branch-source-plugin/compare/e3784380a29f...3486aa81e946

          Jesse Glick added a comment -

          API defined and implemented in github-branch-source, so considering this fixed.

          Stapler exporting is still pending a couple more PRs.

          Jesse Glick added a comment - API defined and implemented in github-branch-source , so considering this fixed. Stapler exporting is still pending a couple more PRs.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          pom.xml
          src/main/java/jenkins/branch/Branch.java
          src/main/java/jenkins/branch/BranchNameContributor.java
          http://jenkins-ci.org/commit/branch-api-plugin/1d5c9aeb17b8f92dbe24ad18a2498b93a4f944d6
          Log:
          JENKINS-33309 Set environment variables from ChangeRequestAction.
          Also make sure SCMHead.actions are exported to REST.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: pom.xml src/main/java/jenkins/branch/Branch.java src/main/java/jenkins/branch/BranchNameContributor.java http://jenkins-ci.org/commit/branch-api-plugin/1d5c9aeb17b8f92dbe24ad18a2498b93a4f944d6 Log: JENKINS-33309 Set environment variables from ChangeRequestAction. Also make sure SCMHead.actions are exported to REST.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          pom.xml
          src/main/java/jenkins/branch/Branch.java
          src/main/java/jenkins/branch/BranchNameContributor.java
          http://jenkins-ci.org/commit/branch-api-plugin/72ab0f9ed7a83a93847b966dafa527b1250f5866
          Log:
          Merge pull request #29 from jglick/SCMHead-Actionable-JENKINS-33309

          JENKINS-33309 Use ChangeRequestAction

          Compare: https://github.com/jenkinsci/branch-api-plugin/compare/60c05e72532c...72ab0f9ed7a8

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: pom.xml src/main/java/jenkins/branch/Branch.java src/main/java/jenkins/branch/BranchNameContributor.java http://jenkins-ci.org/commit/branch-api-plugin/72ab0f9ed7a83a93847b966dafa527b1250f5866 Log: Merge pull request #29 from jglick/SCMHead-Actionable- JENKINS-33309 JENKINS-33309 Use ChangeRequestAction Compare: https://github.com/jenkinsci/branch-api-plugin/compare/60c05e72532c...72ab0f9ed7a8

            jglick Jesse Glick
            jglick Jesse Glick
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: