Skip to content

docs(github-app): webhook correction - #301

Merged
bitwiseman merged 1 commit into
jenkinsci:masterfrom
hutson:patch-1
May 29, 2020
Merged

bitwiseman merged 1 commit into
jenkinsci:masterfrom
hutson:patch-1

Conversation

@hutson

@hutson hutson commented May 7, 2020

Copy link
Copy Markdown
Contributor

Update GitHub App documentation to reflect that a GitHub App already has a built-in webhook that does not require creating a new webhook using the Webhook permission. Furthermore, to take advantage of that built-in webhook, events must be enabled on the App's Permissions page.

Otherwise, if you wanted to use a separate webhook created by Jenkins using the credentials of the GitHub App, you would need to enable the Admin permission, or else you would get the following error and no webhook:

Failed to add GitHub webhook for GitHubRepositoryName[host=github.example.com,username=test,repository=test]
java.lang.NullPointerException: There are no credentials with admin access to manage hooks on GitHubRepositoryName[host=github.example.com,username=test,repository=test]
	at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:231)
	at org.jenkinsci.plugins.github.webhook.WebhookManager$2.applyNullSafe(WebhookManager.java:179)
	at org.jenkinsci.plugins.github.webhook.WebhookManager$2.applyNullSafe(WebhookManager.java:175)

Description

A brief summary describing the changes in this pull request. See
JENKINS-XXXXX for further information.

Submitter checklist

  • Link to JIRA ticket in description, if appropriate.
  • Change is code complete and matches issue description
  • Automated tests have been added to exercise the changes
  • Reviewer's manual test instructions provided in PR description. See Reviewer's first task below.

Reviewer checklist

  • Run the changes and verify that the change matches the issue description
  • Reviewed the code
  • Verified that the appropriate tests have been written or valid explanation given

Documentation changes

  • Link to jenkins.io PR, or an explanation for why no doc changes are needed

Users/aliases to notify

Update GitHub App documentation to reflect that a GitHub App already has a built-in webhook that does not require creating a new webhook using the _Webhook_ permission. Furthermore, to take advantage of that built-in webhook, events must be enabled on the App's _Permissions_ page.

Otherwise, if you wanted to use a separate webhook created by Jenkins using the credentials of the GitHub App, you would need to enable the _Admin_ permission, or else you would get the following error and no webhook:

```
Failed to add GitHub webhook for GitHubRepositoryName[host=github.example.com,username=test,repository=test]
java.lang.NullPointerException: There are no credentials with admin access to manage hooks on GitHubRepositoryName[host=github.example.com,username=test,repository=test]
	at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:231)
	at org.jenkinsci.plugins.github.webhook.WebhookManager$2.applyNullSafe(WebhookManager.java:179)
	at org.jenkinsci.plugins.github.webhook.WebhookManager$2.applyNullSafe(WebhookManager.java:175)
```
@bitwiseman
bitwiseman requested a review from timja May 28, 2020 22:08

@timja timja left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I think

@hutson
hutson marked this pull request as ready for review May 29, 2020 06:12
@bitwiseman
bitwiseman merged commit dd91d2d into jenkinsci:master May 29, 2020
@lifeofguenter

Copy link
Copy Markdown

I am seeing still the error though. It seems like the plugin is trying to register a webhook even though it is not needed with github app?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants