Split script: reconstruct dropped tags, retry Packagist#221
Merged
Conversation
When a monorepo release commit only touches root-level files (like VERSION) and not component directories, git filter-repo drops the commit and its tag from the filtered history. This means split repos can miss version tags entirely, preventing Packagist from publishing those versions. Fix this by saving all version tag timestamps before filter-repo runs and recreating any that get dropped, mapping them to the latest surviving commit at or before the original tag timestamp. Also add retry logic (3 attempts with backoff) for Packagist update notifications, which were silently swallowing transient HTTP 500 errors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The v0.5.0 release failed to propagate to all Packagist packages because the release commit only touched the root
VERSIONfile, not any component directory. Whengit filter-repofilters a component's history, it drops commits (and their tags) that don't touch that component's path. This left split repos without the version tag, so Packagist never saw the new release.Two fixes:
Tag reconstruction — before filter-repo runs, save all version tag timestamps. After filtering, recreate any tags that got dropped by mapping them to the latest surviving commit at or before the original tag's timestamp. This handles the case where release commits don't touch every component directory.
Packagist retry — the
update_packagist()call was silently swallowing failures (including HTTP 500s). Now retries 3 times with backoff before giving up with a visible warning.After merging, a v0.5.1 patch release will re-split all components with the fixed script, which will also push the reconstructed v0.5.0 tags to every split repo.
Test plan
patchrelease via publish workflowwp-php-toolkit/filesystem