Skip to content

Add WebhookProcessor, public API exports, and handler tests#3

Open
Keramikus-97 wants to merge 1 commit into
mainfrom
devin/1780759531-review-implement
Open

Add WebhookProcessor, public API exports, and handler tests#3
Keramikus-97 wants to merge 1 commit into
mainfrom
devin/1780759531-review-implement

Conversation

@Keramikus-97

Copy link
Copy Markdown
Owner

Summary

The repo had all the building blocks (comment parsing, config, GitHub client, webhook handler) but no orchestration layer tying them together, and __init__.py didn't export any public symbols.

New handler.pyWebhookProcessor: End-to-end webhook processing that chains signature verification → parse_rawextract_commands → acknowledgement reaction:

async with WebhookProcessor(config, webhook_secret="optional") as proc:
    result = await proc.process(event_header, body, signature)
    # result.commands  — list[ParsedCommand]
    # result.acknowledged — bool (eyes reaction sent)
    # result.skipped_reason — "" | "invalid_signature" | "unsupported_event" | "no_commands"

Acknowledgement failures (e.g. API 500) are caught and logged so they never bubble up.

__init__.py: Exports all public symbols (Config, GitHubClient, WebhookProcessor, ParsedCommand, etc.) via __all__.

Tests: 9 new tests covering command extraction, signature pass/fail, unsupported events, acknowledge failures, and multi-command payloads.

Note: A CI workflow (.github/workflows/ci.yml) was also prepared locally but could not be pushed due to missing workflow scope on the OAuth token. It runs ruff check/format + pytest --cov across Python 3.10–3.12. You can add it manually or grant the workflow scope.

Link to Devin session: https://app.devin.ai/sessions/306b14b0580b4a1d830a4afc1c2dfd86
Requested by: @Keramikus-97

- Add handler.py with WebhookProcessor that orchestrates the full webhook
  processing flow: signature verification, payload parsing, command
  extraction, and acknowledgement via reaction
- Export all public symbols from __init__.py
- Add comprehensive tests for the handler module (9 tests)
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.

1 participant