Skip to content
Edit this page View source of this page

Kanban Sentry

Sentry issue sync for the Kanban board.

This plugin is hooks-only and contributes no agent tools. Install it alongside pegg-kanban.

Install

pegg plugins install peggco/pegg-kanban
pegg plugins install peggco/pegg-kanban-sentry

Setup

The plugin talks to the Sentry REST API with a bearer token.

  1. Create a Sentry auth token with project:read (and event:write for comments, event:admin to resolve) at https://sentry.io/settings/account/api/auth-tokens/.
  2. Add the plugin options to ~/.pegg/pegg.json:
{
  "plugins": {
    "options": {
      "kanban-sentry": {
        "enabled": true,
        "base_url": "https://sentry.io/api/0",
        "token": "sntrys_...",
        "organization": "acme",
        "project": "backend",
        "default_query": "is:unresolved",
        "sync_limit": 25,
        "change_request_provider": "github",
        "contact": true,
        "resolve_on_success": false,
        "request_timeout_seconds": 30
      }
    }
  }
}

For self-hosted Sentry set base_url to https://sentry.example.com/api/0.

The preferred option keys are kanban-sentry and pegg-kanban-sentry. The legacy sentry and pegg-sentry keys are read as fallbacks.

Setting Meaning
token Sentry auth token, sent as Authorization: Bearer.
base_url Sentry API base URL.
organization Organization slug.
project Project slug.
default_query Sentry issue search query. Default is:unresolved.
sync_limit Maximum issues per sync. Default 25.
change_request_provider Change-request target for Sentry issues. Default github.
contact Post the run summary as a Sentry comment. Default true.
resolve_on_success Mark the Sentry issue resolved after a successful run.

Environment overrides:

Variable Meaning
PEGG_SENTRY_OPTIONS JSON options object
PEGG_SENTRY_TOKEN Sentry auth token
PEGG_SENTRY_BASE_URL Sentry API base URL
PEGG_SENTRY_ORG Organization slug
PEGG_SENTRY_PROJECT Project slug
PEGG_SENTRY_QUERY Default issue query
PEGG_SENTRY_SYNC_LIMIT Maximum issues per sync
PEGG_SENTRY_CHANGE_REQUEST_PROVIDER Default change-request target
PEGG_SENTRY_TIMEOUT_SECONDS Request timeout
PEGG_SENTRY_DISABLED 1 or true disables the hooks

Hooks

Provider id: sentry.

Hook Kind Priority Purpose
kanban.providers filter 10 Advertise Sentry as an issue provider.
kanban.issues.fetch filter 10 Fetch Sentry issues for Kanban sync.
kanban.change_request.routes filter 10 Route Sentry issues to the default change-request provider.
kanban.card.succeeded action 10 Comment on and resolve the Sentry issue when a card succeeds.

A disabled plugin, an unknown hook, or a request for another provider returns handled: false without an error.

Issue sync

kanban.issues.fetch accepts {provider,target,labels,state,limit,query,issues}. Only provider: "sentry" is handled. target is organization/project; when absent it falls back to the configured organization and project.

Issues are appended with external_id, number (internal id), key (short id), title, body (culprit, level and event count), url (permalink), labels (level and unhandled), state, priority, and timestamps.

Card success

kanban.card.succeeded handles cards whose card.issue.provider is sentry. The issue's internal id is card.issue.number.

  • With contact and feedback, the run summary is posted as a Sentry comment.
  • With resolve_on_success, the issue is marked resolved.
  • The result is {key,commented,resolved}.

Change-request routing

Sentry is an issue source, not a git host. This plugin contributes the default route {"sentry": "<change_request_provider>"} (default github), so a resolved Sentry issue opens a GitHub pull request. The user routing map always wins:

{
  "plugins": {
    "options": {
      "kanban": {
        "change_request_providers": {"sentry": "gitlab"}
      }
    }
  }
}

Notes

  • Sentry is not a repo target, so it can sync without a git repository.
  • The pull request is opened by the resolved change-request provider (for example kanban-github), which also prepares the worktree.
  • Tokens are never printed or returned; errors are redacted.