tekton-events-relay

module
v0.1.2-rc.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2026 License: MIT

README ΒΆ

Tekton Events Relay

Stop manually updating CI status across platforms. Automate Tekton pipeline feedback to GitHub, GitLab, Bitbucket, and more.

Production-ready CloudEvents bridge that connects Tekton Pipelines to 6 SCM platforms and 6 notification channels with CEL-based routing, template customization, and enterprise authentication support.


Build Status

CI Go CI Docker CI Helm

Project Info

Artifact Hub Latest Release Go Version License


πŸ“‘ Table of Contents


Key Features

  • Multi-provider Support: 6 SCM platforms, 6 chat & alerting integrations
  • Template-driven: Go templates + CEL filtering for custom workflows
  • Production-ready: HTTP 503 backpressure, deduplication, accumulator pipeline
  • Enterprise-ready: OAuth2 client credentials, self-managed platform support

πŸ” Security & Compliance

All releases are signed with Cosign using keyless OIDC signing. Signatures are stored in the public Sigstore Rekor transparency log.

Verify Docker image signature:

cosign verify \
  --certificate-identity-regexp='https://github.com/fabioluciano/tekton-events-relay' \
  --certificate-oidc-issuer='https://token.actions.githubusercontent.com' \
  ghcr.io/fabioluciano/tekton-events-relay:latest

Verify Helm chart signature:

cosign verify \
  --certificate-identity-regexp='https://github.com/fabioluciano/tekton-events-relay' \
  --certificate-oidc-issuer='https://token.actions.githubusercontent.com' \
  oci://ghcr.io/fabioluciano/charts/tekton-events-relay:latest

πŸ“‹ SLSA Provenance: Build provenance attestations are planned for a future release to provide cryptographic verification of the build process. Track progress in future releases.

πŸ”’ Security issues? Please follow our responsible disclosure policy.


Supported Integrations

SCM Providers
GitHub GitLab Bitbucket Azure DevOps Gitea SourceHut
GitHub GitLab Bitbucket Azure Gitea SourceHut

Enterprise Deployment Support:

  • GitLab: SaaS (gitlab.com) and self-managed instances
  • Bitbucket: Cloud and Server variants
  • GitHub: GitHub.com and GitHub Enterprise Server
  • OAuth2: Client credentials flow for enterprise authentication
Notifiers
Slack Microsoft Teams Discord PagerDuty Datadog Webhooks
Slack Teams Discord PagerDuty Datadog Webhooks
SCM Actions
  • commit_status: Update commit/PR status
  • check_run: Create GitHub check runs (rich UI)
  • pr_comment: Comment on pull requests
  • issue_comment: Comment on issues
  • discussion_comment: Comment on discussions
  • deployment_status: Track environment deployments
  • label: Automatically label PRs and issues

πŸ’‘ Why Use Tekton Events Relay?

Use Case 1: Multi-Platform CI Visibility

Problem: Your team uses GitHub for code but stakeholders check Jira/Azure DevOps for pipeline status.
Solution: Relay updates commit status to GitHub and posts to Azure DevOps work items simultaneously, giving everyone visibility in their preferred tool.

Use Case 2: Smart Failure Notifications

Problem: Developers ignore Slack spam from all pipeline runs.
Solution: Use CEL expressions to send Slack alerts only for production failures: event.Namespace == "production" && event.State == "failure". Development runs stay silent.

Use Case 3: Automated PR Labeling

Problem: Reviewers waste time checking whether PR pipelines passed.
Solution: Automatically apply pipeline::success or pipeline::failed labels to PRs across GitHub, GitLab, and Bitbucket based on pipeline state.


Quickstart

πŸ“‹ Prerequisites: Ensure you have Kubernetes 1.24+, Tekton Pipelines v0.40+, and Helm 3.8+ installed before proceeding.

1. Install Tekton Pipelines (if not already installed)
kubectl apply -f https://storage.googleapis.com/tekton-releases/pipeline/latest/release.yaml
2. Create SCM Provider Secrets

For GitHub:

kubectl create secret generic github-token \
  --namespace tekton-events-relay \
  --from-literal=token="ghp_your_personal_access_token"

For GitLab (Personal Access Token):

kubectl create secret generic gitlab-token \
  --namespace tekton-events-relay \
  --from-literal=token="glpat-your_token"

For GitLab (OAuth2 Client Credentials - Enterprise):

kubectl create secret generic gitlab-oauth2 \
  --namespace tekton-events-relay \
  --from-literal=client_id="your_client_id" \
  --from-literal=client_secret="your_client_secret"
3. Install tekton-events-relay via Helm

GitHub example:

helm install tekton-events-relay \
  oci://ghcr.io/fabioluciano/charts/tekton-events-relay \
  --namespace tekton-events-relay --create-namespace \
  --set config.scm.github[0].enabled=true \
  --set config.scm.github[0].auth.secretName=github-token

GitLab SaaS example:

helm install tekton-events-relay \
  oci://ghcr.io/fabioluciano/charts/tekton-events-relay \
  --namespace tekton-events-relay --create-namespace \
  --set config.scm.gitlab[0].enabled=true \
  --set config.scm.gitlab[0].variant=saas \
  --set config.scm.gitlab[0].base_url=https://gitlab.com/api/v4 \
  --set config.scm.gitlab[0].auth.secretName=gitlab-token

GitLab self-managed with OAuth2:

helm install tekton-events-relay \
  oci://ghcr.io/fabioluciano/charts/tekton-events-relay \
  --namespace tekton-events-relay --create-namespace \
  --set config.scm.gitlab[0].enabled=true \
  --set config.scm.gitlab[0].variant=self-managed \
  --set config.scm.gitlab[0].base_url=https://gitlab.company.example.com/api/v4 \
  --set config.scm.gitlab[0].auth.oauth2.secretName=gitlab-oauth2 \
  --set config.scm.gitlab[0].auth.oauth2.tokenURL=https://gitlab.company.example.com/oauth/token

For full configuration options, see the Installation Guide.

πŸ’‘ Tip: Start with a single SCM provider and add more as needed. All providers can coexist in the same deployment.


πŸ“Š Event Flow

graph LR
    A[Tekton Pipeline] -->|TaskRun/PipelineRun CloudEvent| B[Tekton Events Relay]
    B -->|Parse & Filter| C[CEL Expressions]
    C -->|Route to Handlers| D[SCM Providers]
    C -->|Route to Handlers| E[Chat Notifiers]

    D -->|commit_status| F[GitHub]
    D -->|pr_comment| G[GitLab MR]
    D -->|issue_comment| H[Azure DevOps]

    E -->|Slack| I["πŸ’¬ Chat"]
    E -->|Teams| I
    E -->|Discord| I
    E -->|PagerDuty| J["🚨 Alerts"]
    E -->|Datadog| J
    E -->|Webhook| K["πŸ”— Custom"]

🎯 When to Use Tekton Events Relay

βœ… Use When:
  • Multi-platform teams: Need to update GitHub, GitLab, Bitbucket, and chat tools simultaneously
  • Smart filtering: Want CEL-based conditional routing (e.g., only notify production failures)
  • Template customization: Need Go templates for custom notification formats
  • Event batching: Want to accumulate multiple TaskRun events into a single PR comment
  • Enterprise auth: Require OAuth2 client credentials or self-managed platform support
❌ Don't Use When:
  • Single platform: Only use GitHub and GitHub Actions already handles CI status
  • Native integrations exist: Your SCM has built-in Tekton integration that meets your needs
  • No filtering needed: All events should trigger the same action
πŸ’­ Why Not Just Add Tasks to Your Pipeline?

Without Tekton Events Relay, updating commit status requires:

  • Adding dedicated status-update Tasks to every pipeline
  • Using finally blocks to ensure status updates even on failure
  • Duplicating notification logic across all pipelines
  • Managing credentials and API calls in every pipeline definition

Result: Pipeline pollution. Every pipeline becomes bloated with notification Tasks instead of focusing on build/test/deploy logic.

With Tekton Events Relay:

  • Pipelines stay clean β€” no notification Tasks needed
  • One centralized config handles all status updates
  • CEL expressions route events without touching pipeline code
  • Add/remove integrations without redeploying pipelines
πŸ”₯ Unique Capabilities vs Alternatives
Feature Tekton Events Relay Native Tekton Features Custom Scripts
Multi-SCM simultaneous updates βœ… Built-in ❌ Manual per-platform ⚠️ Must implement
CEL-based event filtering βœ… Built-in ⚠️ Limited ⚠️ Must implement
Event accumulator (batching) βœ… Built-in ❌ Not available ⚠️ Complex to build
Template-driven messages βœ… Go templates ❌ Not available ⚠️ Must implement
OAuth2 enterprise auth βœ… Built-in ❌ Not available ⚠️ Must implement
Production-ready backpressure βœ… HTTP 503 handling ❌ Not available ⚠️ Must implement

Full Documentation

Read the Complete Documentation


Configuration Example

GitHub Commit Status with CEL Filtering

πŸ’‘ Tip: CEL expressions support powerful filtering with startsWith(), endsWith(), contains(), and matches() functions to precisely control when actions trigger.

scm:
  github:
    - name: main-instance
      enabled: true
      auth:
        secret_file: /etc/secrets/github-token
      actions:
        - name: commit-status
          type: commit_status
          enabled: true
          when: 'event.Resource == "pipelinerun" && event.Repo.Owner == "myorg"'
          filter:
            pipelines:
              allow: ["ci-pipeline", "release-pipeline"]
Slack Notifications for Production Failures
notifiers:
  slack:
    - name: production-alerts
      enabled: true
      webhook_url_file: /etc/secrets/slack-webhook
      channel: "#production-alerts"
      when: 'event.Namespace == "production" && event.State == "failure"'
      template: |
        :rotating_light: *PRODUCTION FAILURE*
        *Pipeline:* {{.PipelineName}}
        *Task:* {{.TaskName}}
        *Commit:* `{{.CommitSHA}}`
        {{if .TargetURL}}<{{.TargetURL}}|View Logs>{{end}}

Advanced Features

Pipeline Summary Accumulator

⚑ Performance: Batch multiple TaskRun events into a single PR comment when the PipelineRun completes, reducing notification noise and API rate limit pressure.

accumulator:
  enabled: true
  ttl: 5s
  max_size: 100
CloudEvents Processing

⚠️ Important: When the internal event queue reaches capacity, the service returns HTTP 503 (Service Unavailable) to implement backpressure. Configure queue size based on your expected event volume.

All events are processed as CloudEvents, enabling:

  • Deduplication: Built-in LRU cache (10,000 events default)
  • CEL Expressions: Rich event filtering with startsWith(), endsWith(), contains(), matches()
  • Backpressure: HTTP 503 responses when queue is full
  • OpenTelemetry: Optional distributed tracing integration
Template-driven Customization

πŸ“‹ Note: Go template variables provide access to all event metadata. Use {{.FieldName}} syntax to reference pipeline, run, commit, and repository information in custom messages.

Use Go templates to customize notification messages:

{{.PipelineName}}    // Pipeline name
{{.RunName}}         // Run identifier
{{.State}}           // success, failure, error, running
{{.CommitSHA}}       // Git commit SHA
{{.Namespace}}       // Kubernetes namespace
{{.TargetURL}}       // Link to Tekton Dashboard
{{.Repo.Owner}}      // Repository owner
{{.Repo.Name}}       // Repository name

Architecture

  • Event Listener: CloudEvents webhook endpoint (/)
  • Event Filter: CEL-based conditional routing
  • Action Handlers: Pluggable SCM and notifier implementations
  • Deduplication: LRU cache to prevent duplicate notifications
  • Accumulator: Optional event batching pipeline
  • Metrics: Prometheus-compatible /metrics endpoint

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.


License

This project is licensed under the MIT License β€” see the LICENSE file for details.


Support

Directories ΒΆ

Path Synopsis
cmd
receiver command
Package main provides the tekton-events-relay receiver service that listens for CloudEvents and dispatches notifications to configured destinations.
Package main provides the tekton-events-relay receiver service that listens for CloudEvents and dispatches notifications to configured destinations.
internal
accumulator
Package accumulator provides a concurrent-safe buffer for aggregating TaskRun events by PipelineRun UID, enabling pipeline summary comments.
Package accumulator provides a concurrent-safe buffer for aggregating TaskRun events by PipelineRun UID, enabling pipeline summary comments.
cehttp
Package cehttp provides CloudEvents parsing using the official SDK.
Package cehttp provides CloudEvents parsing using the official SDK.
cel
Package cel provides CEL expression compilation and evaluation against domain.Event.
Package cel provides CEL expression compilation and evaluation against domain.Event.
config
Package config provides configuration loading and management for tekton-events-relay.
Package config provides configuration loading and management for tekton-events-relay.
domain
Package domain defines the neutral event model, independent of any notifier or decoder.
Package domain defines the neutral event model, independent of any notifier or decoder.
errors
Package errors provides error classification and handling utilities.
Package errors provides error classification and handling utilities.
event
Package event defines the types shared between decoders (Strategy) and the registry that resolves which decoder to use for each CloudEvent.
Package event defines the types shared between decoders (Strategy) and the registry that resolves which decoder to use for each CloudEvent.
event/tekton
Package tekton implements the Decoder for CloudEvents emitted by tekton-events-controller.
Package tekton implements the Decoder for CloudEvents emitted by tekton-events-controller.
factory
Package factory provides a generic factory pattern for building ActionHandlers from typed configuration structs, eliminating runtime type assertions.
Package factory provides a generic factory pattern for building ActionHandlers from typed configuration structs, eliminating runtime type assertions.
http
Package http provides the HTTP handler and server for the tekton-events-relay receiver.
Package http provides the HTTP handler and server for the tekton-events-relay receiver.
http/middleware
Package middleware provides HTTP middleware for authentication, rate limiting, and body limits.
Package middleware provides HTTP middleware for authentication, rate limiting, and body limits.
httpx
Package httpx contains HTTP utilities for unified client behavior.
Package httpx contains HTTP utilities for unified client behavior.
logging
Package logging provides zap logger configuration and factory.
Package logging provides zap logger configuration and factory.
metrics
Package metrics provides Prometheus metrics collectors and HTTP middleware.
Package metrics provides Prometheus metrics collectors and HTTP middleware.
notifier
Package notifier defines the common Strategy interface for all notification destinations (SCM, Slack, Teams, Discord, PagerDuty, Datadog, Webhook) and the Registry that resolves which notifiers to call for each event.
Package notifier defines the common Strategy interface for all notification destinations (SCM, Slack, Teams, Discord, PagerDuty, Datadog, Webhook) and the Registry that resolves which notifiers to call for each event.
notifier/datadog
Package datadog implements the Notifier for Datadog via Events API v2.
Package datadog implements the Notifier for Datadog via Events API v2.
notifier/discord
Package discord implements the Notifier for Discord via Webhook.
Package discord implements the Notifier for Discord via Webhook.
notifier/middleware
Package middleware provides reusable handler wrappers for CEL guards and filters.
Package middleware provides reusable handler wrappers for CEL guards and filters.
notifier/pagerduty
Package pagerduty implements the Notifier for PagerDuty via Events API v2.
Package pagerduty implements the Notifier for PagerDuty via Events API v2.
notifier/scm
Package scm provides SCM provider integrations for commit status, comments, and labels.
Package scm provides SCM provider integrations for commit status, comments, and labels.
notifier/scm/azuredevops
Package azuredevops provides Azure DevOps SCM notifier client.
Package azuredevops provides Azure DevOps SCM notifier client.
notifier/scm/bitbucket
Package bitbucket provides Bitbucket Cloud and Server SCM notifier clients.
Package bitbucket provides Bitbucket Cloud and Server SCM notifier clients.
notifier/scm/github
Package github provides GitHub SCM integrations for commit status, check runs, comments, and labels.
Package github provides GitHub SCM integrations for commit status, check runs, comments, and labels.
notifier/scm/gitlab
Package gitlab provides GitLab SCM notifier client.
Package gitlab provides GitLab SCM notifier client.
notifier/scm/oauth2
Package oauth2 provides an OAuth2 client_credentials token client.
Package oauth2 provides an OAuth2 client_credentials token client.
notifier/scm/sourcehut
Package sourcehut provides SourceHut SCM notifier client.
Package sourcehut provides SourceHut SCM notifier client.
notifier/slack
Package slack implements the Notifier for Slack via Incoming Webhooks.
Package slack implements the Notifier for Slack via Incoming Webhooks.
notifier/teams
Package teams implements the Notifier for Microsoft Teams via Incoming Webhooks.
Package teams implements the Notifier for Microsoft Teams via Incoming Webhooks.
notifier/webhook
Package webhook implements a generic Notifier via HTTP.
Package webhook implements a generic Notifier via HTTP.
pipeline
Package pipeline implements Chain of Responsibility for processing CloudEvent events received from Tekton.
Package pipeline implements Chain of Responsibility for processing CloudEvent events received from Tekton.
secrets
Package secrets provides utilities for resolving secret references.
Package secrets provides utilities for resolving secret references.
tracing
Package tracing provides OpenTelemetry distributed tracing setup for tekton-events-relay.
Package tracing provides OpenTelemetry distributed tracing setup for tekton-events-relay.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL