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

Allow SCMSource and SCMNavigator subtypes to share common traits

XMLWordPrintable

      Examples of traits from the JENKINS-43426 epic:

      • There will be a strategy to use switch the checkout to over SSH and this will have a option to select the SSH Credentials for checkout.
      • There will be at least one strategy to subset the branches by name (include / exclude)
        • There will one implementation that uses the existing wildcard style
        • Other strategies may be added later to support different branch name matching rules, e.g. Regex, etc. These secondary strategies do not form part of the MVP but it may prove assist extension point API validation to proof-of-concept implement a second one.
      • There will be three strategies to subset the branches by type:
        • There will be a strategy to select origin branches. This strategy will have a drop-down mode selection:
          • Only origin branches that are not filed as PRs
          • Only origin branches that are filed as PRs
          • All origin branches irrespective of whether filed as PR or not
        • There will be a strategy to select origin PRs. This strategy will have a drop-down mode selection:
          • Merge commit PRs
          • Head commit PRs
          • Both merge commit and head commit PRs
        • There will be a strategy to select fork PRs. This strategy will have a drop-down mode selection:
          • Merge commit PRs
          • Head commit PRs
          • Both merge commit and head commit PRs
      • There will also be a drop-down for trust selection:
          • Show all fork PRs but only trust fork PRs from repository contributors
          • Only show PRs from repository contributors
          • Show and trust all fork PRs
             TBD determine if we need to expose suppression of automatic builds of untrusted PRs here.
        • There will be a proof-of-concept implementation of a tag support branch selector. This is not a feature experienced by users today, but there are api's & code which is ready to provide it. We won't ship this enabled by default in the release.
      • There will be the ability to control a subset of the Git plugin’s additional behaviours for the generated SCM of branches. This will be an applies to all setting. The available options will be subject to a whitelisting extension point (so that plugins can define additional Git behaviours and whitelist them in at the same time). The default whitelist will be:
        • Advanced Checkout behaviours
        • Advanced Clone behaviours
        • Advanced Submodule behaviours
        • Clean after checkout
        • Clean before checkout
        • Custom user name / email address
        • Git LFS pull after checkout
        • Use commit author in changelog (says it requires workspace polling, but really does not / should not require workspace polling)
        • Wipe out repository & force clone

      Acceptance criteria

      • The SCM API provides the concept of a trait that applies to SCMSource and SCMNavigator
      • Traits will be opt-in, i.e. the SCMSource implementation must be written to use traits
      • Common trait implementations can be shared by multiple implementations.
      • Trait implementations can be specific to a single SCMSource or SCMNavigator
      • The SCM API will provide a trait implementation that allows for filtering branches based on include/exclude wildcard name matching
      • The SCM API MockSCM implementation will support traits
      • The common trait implementations in SCM API will have tests
      • The implementers guide will be updated to highlight the trait style of implementation and encourage following that path. 

            stephenconnolly Stephen Connolly
            stephenconnolly Stephen Connolly
            Votes:
            4 Vote for this issue
            Watchers:
            21 Start watching this issue

              Created:
              Updated:
              Resolved: