Skip to content

AOR-106: Add webhook pipeline action to bridge-sdk#18

Merged
freddie-poolsideai merged 23 commits intomainfrom
freddie/aor-106-bridge-pipeline-webhooks-3-bridge-sdk-webhook-class
Mar 13, 2026
Merged

AOR-106: Add webhook pipeline action to bridge-sdk#18
freddie-poolsideai merged 23 commits intomainfrom
freddie/aor-106-bridge-pipeline-webhooks-3-bridge-sdk-webhook-class

Conversation

@freddie-poolsideai
Copy link
Copy Markdown
Contributor

@freddie-poolsideai freddie-poolsideai commented Feb 19, 2026

Summary

  • Adds WebhookPipelineAction model — a provider-agnostic webhook action that references endpoints configured in Console by name
  • Webhook actions use CEL expressions for filtering (on) and payload transformation (transform)
  • Adds cel-python dependency for CEL syntax validation at model instantiation time
  • Adds webhooks field to Pipeline and PipelineData, included in DSL output
  • Enforces uniqueness constraint on (webhook_endpoint, name) pairs per pipeline
  • Exports WebhookPipelineAction from bridge_sdk

New packages

  • cel-python>=0.5.0 — CEL expression parsing/validation (pure Python, cross-platform)
    • Transitive: google-re2, jmespath, lark, pendulum, python-dateutil, six, tzdata

Note on CEL library choice: We use cel-python (Cloud Custodian) rather than Google's recently open-sourced cel-expr-python because cel-expr-python wraps the C++ CEL implementation and requires native build tooling. cel-python is pure Python and works everywhere with no build dependencies.

Changed files

File Change
bridge_sdk/models.py New WebhookPipelineAction Pydantic model with CEL validation
bridge_sdk/pipeline.py webhooks param on Pipeline, uniqueness check, PipelineData.webhooks field
bridge_sdk/__init__.py Export WebhookPipelineAction
bridge_sdk/cli.py Include webhooks in DSL output
pyproject.toml / uv.lock Add cel-python dependency
tests/test_pipeline.py 278 lines of new tests (model, serialization, uniqueness, CEL validation, DSL output)
examples/webhook_example.py Multi-provider example (Linear + GitHub)
examples/webhook_generic_example.py Custom monitoring service example
README.md Webhook documentation and usage examples
skills/bridge-pipelines/SKILL.md Webhook section for bridge-pipeline skill

Test plan

  • All existing + new tests pass (uv run pytest -v)
  • Webhook model tests: creation, serialization, Pipeline integration, PipelineData serialization, DSL output, repr
  • Uniqueness constraint tests: duplicate rejected, same-name-different-endpoint allowed, same-endpoint-different-name allowed
  • CEL validation tests: valid expressions accepted, syntax errors rejected, model-level validation on on and transform

Closes AOR-106

🤖 Generated with Claude Code

Introduces Webhook model (name, provider, filter_expression,
transform_expression, idempotency_key_expression) and WebhookProvider
constants. Adds webhooks field to Pipeline and PipelineData, and
passes them through in the DSL output.
Tests Webhook model, WebhookProvider constants, Pipeline with webhooks,
PipelineData serialization, DSL output format, and repr.
Adds Webhooks section documenting Webhook class, WebhookProvider
constants, CEL expressions, and available providers.
…ion to filter/transform/idempotency_key

Shorter kwarg names to match the RFC. Added model_validator to reject
idempotency_key for non-generic HMAC providers.
Comment thread bridge_sdk/models.py Outdated
Comment thread bridge_sdk/models.py Outdated
Generic providers (generic_*) now require idempotency_key. Named providers
reject it. Validator uses startswith('generic_') for future extensibility.
@freddie-poolsideai freddie-poolsideai marked this pull request as ready for review February 20, 2026 15:22
Comment thread bridge_sdk/models.py
Comment thread skills/bridge-pipelines/SKILL.md Outdated
Copy link
Copy Markdown
Collaborator

@tkpoolside tkpoolside left a comment

Choose a reason for hiding this comment

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

Let's update README and add some examples

freddie-poolsideai and others added 9 commits February 23, 2026 10:49
Add Webhooks section to README covering named and generic providers,
CEL filter/transform/idempotency_key expressions, and provider list.
Update API Reference with Webhook and WebhookProvider imports.

Add two example files:
- webhook_example.py: Linear and GitHub triggers with agent triage
- webhook_generic_example.py: generic HMAC provider with idempotency key
Vary branch values across webhooks (main, production, staging) to
show that branch controls which version of the pipeline code runs.
Add inline comments explaining the branch field in examples, README,
and SKILL.md.
The webhook branch field determines where the webhook is discovered
(indexed) from and which version of the pipeline code runs when it
fires. Previous wording only mentioned the execution side.
…e-pipeline-webhooks-3-bridge-sdk-webhook-class
…ction

The updated RFC (PID034) makes webhook endpoints provider-agnostic —
signature verification, secrets, and idempotency are configured in
Console. The SDK now only declares pipeline actions that reference
endpoints by name.

- Remove WebhookProvider class and Webhook model
- Add WebhookPipelineAction with fields: name, branch, webhook_endpoint,
  on (CEL filter), transform
- Remove provider, filter, idempotency_key fields and model validator
- Update exports, examples, tests, README, and SKILL.md

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Validate (webhook_endpoint, pipeline, name) uniqueness at Pipeline
  construction time
- Order keyword arguments as: name first, then alphabetical
  (branch, on, transform, webhook_endpoint) across all call sites
- Add tests for duplicate rejection and allowed combinations

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…e-pipeline-webhooks-3-bridge-sdk-webhook-class
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Validate `on` and `transform` CEL expressions at model instantiation
time using cel-python. The CEL environment declares `payload` (dynamic)
and `headers` (map) matching the runtime webhook context.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@freddie-poolsideai freddie-poolsideai changed the title AOR-106: Add Webhook class and WebhookProvider to bridge-sdk AOR-106: Add webhook pipeline action to bridge-sdk Mar 13, 2026
Use List with default_factory instead of Optional[None] so both types
consistently default to an empty list.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@freddie-poolsideai freddie-poolsideai requested review from tkpoolside and removed request for agoddijn-ps and andreibratu March 13, 2026 14:36
freddie-poolsideai and others added 2 commits March 13, 2026 14:36
Split the single fetch_issue step into fetch_issue (Linear) and fetch_pr
(GitHub), each with optional inputs. Transform expressions now provide
input to both DAG root steps, with an empty object for the inactive path
so the step returns None. The shared triage_item step picks whichever
source produced data.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
PipelineData.webhooks now defaults to [] instead of None, so update the
test assertion accordingly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment thread bridge_sdk/cli.py Outdated
Comment thread tests/test_pipeline.py Outdated
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@freddie-poolsideai freddie-poolsideai merged commit a0f0919 into main Mar 13, 2026
6 checks passed
@freddie-poolsideai freddie-poolsideai deleted the freddie/aor-106-bridge-pipeline-webhooks-3-bridge-sdk-webhook-class branch March 13, 2026 15:07
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.

3 participants