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

Consolidate common traits into SCM-API

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      JENKINS-43507 added traits to a number of plugins.

      In order to side-step the problem of determining what the common traits for discovery and other cross-implementation concerns should look like, code duplication was used.

      The net result is that each of the implementations has duplicated code for:

      • Discovering Branches
      • Discovering Origin pull requests
      • Discovering Fork pull requests
      • Checking out over SSH
      • Overriding webhook management

      The intent is that these common traits can be moved into SCM API rather than duplicated by every SCM API implementation, but we need to determine the shape of these traits a bit better before that can take place as these traits so far are all effectively DVCS model traits.

      Ideally seeing the shape of traits for Subversion, Perforce and perhaps Accurev or Clearcase would help clarify what is required of a common implementation. 

      There is also the question of how to make the common traits not look common, for example:

      • Discover Branches: when used in Git or Mercurial, this probably does not need any options to be configured because these sources do not have the concept of pull requests. When used in GitHub, Bitbucket, Gitea, etc they do have the concept of pull requests and consequently there are multiple strategies that the user needs to select from.

      In the ideal case we would have just one BranchDiscovery trait, when added to a Git or Mercurial source it would not show any configuration and when added to a GitHub / Bitbucket / Gitea source it would display the strategy selection drop down list.

        Attachments

          Issue Links

            Activity

            Hide
            jamesdumay James Dumay added a comment -

            Note to self: Stephen Connolly mentioned this was an important future enhancement

            Show
            jamesdumay James Dumay added a comment - Note to self: Stephen Connolly mentioned this was an important future enhancement
            Hide
            ccaraivan Costin Caraivan added a comment - - edited

            Could this be bumped in priority? These traits are used downstream by the job DSL plugin and their lack forces users to restot to the configure block in the job DSL configurations, which is an unsafe hack, basically.

            Show
            ccaraivan Costin Caraivan added a comment - - edited Could this be bumped in priority? These traits are used downstream by the job DSL plugin and their lack forces users to restot to the configure block in the job DSL configurations, which is an unsafe hack, basically.

              People

              • Assignee:
                Unassigned
                Reporter:
                stephenconnolly Stephen Connolly
              • Votes:
                11 Vote for this issue
                Watchers:
                13 Start watching this issue

                Dates

                • Created:
                  Updated: