Skip to content

Automate the merge pending release flag on self-healing doc PRs - #3397

Merged
pwizla merged 2 commits into
mainfrom
repo/auto-flag-merge-pending-release
Aug 25, 2026
Merged

Automate the merge pending release flag on self-healing doc PRs#3397
pwizla merged 2 commits into
mainfrom
repo/auto-flag-merge-pending-release

Conversation

@pwizla

@pwizla pwizla commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

This PR removes a manual step: the flag: merge pending release label is now dropped automatically once the strapi/strapi PR a doc PR documents reaches a published release. A scheduled job runs Wednesdays and Thursdays at 15:00 UTC, after the usual release window, and a workflow_dispatch trigger with a dry_run input allows testing without changing anything.

The release test is deterministic rather than date-based: .github/scripts/is-strapi-pr-released.sh asks GitHub whether the source PR's merge commit is an ancestor of the newest published v5 tag, which answers "is this available on npm?" rather than "was the branch locked?". It deliberately avoids milestone due dates (a plan that can slip) and release-note parsing (prose that can change format), picks the newest non-draft non-prerelease v5 tag explicitly because v4 maintenance releases interleave chronologically, and distinguishes API errors (exit 2) from a negative answer (exit 1) so an outage is never read as "not released".

PRs carrying temp - future media lib or flag: don't merge keep the flag regardless of release state, since those are held for reasons unrelated to shipping. Simulated locally against the 11 currently flagged PRs: 4 correctly held, 5 still waiting on a release, 2 skipped for lacking a source PR reference, 0 wrongly unflagged. The script itself passes 10 test cases covering all three exit codes.

This is the prerequisite for the auto-merge design: without it, roughly one self-healing PR in three would be auto-merged before the maintainer had a chance to flag it.

pwizla added 2 commits August 25, 2026 15:59
Answers one binary question via commit ancestry against the newest published
v5 tag: is the PR's merge commit contained in a release users can install?
Deliberately avoids milestones and release-note parsing, and distinguishes
API errors (exit 2) from a negative answer (exit 1).
Removes 'flag: merge pending release' from open doc PRs when the strapi/strapi
PR they document reaches a published release, replacing a manual step. Runs
Wednesdays and Thursdays after the release window. PRs held by 'temp - future
media lib' or "flag: don't merge" keep the flag regardless.
@pwizla pwizla self-assigned this Aug 25, 2026
@vercel

vercel Bot commented Aug 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
documentation Ready Ready Preview Aug 25, 2026 2:01pm

Request Review

@github-actions github-actions Bot added internal PRs created by the Strapi core team pr: chore source: repo PRs/issues not targeting a specific documentation but rather affecting the whole repo labels Aug 25, 2026
@pwizla pwizla added this to the 7.1.0 milestone Aug 25, 2026
@pwizla

pwizla commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator Author

LGTM, let's merge it in prod and test it (dry runs)

@pwizla
pwizla merged commit da4b05b into main Aug 25, 2026
8 checks passed
@pwizla
pwizla deleted the repo/auto-flag-merge-pending-release branch August 25, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal PRs created by the Strapi core team pr: chore source: repo PRs/issues not targeting a specific documentation but rather affecting the whole repo

1 participant