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

Default repository permission are not considered

      If the permissions of an user are granted on organization membership rather than team membership. The PR from the user aren't considered trusted. But are considered if the user push directly to the repository.

          [JENKINS-36240] Default repository permission are not considered

          Jesse Glick added a comment -

          Good news: there is a new experimental endpoint which should give us exactly what we need.

          Jesse Glick added a comment - Good news: there is a new experimental endpoint which should give us exactly what we need.

          Jesse Glick added a comment - - edited

          In my experiments, it does work, with one caveat: if the scan token does not have administrative permission on the repository, the result is a 404. Which means that JENKINS-37608 is not satisfiable without loss of functionality.

          Jesse Glick added a comment - - edited In my experiments, it does work, with one caveat: if the scan token does not have administrative permission on the repository, the result is a 404. Which means that JENKINS-37608 is not satisfiable without loss of functionality.

          Jesse Glick added a comment -

          A 403 is also possible in certain cases.

          Jesse Glick added a comment - A 403 is also possible in certain cases.

          Jesse Glick added a comment -

          API is now official it seems.

          Jesse Glick added a comment - API is now official it seems.

          Michael Neale added a comment -

          Status: https://github.com/jenkinsci/github-branch-source-plugin/pull/148 is basically approved by Jesse (had one bit of feedback for a field that should not be configurable). 

          What is missing:

          • testing with GH .com . Could have mock (possibly live? but very very expensive to test) 
          • Verifying if GHE can do this, or not yet? 

           

          Michael Neale added a comment - Status: https://github.com/jenkinsci/github-branch-source-plugin/pull/148  is basically approved by Jesse (had one bit of feedback for a field that should not be configurable).  What is missing: testing with GH .com . Could have mock (possibly live? but very very expensive to test)  Verifying if GHE can do this, or not yet?   

          Michael Neale added a comment -

          abayer thought this may make sense in a future queue for you - at a juncture that makes sense (no urgency). 

          We have confirmed (but not tested) that this should work just fine with GHE (at least newer version) - so that bit is ok, but what we don't have is a strategy to test this. I know vivek has some experience in mocking various github things with reasonable effect to test, so that would be worth considering before merging this. 

          If automated testing is really not possible, then at least a documented test scenario in the README or something would help (and obviously trying it out) - and then the "poor implementation" could be merged in IMO. 

          Sound ok? 

          Michael Neale added a comment - abayer thought this may make sense in a future queue for you - at a juncture that makes sense (no urgency).  We have confirmed (but not tested) that this should work just fine with GHE (at least newer version) - so that bit is ok, but what we don't have is a strategy to test this. I know vivek has some experience in mocking various github things with reasonable effect to test, so that would be worth considering before merging this.  If automated testing is really not possible, then at least a documented test scenario in the README or something would help (and obviously trying it out) - and then the "poor implementation" could be merged in IMO.  Sound ok? 

          Code changed in jenkins
          User: Stephen Connolly
          Path:
          src/main/java/org/jenkinsci/plugins/github_branch_source/ForkPullRequestDiscoveryTrait.java
          src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java
          src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSourceRequest.java
          src/main/resources/org/jenkinsci/plugins/github_branch_source/ForkPullRequestDiscoveryTrait/TrustPermission/config.jelly
          src/main/resources/org/jenkinsci/plugins/github_branch_source/ForkPullRequestDiscoveryTrait/TrustPermission/help-permission.html
          src/main/resources/org/jenkinsci/plugins/github_branch_source/ForkPullRequestDiscoveryTrait/help-trust.html
          src/main/resources/org/jenkinsci/plugins/github_branch_source/Messages.properties
          http://jenkins-ci.org/commit/github-branch-source-plugin/c10b23bbe37efca325340c5ac65d6876d3fe7684
          Log:
          JENKINS-36240 Initial stab at rework

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: src/main/java/org/jenkinsci/plugins/github_branch_source/ForkPullRequestDiscoveryTrait.java src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSourceRequest.java src/main/resources/org/jenkinsci/plugins/github_branch_source/ForkPullRequestDiscoveryTrait/TrustPermission/config.jelly src/main/resources/org/jenkinsci/plugins/github_branch_source/ForkPullRequestDiscoveryTrait/TrustPermission/help-permission.html src/main/resources/org/jenkinsci/plugins/github_branch_source/ForkPullRequestDiscoveryTrait/help-trust.html src/main/resources/org/jenkinsci/plugins/github_branch_source/Messages.properties http://jenkins-ci.org/commit/github-branch-source-plugin/c10b23bbe37efca325340c5ac65d6876d3fe7684 Log: JENKINS-36240 Initial stab at rework

          Code changed in jenkins
          User: Stephen Connolly
          Path:
          src/main/java/org/jenkinsci/plugins/github_branch_source/ForkPullRequestDiscoveryTrait.java
          src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubPermissionsSource.java
          src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java
          src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSourceRequest.java
          http://jenkins-ci.org/commit/github-branch-source-plugin/3299bf5834078047e8461b3c53bf28c5115d3ff5
          Log:
          [FIXED JENKINS-36240] Full implementation

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: src/main/java/org/jenkinsci/plugins/github_branch_source/ForkPullRequestDiscoveryTrait.java src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubPermissionsSource.java src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSourceRequest.java http://jenkins-ci.org/commit/github-branch-source-plugin/3299bf5834078047e8461b3c53bf28c5115d3ff5 Log: [FIXED JENKINS-36240] Full implementation

          2.2.2

          Stephen Connolly added a comment - 2.2.2

            stephenconnolly Stephen Connolly
            escoem Emilio Escobar
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: