Skip to content

feat(pagerduty): add client and client_url support for Events API v2#6241

Open
jyoti369 wants to merge 2 commits intokeephq:mainfrom
jyoti369:feat/pagerduty-event-api-client
Open

feat(pagerduty): add client and client_url support for Events API v2#6241
jyoti369 wants to merge 2 commits intokeephq:mainfrom
jyoti369:feat/pagerduty-event-api-client

Conversation

@jyoti369
Copy link
Copy Markdown
Contributor

@jyoti369 jyoti369 commented Apr 11, 2026

What

Add optional client and client_url parameters to the PagerDuty Events API v2 integration, per the Events API v2 spec.

These fields allow a clickable "View in [client]" link to appear in PagerDuty event details.

Why

The current Events API implementation is missing client and client_url attributes. Without them, events created via Keep don't show the monitoring client link in PagerDuty.

Changes

  • Added client and client_url as optional named parameters in _notify, _send_alert, and _build_alert
  • Both fields are placed at the top level of the event payload (not inside payload.payload), matching the API spec
  • Added unit tests covering:
    • client/client_url included when provided
    • client/client_url omitted when not provided
    • Full payload structure validation

Usage in workflows

actions:
  - name: pagerduty-alert
    provider:
      type: pagerduty
      config: "{{ providers.pagerduty }}"
    with:
      title: "CPU at 99%"
      severity: critical
      client: "Keep"
      client_url: "https://keep.example.com/alerts/123"

Closes #6233

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. Feature A new feature Provider Providers related issues labels Apr 11, 2026
@jyoti369 jyoti369 force-pushed the feat/pagerduty-event-api-client branch from af1d6f9 to 564c227 Compare April 12, 2026 06:28
@cursor
Copy link
Copy Markdown

cursor bot commented Apr 12, 2026

You have used all of your free Bugbot PR reviews.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Apr 12, 2026
Add optional client and client_url parameters to the PagerDuty Events API v2
payload, allowing users to configure a clickable link in PagerDuty events.

Closes keephq#6233
@jyoti369 jyoti369 force-pushed the feat/pagerduty-event-api-client branch from 564c227 to c3a1f1f Compare April 12, 2026 06:57
@jyoti369
Copy link
Copy Markdown
Contributor Author

Unit test failure is unrelated to this PR - it's a flaky SQLite locking error during teardown in test_workflow_keep_notify_after_foreach:

sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) database table is locked
[SQL: DROP TABLE workflowtoincidentexecution]

938 tests passed, only this one errored due to SQLite concurrency. Could you re-run the failing check?

@jyoti369 jyoti369 requested a review from shahargl April 12, 2026 08:15
@jyoti369
Copy link
Copy Markdown
Contributor Author

@shahargl The images/links placement has been reverted back to the original nesting inside payload["payload"] as you requested. The PR now only adds the new client and client_url fields at top level (which is correct per the PagerDuty Events API v2 spec). All CI checks are green. Ready for re-review when you get a chance.

@bbcorp
Copy link
Copy Markdown
Contributor

bbcorp commented Apr 13, 2026

lgtm
Hey @shahargl can you have a look and confirm it looks good to you too please?

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

Labels

Feature A new feature Provider Providers related issues size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[➕ Feature]: [PagerDuty Provider] Fully support Event API

3 participants