Update Web service to listen to all events by elskwid · Pull Request #712 · github/github-services · GitHub
Skip to content
This repository was archived by the owner on Jan 31, 2019. It is now read-only.

Update Web service to listen to all events - #712

Closed
elskwid wants to merge 1 commit into
github:masterfrom
elskwid:web-service-events
Closed

Update Web service to listen to all events#712
elskwid wants to merge 1 commit into
github:masterfrom
elskwid:web-service-events

Conversation

@elskwid

@elskwid elskwid commented Oct 19, 2013

Copy link
Copy Markdown

Problem

This updates Services::Web to listen to all system events by default to bring the expected behavior in line with the documentation. From the repo hooks docs (emphasis mine):

For a Hook to go through, the Hook needs to be configured to trigger for an event, and the Service has to listen to it. Most of the Services only listen for push events. However, the generic Web Service listens for all events.

In testing with RequestBin we found the actual behavior of the web service to only listen for push events. This observation is backed up with the JSON hook representation (seen below), where the only event listed is push:

{
    name: "web",
    events: [
        "push"
    ],
    supported_events: [
        "commit_comment",
        "create",
        "delete",
        "download",
        "follow",
        "fork",
        "fork_apply",
        "gist",
        "gollum",
        "issue_comment",
        "issues",
        "member",
        "public",
        "pull_request",
        "pull_request_review_comment",
        "push",
        "status",
        "team_add",
        "watch"
    ],
    schema: [
        [
            "string",
            "url"
        ],
        [
            "string",
            "secret"
        ],
        [
            "string",
            "content_type"
        ],
        [
            "string",
            "ssl_version"
        ],
        [
            "boolean",
            "insecure_ssl"
        ]
    ]
}

Fix

Added Service::ALL_EVENTS as the default_events so the web services would listen for all supported events.

Tests

Expanded test coverage for the types of events that are listened to and a single test for an event other than push.

  • Added a test to ensure the services listens to all events by comparing Service::ALL_EVENTS to the default_events
  • Added an issue test to make sure the payload comes through as expected.

@kdaigle

kdaigle commented Oct 22, 2013

Copy link
Copy Markdown
Member

@elskwid

elskwid commented Oct 22, 2013

Copy link
Copy Markdown
Author

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants