• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • gitea-plugin
    • None
    • Gitea 1.17.2
      Jenkins 2.361.1
      Gitea Plugin 1.4.3

      Jenkins scans regularly the multibranch pipelines.

      This scan fails if within a repository exists a pull request from a personal fork:

        Checking pull request #5042
            ‘Jenkinsfile’ found
          Met criteria
      No changes detected: PR-5042 (still at f28e872c1c0e9c2afc1dfd902ccd4beb046b3b84+683a03dc45583ec40ab8d08d58d0cd5c29addddd)
      
        Checking pull request #5041
      ERROR: [Tue Sep 27 23:03:29 CEST 2022] Could not fetch branches from source org.jenkinsci.plugin.gitea.GiteaSCMNavigator::https://gitea.boom.org::bangorg::bimrepo
      [Tue Sep 27 23:03:29 CEST 2022] Finished branch indexing. Indexing took 29 sec
      FATAL: Failed to recompute children of MultiBranchPipelineName » bimrepo
      org.jenkinsci.plugin.gitea.client.api.GiteaHttpStatusException: HTTP 404/Not Found
      	at org.jenkinsci.plugin.gitea.client.impl.DefaultGiteaConnection.getObject(DefaultGiteaConnection.java:867)
      	at org.jenkinsci.plugin.gitea.client.impl.DefaultGiteaConnection.fetchRepository(DefaultGiteaConnection.java:200)
      	at org.jenkinsci.plugin.gitea.GiteaSCMFileSystem$BuilderImpl.build(GiteaSCMFileSystem.java:170)
      	at org.jenkinsci.plugin.gitea.GiteaSCMSource.createProbe(GiteaSCMSource.java:620)
      	at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:339)
      	at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:249)
      	at org.jenkinsci.plugin.gitea.GiteaSCMSource.retrieve(GiteaSCMSource.java:386)
      	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:107)
      	at hudson.model.Executor.run(Executor.java:449)
      Finished: FAILURE
      

          [JENKINS-69719] Jenkins scan of Gitea fails on PRs from forks

          Javier added a comment -

          Try to give admin rights to the user you're using from Jenkins to access Gitea.

          This fixed a similar issue to me.

          Javier added a comment - Try to give admin rights to the user you're using from Jenkins to access Gitea. This fixed a similar issue to me.

          m l added a comment -

          jvilarroig : thanx for the hint

          It works, but IMHO this is a dirty workaround, since it is a security flaw.

          I think the correct solution should be to omit scanning personal repositories.

          m l added a comment - jvilarroig : thanx for the hint It works, but IMHO this is a dirty workaround, since it is a security flaw. I think the correct solution should be to omit scanning personal repositories.

          Marc Becker added a comment -

          The other dirty workaround is adding a read-only (Jenkins) account to any repository where a pull request may originate from.

          The issue here is trying to pull data from a pull request origin:
          GiteaSCMFileSystem.build() -> ((PullRequestSCMHead) head).getOriginOwner())

          The data already exists in the target repo and should be accessed there.
          Differentiation between Branch and PR likely makes no sense in a Gitea context…

          Marc Becker added a comment - The other dirty workaround is adding a read-only (Jenkins) account to any repository where a pull request may originate from. The issue here is trying to pull data from a pull request origin: GiteaSCMFileSystem.build() -> ((PullRequestSCMHead) head).getOriginOwner()) The data already exists in the target repo and should be accessed there. Differentiation between Branch and PR likely makes no sense in a Gitea context…

          Marc Becker added a comment -

          Potential attempt to use accessible Gitea PR data source gitea-plugin PR 76.

          Marc Becker added a comment - Potential attempt to use accessible Gitea PR data source gitea-plugin PR 76 .

          Steven added a comment -

          Steven added a comment - https://github.com/jenkinsci/gitea-plugin/pull/67

            Unassigned Unassigned
            mrlov m l
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: