Skip to content

Show why CI jobs failed on a reviewed pull request - #126

Open
Celestial-0 wants to merge 1 commit into
prooflinedev:mainfrom
Celestial-0:feat/ci-failures
Open

Celestial-0 wants to merge 1 commit into
prooflinedev:mainfrom
Celestial-0:feat/ci-failures

Conversation

@Celestial-0

Copy link
Copy Markdown

Summary

Adds a read-only ci failures command. It reads one review by ID and prints the CI attributions Proofline already records. Until now those attributions were visible only in --json, while findings printed a single production: COMPLETED, no findings line for a review whose jobs had failed.

proofline ci failures --review REVIEW_ID
  review detail GET
  render
    reviewed commit and observation time
    each job: name, attempt, first failed step, timeout, cause
    unknown cause: the recorded reason
    omitted jobs, pending run attempts, unfinished run attempts

The command tells a developer whether a red job was caused by the change, was already failing on the merge base, was flaky, or was not diagnosed because no log was available. It also says when the pull request head has moved since the observation.

Evidence

With a completed-review fixture whose jobs failed, proofline findings --review REVIEW_ID printed production: COMPLETED, no findings. The test ci_failures_distinguishes_a_change_failure_from_a_pre_existing_failure failed before the change. It passes now, and proofline ci failures --review REVIEW_ID prints CAUSED_BY_CHANGE and PRE_EXISTING_ON_BASE as different explanations for a job.

Verification

  • cargo fmt --check and cargo clippy --locked --all-targets -- -D warnings passed.
  • cargo test --locked -- --include-ignored passed all 169 tests on Linux, including the pre-commit framework integration.
  • cargo deny check passed with the duplicate-dependency warnings already present in the lockfile.

The console fixture is synthetic. The hosted service was not exercised.

Merge risk

The command is additive. Output, exit codes and verdicts do not change when it is not invoked. It reads one retained review and never starts a review or reruns a job. Reverting the commit removes the command and restores the previous behavior.

Add a read-only ci failures command that prints Proofline's recorded
attribution for each failed job of a retained pull request review. It names
the reviewed commit and observation time, warns when the PR head moved, and
reports omitted jobs plus pending and unfinished diagnoses separately.

The command reads one review by UUID, needs no checkout, and never starts a
review or reruns a job. Unknown causes show their recorded reason. Absent or
empty observations exit 0 with an explicit message; malformed observations
and non-PR reviews exit 1.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant