Add Bitbucket Data Center automation event source#137
Conversation
|
🚀 Deploy Preview PR Created/Updated A deploy preview has been created/updated for this PR. Deploy PR: https://github.com/OpenHands/deploy/pull/4403 Once the deploy PR's CI passes, the automation service will be deployed to the feature environment. |
all-hands-bot
left a comment
There was a problem hiding this comment.
🟢 Good taste - Clean, well-tested implementation that follows established patterns.
This PR adds Bitbucket Data Center webhook support by:
- Implementing event parsing that mirrors the Jira DC pattern exactly
- Registering it as a reserved built-in source alongside GitHub and Jira DC
- Providing comprehensive test coverage (unit, integration, and E2E)
The implementation is simple, focused, and well-tested. The PR description includes solid E2E validation evidence with specific run IDs and sandbox IDs.
[RISK ASSESSMENT]
- [Overall PR]
⚠️ Risk Assessment: 🟢 LOW
Changes are isolated to a new event source, follow established patterns exactly (Jira DC template), have comprehensive test coverage, no breaking changes, and were E2E validated with real Bitbucket DC webhooks.
VERDICT:
✅ Worth merging: Solid implementation ready to ship.
KEY INSIGHT:
Exemplary use of the template method pattern - reuses WebhookEvent infrastructure while cleanly isolating Bitbucket DC-specific event key extraction.
Was this automated review useful? React with 👍 or 👎 to this review to help us measure review quality.
Workflow run: https://github.com/OpenHands/automation/actions/runs/26318094470
Summary
bitbucket_data_centerautomation event parser keyed by Bitbucket DCeventKeybitbucket_data_centeras a built-in source and wire it to the shared automation webhook secretTest plan
env PYTHONPATH=. uv run ruff format --check openhands/automation/event_schemas/__init__.py openhands/automation/event_schemas/bitbucket_data_center.py openhands/automation/schemas.py openhands/automation/utils/webhook.py tests/test_event_router.py tests/test_event_schemas.py tests/test_webhook_router.pyenv PYTHONPATH=. uv run ruff check openhands/automation/event_schemas/__init__.py openhands/automation/event_schemas/bitbucket_data_center.py openhands/automation/schemas.py openhands/automation/utils/webhook.py tests/test_event_router.py tests/test_event_schemas.py tests/test_webhook_router.pyenv PYTHONPATH=. uv run pytest tests/test_event_schemas.py tests/test_webhook_router.py -q(84 passed)pr:opened,repo:refs_changed,pr:comment:added, andpr:reviewer:approved.pr:reviewer:approvedcreated automation runef186555-53b0-4830-a7b9-6f83a5b49087, dispatched sandbox5oJ2T2breoJ4ZKZ15Q5Sb8, and completed successfully with no error.Note: I did not run the DB-backed
tests/test_event_router.pymodule locally because this environment does not have Docker/Testcontainers available; CI should cover it.