Skip to content

Fail the CI on changes to migrated extensions - #5840

Merged
lacatoire merged 2 commits into
php:masterfrom
lacatoire:pr/guard-migrated-extensions
Sep 8, 2026
Merged

Fail the CI on changes to migrated extensions#5840
lacatoire merged 2 commits into
php:masterfrom
lacatoire:pr/guard-migrated-extensions

Conversation

@lacatoire

@lacatoire lacatoire commented Sep 7, 2026

Copy link
Copy Markdown
Member

Fails the CI when a pull request adds to or modifies a reference/ folder of an extension that is migrating to php/doc-extensions, so that the notices merged in #5828 are enforced rather than only stated in prose.

The list is not hardcoded: the job takes the extensions carrying the MOVING_TO_DOC_EXTENSIONS_DO_NOT_CHANGE_HERE.md notice, read at the base commit, and matches them against the changed paths. Deletions are left alone, so removing those folders in batches is not blocked, and the check disappears on its own once the notices are gone.

Two limits worth knowing before merging this:

  • It only sees pull requests, so it does not cover direct pushes to master.
  • Repository-wide sweeps do touch these folders. A skip-migrated-check label lets one through, which only a maintainer can add. Seven currently open pull requests would go red until rebased or labelled.

@lacatoire
lacatoire force-pushed the pr/guard-migrated-extensions branch 5 times, most recently from 3f247b0 to 5337a09 Compare September 7, 2026 13:26
The extensions carrying a MOVING_TO_DOC_EXTENSIONS_DO_NOT_CHANGE_HERE.md
notice are maintained in php/doc-extensions. A pull request adding to or
modifying one of their reference folders now fails with a message
pointing at the other repository; deletions are left alone.
@lacatoire
lacatoire force-pushed the pr/guard-migrated-extensions branch from 5337a09 to bed791f Compare September 7, 2026 13:32
Comment thread .github/workflows/migrated-extensions.yaml Outdated
@alfsb

alfsb commented Sep 7, 2026

Copy link
Copy Markdown
Member

Too late as the code is done, but a simpler test would be cloning the repo with --filter=blob:none , listing all dirs with the file marker, and then git log or ls-tree --name-only from current to after date of creation of files to HEAD, or from SHA after file marker creation. So the test would fail if any filename line (or any line, really) matches the prefix of file marks.

This test not need to be the most optimized one, as it will only necessary while the first mass migration is not completed.

The check only reads path names, never file contents, so a tree:0
partial clone brings the full commit history for about the cost of
the shallow one it replaces. The base commit is then always present,
which removes the fetch-and-deepen loop and one of its failure paths.
@lacatoire
lacatoire merged commit aa4943d into php:master Sep 8, 2026
3 checks passed
@lacatoire
lacatoire deleted the pr/guard-migrated-extensions branch September 8, 2026 07:51
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