• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None

      I am not being able to see tags in a multibranch pipeline project. Please see the attached screenshots, branches.png and tags.png.

      I am selecting: 

      Discover tags --> Specify ref specs --> Ref spec

      +refs/tags/*:refs/remotes/origin/tags/* 

      Curiously, if I select discover tags by 'filter by name' and specify this particular wildcard "\d+.\d+.\d+", then I see the tags but the master branch seems to be struck out. See the attached screenshot 'branches_struck_out.png' again.

      The scan repository log shows this when the above option is selected:

      Examining orgname/repository_name  Checking branches... 
      
       Getting remote branches...    
      Checking branch master    
      Checking branch foo-bar  
      2 branches were processed  
      Checking pull-requests...  
      Getting remote pull requests...    
      Checking pull request #310    
      Checking pull request #294  
      2 pull requests were processed  
      Checking tags...  
      Getting remote tags...    
      Checking tag 1.1.62
            'build/ci/Jenkinsfile' not found
          Does not meet criteria    Checking tag 1.1.63
            'build/ci/Jenkinsfile' not found
          Does not meet criteria    Checking tag 1.1.64
            'build/ci/Jenkinsfile' not found
          Does not meet criteria    Checking tag 1.2.12
            'build/ci/Jenkinsfile' not found
          Does not meet criteria    Checking tag 1.2.21
            'build/ci/Jenkinsfile' not found
          Does not meet criteria    Checking tag 1.2.30
            'build/ci/Jenkinsfile' not found
          Does not meet criteria    Checking tag 1.2.32
            'build/ci/Jenkinsfile' not found
          Does not meet criteria 
      <OMITTED>

      How can I resolve this problem? 

        1. branches_struck_out.png
          branches_struck_out.png
          25 kB
        2. branches.png
          branches.png
          11 kB
        3. Jenkinsfile
          7 kB
        4. pr_struck_out.png
          pr_struck_out.png
          26 kB
        5. remove_refspec.png
          remove_refspec.png
          29 kB
        6. tags.png
          tags.png
          24 kB

          [JENKINS-69577] Not able to see tags

          Mark Waite added a comment -

          I don't understand why you need to use a refspec. What prompted you to add a refspec rather than just let the plugin handle the refspec definition?

          If you enable "Discover tags" it will discover tags. If you then define the filtering regex for all matches to only be numbers (it is not just for tags) , then the master branch should not match that regular expression that you listed. If you want the numeric string tags and the master branch, you'll need to provide a regular expression that matches them.

          I've reassigned the issue to the GitHub branch source on the assumption that you're using the implementation in the GitHub branch source. I used the implementation from the Bitbucket branch source for my experiments.

          Mark Waite added a comment - I don't understand why you need to use a refspec. What prompted you to add a refspec rather than just let the plugin handle the refspec definition? If you enable "Discover tags" it will discover tags. If you then define the filtering regex for all matches to only be numbers (it is not just for tags) , then the master branch should not match that regular expression that you listed. If you want the numeric string tags and the master branch, you'll need to provide a regular expression that matches them. I've reassigned the issue to the GitHub branch source on the assumption that you're using the implementation in the GitHub branch source. I used the implementation from the Bitbucket branch source for my experiments.

          dire straits added a comment -

          dire straits added a comment -

          dire straits added a comment -

          I removed the refspec and it still shows that the pull request is struck out. One thing that I am noticing is this error in the scan repository log.

           

          Checking pull request #294
          ERROR: [Sat Sep 10 19:21:03 UTC 2022] Could not fetch branches from source b014fb82-f7d9-4652-bdcd-83c0c2a275c0
          [Sat Sep 10 19:21:03 UTC 2022] Finished branch indexing. Indexing took 2.7 sec
          FATAL: Failed to recompute children of orgname-repositoryname
          org.kohsuke.github.HttpException: {"message":"Must have push access to view collaborator permission.","documentation_url":"https://docs.github.com/rest/collaborators/collaborators#get-repository-permissions-for-a-user"}
          	at org.kohsuke.github.GitHubConnectorResponseErrorHandler$1.onError(GitHubConnectorResponseErrorHandler.java:56)
          	at org.kohsuke.github.GitHubClient.detectKnownErrors(GitHubClient.java:424)
          	at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:386)
          	at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:355)
          	at org.kohsuke.github.Requester.fetch(Requester.java:76)
          	at org.kohsuke.github.GHRepository.getPermission(GHRepository.java:1028)
          	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource$1.fetch(GitHubSCMSource.java:1036)
          	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSourceRequest.getPermissions(GitHubSCMSourceRequest.java:450)
          	at org.jenkinsci.plugins.github_branch_source.ForkPullRequestDiscoveryTrait$TrustPermission.checkTrusted(ForkPullRequestDiscoveryTrait.java:323)
          	at org.jenkinsci.plugins.github_branch_source.ForkPullRequestDiscoveryTrait$TrustPermission.checkTrusted(ForkPullRequestDiscoveryTrait.java:310)
          	at jenkins.scm.api.trait.SCMHeadAuthority.isTrusted(SCMHeadAuthority.java:101)
          	at jenkins.scm.api.trait.SCMSourceRequest.isTrusted(SCMSourceRequest.java:213)
          	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource$4.create(GitHubSCMSource.java:1270)
          	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource$4.create(GitHubSCMSource.java:1264)
          	at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:339)
          	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrievePullRequest(GitHubSCMSource.java:1261)
          	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:1099)
          	at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:373)
          	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:283)
          	at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:641)
          	at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:278)
          	at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:166)
          	at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1032)
          	at hudson.model.ResourceController.execute(ResourceController.java:101)
          	at hudson.model.Executor.run(Executor.java:442)
          Finished: FAILURE
           

          Do you think this might be of any significance?

          dire straits added a comment - I removed the refspec and it still shows that the pull request is struck out. One thing that I am noticing is this error in the scan repository log.   Checking pull request #294 ERROR: [Sat Sep 10 19:21:03 UTC 2022] Could not fetch branches from source b014fb82-f7d9-4652-bdcd-83c0c2a275c0 [Sat Sep 10 19:21:03 UTC 2022] Finished branch indexing. Indexing took 2.7 sec FATAL: Failed to recompute children of orgname-repositoryname org.kohsuke.github.HttpException: { "message" : "Must have push access to view collaborator permission." , "documentation_url" : "https: //docs.github.com/ rest /collaborators/collaborators#get-repository-permissions- for -a-user" } at org.kohsuke.github.GitHubConnectorResponseErrorHandler$1.onError(GitHubConnectorResponseErrorHandler.java:56) at org.kohsuke.github.GitHubClient.detectKnownErrors(GitHubClient.java:424) at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:386) at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:355) at org.kohsuke.github.Requester.fetch(Requester.java:76) at org.kohsuke.github.GHRepository.getPermission(GHRepository.java:1028) at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource$1.fetch(GitHubSCMSource.java:1036) at org.jenkinsci.plugins.github_branch_source.GitHubSCMSourceRequest.getPermissions(GitHubSCMSourceRequest.java:450) at org.jenkinsci.plugins.github_branch_source.ForkPullRequestDiscoveryTrait$TrustPermission.checkTrusted(ForkPullRequestDiscoveryTrait.java:323) at org.jenkinsci.plugins.github_branch_source.ForkPullRequestDiscoveryTrait$TrustPermission.checkTrusted(ForkPullRequestDiscoveryTrait.java:310) at jenkins.scm.api.trait.SCMHeadAuthority.isTrusted(SCMHeadAuthority.java:101) at jenkins.scm.api.trait.SCMSourceRequest.isTrusted(SCMSourceRequest.java:213) at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource$4.create(GitHubSCMSource.java:1270) at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource$4.create(GitHubSCMSource.java:1264) at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:339) at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrievePullRequest(GitHubSCMSource.java:1261) at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:1099) at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:373) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:283) at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:641) at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:278) at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:166) at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1032) at hudson.model.ResourceController.execute(ResourceController.java:101) at hudson.model.Executor.run(Executor.java:442) Finished: FAILURE Do you think this might be of any significance?

          Mark Waite added a comment -

          Collaborator permission is checked to decide if changes to the Pipeline (in the Jenkinsfile) should be evaluated as part of the pull request or if the Jenkinsfile from the destination branch is used when evaluating the pull request. I would not expect the lack of collaborator permissions to prevent detection and enablement of the pull request.

          I don't understand what you are expecting to see. You say that you enabled "Discover tags". I think that means you expect a tab in the multibranch Pipeline for tags. Then you mention that the master branch is struck out. Then in a later comment you mention that the pull request branch is struck out. You're leaving me guessing to understand your desired result and the actual result. The precise configuration is also not described, so I'm guessing precise configuration as well.

          Please describe exactly how the job is configured (preferably with the config.xml file from the multibranch Pipeline job), details of what you were expecting to see, and details of what you actually saw. At this point, I'm prone to say this is a user error rather than a bug. However, without the details, I can't be sure.

          Mark Waite added a comment - Collaborator permission is checked to decide if changes to the Pipeline (in the Jenkinsfile) should be evaluated as part of the pull request or if the Jenkinsfile from the destination branch is used when evaluating the pull request. I would not expect the lack of collaborator permissions to prevent detection and enablement of the pull request. I don't understand what you are expecting to see. You say that you enabled "Discover tags". I think that means you expect a tab in the multibranch Pipeline for tags. Then you mention that the master branch is struck out. Then in a later comment you mention that the pull request branch is struck out. You're leaving me guessing to understand your desired result and the actual result. The precise configuration is also not described, so I'm guessing precise configuration as well. Please describe exactly how the job is configured (preferably with the config.xml file from the multibranch Pipeline job), details of what you were expecting to see, and details of what you actually saw. At this point, I'm prone to say this is a user error rather than a bug. However, without the details, I can't be sure.

          dire straits added a comment -

          Hi Mark,

          Thank you very much for your valuable feedback. 

          What I am expecting right now, is that along with tags, any branches other than master as seen in the Branches tab and the Pull Requests are not struck out. At this point, tags are visible, so it is good. I am wondering if it is possible to see the PR branches and any other branch other than master as well. 

          I don't have a config.xml. In the repository, we have a Jenkinsfile and then in the web UI, I create a multibranch pipeline job and follow the instructions to create/set up.

          I am going to attach the Jenkinsfile as an attachment. I have modified three strings (repository name, organization name and a mix of both) but otherwise the file is intact.

          Jenkinsfile

          Thanks again!

           

          dire straits added a comment - Hi Mark, Thank you very much for your valuable feedback.  What I am expecting right now, is that along with tags, any branches other than master as seen in the Branches tab and the Pull Requests are not struck out. At this point, tags are visible, so it is good. I am wondering if it is possible to see the PR branches and any other branch other than master as well.  I don't have a config.xml. In the repository, we have a Jenkinsfile and then in the web UI, I create a multibranch pipeline job and follow the instructions to create/set up. I am going to attach the Jenkinsfile as an attachment. I have modified three strings (repository name, organization name and a mix of both) but otherwise the file is intact. Jenkinsfile Thanks again!  

            Unassigned Unassigned
            direstraits dire straits
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: