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

Stack trace printed when repo:status privilege missing

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      If you build a pull request yet your scan credentials lack the notifications privilege, you get an ugly stack trace along the lines of

      ERROR: Could not update commit status
      java.io.FileNotFoundException: {"message":"Not Found","documentation_url":"..."}
      	at org.kohsuke.github.Requester.handleApiError(Requester.java:527)
      	at org.kohsuke.github.Requester._to(Requester.java:257)
      	at org.kohsuke.github.Requester.to(Requester.java:203)
      	at org.kohsuke.github.GHRepository.createCommitStatus(GHRepository.java:854)
      	at org.jenkinsci.plugins.github_branch_source.GitHubBuildStatusNotification.createCommitStatus(GitHubBuildStatusNotification.java:78)
      	at ...
      Caused by: java.io.FileNotFoundException: .../api/v3/repos/.../.../statuses/...
      	at ...
      	at org.kohsuke.github.Requester.parse(Requester.java:483)
      	at org.kohsuke.github.Requester._to(Requester.java:236)
      ... 17 more
      Caused by: java.io.FileNotFoundException: ...
      	at ...
      	at org.kohsuke.github.Requester.parse(Requester.java:479)
      ... 18 more
      

      Since this is a fairly predictable user error (or the user might even have just decided to deny this permission), it would be more appropriate to catch FileNotFoundException here and print a one-line warning to the build log saying that the commit status notification could not be sent, and leave it at that. (For diagnostic purposes the full exception could be logged at FINE.)

        Attachments

          Issue Links

            Activity

            Hide
            recena Manuel Recena Soto added a comment -

            Patrick Wolf, I hope so it. After JENKINS-31162.

            Show
            recena Manuel Recena Soto added a comment - Patrick Wolf , I hope so it. After JENKINS-31162 .
            Hide
            recena Manuel Recena Soto added a comment -

            Sent a PR.

            Show
            recena Manuel Recena Soto added a comment - Sent a PR.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: recena
            Path:
            src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubBuildStatusNotification.java
            src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java
            http://jenkins-ci.org/commit/github-branch-source-plugin/25cab343d6dc5dc8a5ee083886bf4c6ac5b29210
            Log:
            JENKINS-33306 Stack trace printed when repo:status privilege missing

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: recena Path: src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubBuildStatusNotification.java src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java http://jenkins-ci.org/commit/github-branch-source-plugin/25cab343d6dc5dc8a5ee083886bf4c6ac5b29210 Log: JENKINS-33306 Stack trace printed when repo:status privilege missing
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Manuel Recena
            Path:
            src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java
            http://jenkins-ci.org/commit/github-branch-source-plugin/635ee19b3e006724248f72bb57e6bbbf50274bc2
            Log:
            JENKINS-33306 Better in a separated PR

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Manuel Recena Path: src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java http://jenkins-ci.org/commit/github-branch-source-plugin/635ee19b3e006724248f72bb57e6bbbf50274bc2 Log: JENKINS-33306 Better in a separated PR
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Manuel Recena
            Path:
            src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubBuildStatusNotification.java
            http://jenkins-ci.org/commit/github-branch-source-plugin/09f4e93fac21b9bb7262303673ad07a969d3e491
            Log:
            Merge pull request #40 from recena/JENKINS-33306

            JENKINS-33306 Stack trace printed when repo:status privilege missing

            Compare: https://github.com/jenkinsci/github-branch-source-plugin/compare/3b18c1acbebb...09f4e93fac21

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Manuel Recena Path: src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubBuildStatusNotification.java http://jenkins-ci.org/commit/github-branch-source-plugin/09f4e93fac21b9bb7262303673ad07a969d3e491 Log: Merge pull request #40 from recena/ JENKINS-33306 JENKINS-33306 Stack trace printed when repo:status privilege missing Compare: https://github.com/jenkinsci/github-branch-source-plugin/compare/3b18c1acbebb...09f4e93fac21

              People

              • Assignee:
                recena Manuel Recena Soto
                Reporter:
                jglick Jesse Glick
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: