Skip to content

ci: the review's completion wakes the resolver as the Pipeline's does (ADR-1127) - #958

Merged
cdeust merged 1 commit into
mainfrom
ci/review-wakes-resolver
Nov 10, 2026
Merged

cdeust merged 1 commit into
mainfrom
ci/review-wakes-resolver

Conversation

@cdeust

@cdeust cdeust commented Nov 10, 2026

Copy link
Copy Markdown
Owner

Contexte

Le résolveur ne se réveillait qu'à la fin du Pipeline et lisait le verdict une seule fois. Si la review Claude finissait après le Pipeline, la PR restait ouverte avec un Verdict: approve, jusqu'à une relance manuelle. Dans Cortex l'ordre tenait (Pipeline 30 min, review 3 à 4). Il ne tient pas dans un dépôt au Pipeline court. Constat Codex P1 sur les PR de réplication (ai-architect-mcp-codebase#486, ai-architect-mcp-spec#185).

Changement (ADR-1127, amende ADR-1121)

  • pipeline-after-merge.yml écoute la fin de Pipeline et de PR Review.
  • Réveillé par une review, le résolveur prend comme source le run pipeline.yml réussi le plus récent du même head, puis applique les mêmes contrôles (identité du run, jobs exacts, identité de la PR, verdict ou niveau bas risque). Sans run réussi, la fusion est retenue.
  • Une PR déjà fusionnée à la fin de la review n'est pas retestée.

Métrique

PR approuvées restant non fusionnées à cause de l'ordre d'arrivée : possible aujourd'hui, 0 après.

Tests

tests_py/scripts/test_ci_review_wakes_resolver.py (6 tests) ; contrat d'événements du caller mis à jour dans scripts/ci_pipeline_routes.py et son test. 78 tests du résolveur et des routes verts en local.


Generated by Claude Code

… (ADR-1127)

The resolver ran once, on the Pipeline's completion. A review that ended after
the Pipeline left the PR unmerged with an approve. pipeline-after-merge.yml now
listens to PR Review as well; woken by a review, the resolver resolves the newest
successful Pipeline run of that head and applies the same checks.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_018kyZYsWnKSjpX4oNV19PCF
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T01:33:33.754658Z e284e93 PR opened
🔒 Security Review ✅ Completed 2026-11-10T01:36:21.832333Z e284e93 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@claude

claude Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Claude finished @cdeust's task in 3m 11s —— View job


Review of PR #958 (review 1 of 3)

I found no Blockers, and the verdict is approve. The full review is in this comment.

I couldn't run the tests or the linter in this job because the commands needed approval. The review comes from reading the code.

  • Read the diff and the resolver's checks
  • Ran the five reviews: code quality, security, performance, test coverage, documentation
  • Posted the findings: no Blockers, 3 Notes

@claude

claude Bot commented Nov 10, 2026

Copy link
Copy Markdown

Claude review (1 of 3), PR #958

I found no Blockers. I traced the new review wake-up through _pipeline_of_review → _validate_run → the exact job gate → _pr_identity → _review_approves. A run woken by the review still needs three things before it merges:

  • a successful same-repo pipeline.yml pull_request run on the exact head, with the full job matrix;
  • a claude[bot] verdict that links a review run of that head;
  • the head pinned by sha on the merge PUT.

A look-alike PR Review workflow or a fork cannot use the new trigger, because the path, event and head_repository are all checked. A review skipped by its budget still ends success, and _review_approves holds it as before, so ADR decision 4 is right.

I could not run the tests or ruff in this job because the commands needed approval. The verification above comes from reading the code.

Notes, no action before merge

  • The two wake-ups can race. The concurrency group (pipeline-post-merge.yml:24) is keyed on workflow_run.id, so the two resolvers are not serialized. If the review wake-up merges first, the Pipeline wake-up sees already_merged, finds no push run (GITHUB_TOKEN merges do not trigger one) and also returns run_tests=true, so the post-merge suite runs twice. Tags are preserved. A fix is a group keyed on workflow_run.head_sha with cancel-in-progress: false.
  • The comment at pipeline-post-merge.yml:518 and ADR-1127 decision 3 say the Pipeline completion merged the PR. A hand merge whose push run is not visible yet also takes this branch, so the old "duplicates, never skips" guarantee (:345) is weaker here. The human push Pipeline still covers that commit. The CHANGELOG also says "whichever finishes first", but the merge happens when the last one finishes.
  • pipeline-after-merge.yml and pipeline-post-merge.yml are rendered by zetetic-team-subagents render-ci. The same change needs to go into that template, or the next render reverts ADR-1127. The new test checks resolve by splitting its source text; it does not run resolve/_source_run with a fake API.

View job run

Verdict: approve

@cdeust
cdeust merged commit 7b81ab1 into main Nov 10, 2026
18 checks passed
@cdeust
cdeust deleted the ci/review-wakes-resolver branch November 10, 2026 04:02
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.

2 participants