Skip to content

CI-failure comment: fold an aggregate job under the shard that made it fail #3726

Closed

Description

@integry

Scope decision (2026-11-19): the folding described below is not being implemented. Proving that an aggregate job failed only because of a shard needs analysis of what its steps run, which proved too error-prone on #3731. Accepted behavior: every failed job keeps its evidence; a failed job that directly needs another failed job gets a line naming it ("Depends on the failed job(s): …"); no folding, no reordering.

Problem

The CI-failure comment lists an aggregate job next to its own failing shard (issue #3680, item 3). For example "Run Full Test Suite" fails only because "Full Test Suite Shard 3/4" failed, yet both appear as separate failures with separate evidence, and the follow-up agent is asked to investigate both.

Expected

When a failed job is an aggregate of other failed jobs in the same workflow run, the comment lists the shard as the failure and mentions the aggregate once, as a consequence of it (for example "also failed: Run Full Test Suite, which only reports the shards"), without its own evidence block.

This must be proven per run, never guessed from names. A job counts as an aggregate only if both hold:

  • the workflow file at the failing commit shows the job needs one or more jobs that failed in this run (for a matrix, the matrix job id), and
  • the job's own failure is only its result gate: no step of it failed other than a step whose purpose is to check the needs results, or the job has no steps that ran tests/builds of its own.

If the workflow file cannot be read, the YAML cannot be parsed, or either condition is uncertain, list the job as a separate failure exactly as today.

Acceptance

  • Unit tests with this repository's own Run Full Test Suite + shard layout: one shard fails → the aggregate is folded; no shard fails but the aggregate does → listed on its own; aggregate has a failing step of its own besides the gate → listed on its own; workflow file unreadable → listed on its own.
  • The CI-failure follow-up prompt receives the same folded list as the comment.
  • Existing CI-failure comment tests still pass.

Implementation

Work in packages/core/src/webhook/ciFailureCommentGrouping.ts and packages/core/src/webhook/ciFailureFollowup.ts. Fetch the workflow file for the run's head SHA through the existing GitHub client (one request per workflow run, cached for the comment being built) and parse jobs.<id>.needs. Map API job names back to job ids carefully (matrix jobs have expanded names); when the mapping is ambiguous, do not fold. Keep the decision a pure function over (jobs, steps, parsed workflow) so it is unit-testable.

Activity

  1. propr-dev commented on Nov 19, 2026

    @propr-dev
    Contributor

    🤖 AI processing has started for this issue using claude agent with claude-opus-5-5 model.

    I'll analyze the problem and work on a solution. This may take a few minutes.

    Processing Details:

    • Agent: claude
    • Model: claude-opus-5-5
    • Branch: 3726/claude-opus-5-5-ci-failure-comment-fold-a-20261119-0646-x8d
    • Base Branch: 3725-epic-0-9-0ws
    • Worktree: issue-3726-20261119-0646-claude-opus-5-5-x8d

    🔍 Track Task Execution

  2. added a commit that references this issue on Nov 19, 2026
    1463976
  3. added a commit that references this issue on Nov 19, 2026
    ddb0a5e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions