• git-plugin 4.0.0, bitbucket-branch-source-plugin 2.7.0, github-branch-source-plugin 2.6.0

      In order to make using traits easier, we need to add @Symbol annotations to the trait implementations.

          [JENKINS-45504] Add @Symbol annotations to traits

          Stephen Connolly created issue -

          This issue is critically blocked by JENKINS-45503

          If there are two traits with the same @Symbol annotation then the annotation is ignored, thus until the generic discovery traits have been consolidated into SCM-API, we cannot add the @Symbol annotations that we would want to them.

          Ideally we would have

          // in SCM-API plugin
          @Symbol("discoverBranches")
          public class BranchDiscoveryTrait { ... }

          But without JENKINS-45503 we would be forced to implement this as

          // in Git plugin
          @Symbol("discoverGitBranches")
          public class BranchDiscoveryTrait { ... }
          
          // in GitHub Branch Source plugin
          @Symbol("discoverGitHubBranches")
          public class BranchDiscoveryTrait { ... }
          
          // in Bitbucket Branch Source plugin
          @Symbol("discoverBitbucketBranches")
          public class BranchDiscoveryTrait { ... }
          
          // etc

          Furthermore, if we added those annotations, then existing usage would be broken as soon as JENKINS-45503 was implemented unless SCM API had

          // in SCM-API plugin
          @Symbol({"discoverBranches","discoverGitBranches","discoverGitHubBranches","discoverBitbucketBranches"})
          public class BranchDiscoveryTrait { ... }

          Which is effectively encoding SCM specific names into the generic API

           

          Stephen Connolly added a comment - This issue is critically blocked by JENKINS-45503 If there are two traits with the same @Symbol annotation then the annotation is ignored, thus until the generic discovery traits have been consolidated into SCM-API, we cannot add the @Symbol annotations that we would want to them. Ideally we would have // in SCM-API plugin @Symbol( "discoverBranches" ) public class BranchDiscoveryTrait { ... } But without JENKINS-45503 we would be forced to implement this as // in Git plugin @Symbol( "discoverGitBranches" ) public class BranchDiscoveryTrait { ... } // in GitHub Branch Source plugin @Symbol( "discoverGitHubBranches" ) public class BranchDiscoveryTrait { ... } // in Bitbucket Branch Source plugin @Symbol( "discoverBitbucketBranches" ) public class BranchDiscoveryTrait { ... } // etc Furthermore, if we added those annotations, then existing usage would be broken as soon as JENKINS-45503 was implemented unless SCM API had // in SCM-API plugin @Symbol({ "discoverBranches" , "discoverGitBranches" , "discoverGitHubBranches" , "discoverBitbucketBranches" }) public class BranchDiscoveryTrait { ... } Which is effectively encoding SCM specific names into the generic API  
          Stephen Connolly made changes -
          Link New: This issue is blocked by JENKINS-45503 [ JENKINS-45503 ]
          Stephen Connolly made changes -
          Assignee Original: Antonio Muñiz [ amuniz ]
          Stephen Connolly made changes -
          Link New: This issue is blocked by JENKINS-44884 [ JENKINS-44884 ]
          James Dumay made changes -
          Labels New: cloudbees-internal-pipeline
          James Dumay made changes -
          Labels Original: cloudbees-internal-pipeline New: cloudbees-internal-pipeline technical-debt

          James Dumay added a comment -

          Note to self: stephenconnolly mentioned this was an important future enhancement

          James Dumay added a comment - Note to self: stephenconnolly mentioned this was an important future enhancement
          Stephen Connolly made changes -
          Link New: This issue is duplicated by JENKINS-46202 [ JENKINS-46202 ]

           

          After updating our jenkins plugins, we are facing the problem that we cannot set the BranchDiscovery options on a multibranchPipelineJob through job-dsl.

          Googling around I found this issue that seems to explain why we cannot yet use the BranchDiscoveryTrait to fix this.

          Is there an existing workaround to get this behaviour (through a configure block ?)

          Nico De Ceulaer added a comment -   After updating our jenkins plugins, we are facing the problem that we cannot set the BranchDiscovery options on a multibranchPipelineJob through job-dsl. Googling around I found this issue that seems to explain why we cannot yet use the BranchDiscoveryTrait to fix this. Is there an existing workaround to get this behaviour (through a configure block ?)

            Unassigned Unassigned
            stephenconnolly Stephen Connolly
            Votes:
            24 Vote for this issue
            Watchers:
            35 Start watching this issue

              Created:
              Updated:
              Resolved: