Skip to content

Create Tekton Task/Pipeline for /retest slash commandΒ #3126

@vdemeester

Description

@vdemeester

Parent

Part of #3121 β€” Migrate slash commands from GitHub Actions to dogfooding cluster

Summary

Create a Tekton Pipeline that implements the /retest command, replacing the GitHub Actions workflow _chatops_retest.yml.

Current Behavior (GHA)

The current workflow:

  1. Gets the PR's HEAD commit SHA
  2. Lists all check runs for that commit
  3. For each unique run ID, reruns failed jobs using gh run rerun <id> --failed
  4. Comments on failure, adds πŸŽ‰ reaction on success

Proposed Tekton Implementation

Pipeline Structure

Pipeline: slash-retest
β”œβ”€β”€ Task: retest
β”‚   β”œβ”€β”€ Get PR HEAD commit SHA via gh API
β”‚   β”œβ”€β”€ List check runs for the commit
β”‚   β”œβ”€β”€ Filter to failed runs
β”‚   β”œβ”€β”€ Rerun each failed run via `gh run rerun`
β”‚   └── Add reaction to trigger comment
└── Finally Task: report-status (on failure)
    └── Comment on PR with error details

Key Considerations

  • Simplest of the three: Just API calls, no git operations needed
  • GitHub API only: Uses gh CLI to interact with GHA β€” no repo checkout needed
  • Permission model: The current GHA also allows the PR author to /retest (not just write-access users). The slash routing enforces "write" but the retest workflow itself is more permissive. We may want to keep this behavior.
  • No workspace needed: Just needs a container with gh CLI and the CHATOPS_TOKEN

Webhook Payload Fields Needed

From issue_comment event:

  • body.repository.full_name β€” repo to rerun checks for
  • body.issue.number β€” PR number (to get HEAD SHA)
  • body.issue.pull_request.url β€” PR API URL
  • body.comment.id β€” for adding reaction

Files to Create

  • tekton/ci/slash-commands/retest-pipeline.yaml
  • tekton/ci/slash-commands/retest-trigger.yaml

Acceptance Criteria

  • /retest reruns all failed GHA check runs for the PR's HEAD commit
  • Adds πŸŽ‰ reaction on success
  • Comments on the PR if something goes wrong
  • Handles PRs with no failed runs gracefully

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/dogfoodingIndicates an issue on dogfooding (aka using Pipeline to test Pipeline)

    Type

    No type

    Projects

    Status

    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions