Skip to content

rc-docs-sync: collapse multiple unprocessed RCs to the latest per run#402

Merged
enricobattocchi merged 4 commits into
mainfrom
rc-docs-sync-collapse-to-latest
Jun 1, 2026
Merged

rc-docs-sync: collapse multiple unprocessed RCs to the latest per run#402
enricobattocchi merged 4 commits into
mainfrom
rc-docs-sync-collapse-to-latest

Conversation

@enricobattocchi
Copy link
Copy Markdown
Member

@enricobattocchi enricobattocchi commented May 28, 2026

Run 26561237947 produced duplicate PRs #400 and #401 because the resolver fanned out a matrix entry per unprocessed RC.

Fix: collapse multiple unprocessed RCs to just the latest per base version (so two cycles' RCs aren't accidentally merged). Each matrix entry carries a superseded_rcs list; the matrix step itself posts those superseded markers, gated on the latest RC's own marker being on the tracking issue first. If clone/bundle fails, no superseded markers are posted and the next run re-picks up the skipped RCs. last_key uses max(processed_markers, key=sort_key) so out-of-order markers (superseded or manual backfill) can't reset state. workflow_dispatch with explicit rc_tag bypasses collapse.

9 synthetic resolver scenarios cover bug case, mid-cycle, single-RC, empty, dispatch bypass, mixed bases, document-order-after-superseded, and backfilled-older-RC.

Run 26561237947 (2026-05-28 schedule) processed both 27.8-RC1 and 27.8-RC2
because the resolver fanned out one matrix entry per unprocessed RC. The
agent then independently re-documented the same wpseo_custom_fields_pre_query
filter, producing PR #400 (for RC1) and PR #401 (for RC2) — identical
titles, identical work, one of them obvious waste.

Process only the latest unprocessed RC per product per run. The earlier
unprocessed RCs are silently superseded:

 - The resolver collects them in a new superseded_actions list (paired
   with the RC that supersedes them).
 - A new "Mark superseded RCs" step posts a brief marker comment on the
   tracking issue for each, mirroring the dedup style of the safety-net
   step (skips if a marker already exists).
 - The latest RC's diff base is computed as before: if a prior RC of the
   same base is in processed_markers, diff against that (incremental);
   otherwise against the latest stable (full release cycle). When multiple
   never-seen RCs of the same base collapse to the latest, that's a full
   stable-cycle diff which captures any net public-surface changes (an
   RC2 that reverts an RC1 change shows neither; an RC2 that adds on top
   of RC1 shows both).
 - workflow_dispatch with an explicit input_rc_tag bypasses the collapse,
   preserving the manual-backfill path.

Synthetic resolver tests (5 scenarios) cover: the bug case, the
already-processed-prior-RC case, single-RC behavior unchanged, empty
queue, and the input_rc_tag bypass — all pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 28, 2026

Deploying yoast-developer with  Cloudflare Pages  Cloudflare Pages

Latest commit: 55bad1c
Status: ✅  Deploy successful!
Preview URL: https://89f2d5fb.yoast-developer.pages.dev
Branch Preview URL: https://rc-docs-sync-collapse-to-lat.yoast-developer.pages.dev

View logs

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the RC docs sync workflow to avoid opening duplicate documentation PRs when multiple unprocessed RC tags are found in the same scheduled run.

Changes:

  • Collapses multiple unprocessed RCs to only process the latest tag.
  • Records skipped RCs as superseded in the tracking issue.
  • Adds resolver output and workflow step support for superseded markers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/rc-docs-sync.yml Outdated
Copilot caught this on #402: if the workflow misses RCs from two different
cycles (e.g. 27.8-RC1 and 27.9-RC1 both unprocessed), the previous logic
collapsed both into 27.9-RC1 against the latest stable, which never sees
27.8-RC1's public surface.

Group unprocessed RCs by base_version, keep only the latest per group.
Each base gets its own queue entry diffed against the previous stable.
Synthetic test (scenario 6) confirms the fix.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/rc-docs-sync.yml Outdated
Copilot caught: posting superseded markers in the resolve job advances
state past the skipped RCs before the matrix entry that's supposed to
cover them has finished. If the latest RC's clone or bundle step fails
(no marker for it gets posted), the next run treats the superseded RCs
as `same_base_processed` and uses them as diff bases — missing changes
between stable and the skipped RC.

Move the marker-posting into the matrix job: each queue entry now carries
its own `superseded_rcs` list, and a final per-entry step posts them only
after verifying the entry's own marker is already on the tracking issue.
A clone/bundle failure now leaves the superseded RCs unmarked, so the
next run re-picks them up correctly.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread .github/workflows/rc-docs-sync.yml
Comment thread .github/workflows/rc-docs-sync.yml
- last_key was reading processed_markers[-1] (document order). Superseded
  markers are posted *after* the superseding RC's marker, so document order
  would identify an older (superseded) RC as the high-water mark and re-queue
  an already-processed RC. Use max by sort_key instead.

- superseded_by_latest was initialized only inside the non-dispatch branch,
  so workflow_dispatch with explicit input_rc_tag would NameError when
  building the queue entry. Initialize at the top of each per-product
  iteration (also prevents accidental cross-product leakage once PRODUCTS
  has more than one entry).

Synthetic test suite extended to 9 scenarios, including the document-order
marker case and the dispatch-bypass case — both now pass.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@enricobattocchi enricobattocchi merged commit aec8906 into main Jun 1, 2026
2 checks passed
@enricobattocchi enricobattocchi deleted the rc-docs-sync-collapse-to-latest branch June 1, 2026 12:00
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