Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix call to test a webhook method #915

Merged
merged 2 commits into from
Oct 24, 2020
Merged

Conversation

morrislaptop
Copy link
Contributor

@morrislaptop morrislaptop commented Aug 2, 2020

See renamed URL in the note at https://docs.github.com/en/rest/reference/repos#test-the-push-repository-webhook

Using old URL gives an error "Resource not accessible by integration"

@GrahamCampbell
Copy link
Contributor

Interesting. Are you calling this from a "GitHub app" or an "OAuth app". Do you know what version of GitHub Enterprise supports the new endpoint. Changing this could break things for those users.

@morrislaptop
Copy link
Contributor Author

morrislaptop commented Aug 3, 2020 via email

@acrobat
Copy link
Collaborator

acrobat commented Aug 11, 2020

I think we can safely apply this change, as in the github enterprise 2.18 docs the endpoint url is also like the note indicates

{
   "/repos/{owner}/{repo}/hooks/{hook_id}/tests":{
      "post":{
         "summary":"Test the push repository webhook",
         "description":"This will trigger the hook with the latest push to the current repository if the hook is subscribed to `push` events. If the hook is not subscribed to `push` events, the server will respond with 204 but no test POST will be generated.\n\n**Note**: Previously `/repos/:owner/:repo/hooks/:hook_id/test`",
         "tags":[
            "repos"
         ],
         "operationId":"repos/test-push-webhook",
         "externalDocs":{
            "description":"API method documentation",
            "url":"https://developer.github.com/enterprise/2.18/v3/repos/hooks/#test-the-push-repository-webhook"
         },
         "parameters":[
            {
               "$ref":"#/components/parameters/owner"
            },
            {
               "$ref":"#/components/parameters/repo"
            },
            {
               "$ref":"#/components/parameters/hook-id"
            }
         ],
         "responses":{
            "204":{
               "description":"Empty response"
            },
            "404":{
               "$ref":"#/components/responses/not_found"
            }
         },
         "x-github":{
            "githubCloudOnly":false,
            "enabledForGitHubApps":true,
            "previews":[

            ]
         }
      }
   }
}

https://github.com/github/rest-api-description/blob/main/descriptions/ghes-2.18/ghes-2.18.json

What do you think @GrahamCampbell?

@acrobat acrobat merged commit 25f9206 into KnpLabs:2.x Oct 24, 2020
@acrobat
Copy link
Collaborator

acrobat commented Oct 24, 2020

Thanks @morrislaptop! And congrats on your first contribution! 🎉

acrobat added a commit that referenced this pull request Nov 7, 2020
* 2.x:
  Fix bc break in check api class
  Switch CI setup from travisci to github actions
  Adding GitHub authentication to GraphQL documentation
  bug #915 Fix call to test a webhook method (morrislaptop)
  Remove antiope preview header as checks api is now stable
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