Plugin Directory: Don't queue a deleted /trunk for import - #819
Closed
obenland wants to merge 1 commit into
Closed
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
A commit that deletes /trunk was recorded as having touched it, so the importer queued a ZIP build against a URL that no longer exists. Release workflows that delete trunk in the tag commit and re-create it from that tag moments later hit this whenever the watcher polls in between, failing the build with "URL '.../trunk' doesn't exist". The re-creation is a change of its own and queues trunk again once it's there. Mirrors the existing handling for deleted tags, except that trunk isn't recorded in tags_deleted: that removes the matching release, and trunk has no release of its own to remove. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
obenland
force-pushed
the
svn-watcher-deleted-trunk
branch
from
August 18, 2026 22:47
0b8caa9 to
3dbb9b3
Compare
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.
Problem
SVN_Watcher::summarize_plugin_changes()records a deleted/trunkas a touched version:The tags branch distinguishes a deletion; the trunk branch doesn't. So
Builder::export_plugin()is asked to export a URL that has just been removed.Observed impact
Some release workflows delete trunk in the same commit that adds the tag, then re-create it from that tag moments later. If svn-watch polls in the gap, the import fails:
Same thing thirteen minutes later on
webp-converter-for-media(31-second window, r3653600 → r3653604). That committer has used this release pattern for months — 17D /trunkcommits inwebp-converter-for-media's last 40 revisions, back to 2025-12-08 — so the warning fires whenever the timing lines up.It resolves itself: the commit that re-creates trunk queues another import, which builds the ZIP correctly. The cost is a failed import cycle and a warning that looks like a broken plugin rather than an in-progress release.
Fix
Treat the removal of the bare
/slug/trunkpath as a deletion, and skip it. A file deletion inside trunk (/slug/trunk/old.php) is still a change to trunk and still queues it.Trunk is deliberately not added to
tags_deleted: the importer runsremove_release()over that list, and trunk has no release of its own to remove.An import is still queued for the plugin — the commit that removed trunk also added the tag, and the stable-tag fallback may have changed — it just no longer names a version that can't be exported. A commit that deletes nothing but trunk yields an entry with an empty
tags_touched, which the importer already handles.Tests
Adds 3 cases to
tests/SVN_Watcher_Log_Summary_Test.php, built from the r3653586 log entry:test_trunk_deletion_is_not_queued_as_a_touched_version— the regression.test_file_deletion_within_trunk_still_touches_trunk— guards against over-correcting.test_recreated_trunk_is_queued_again— including when both commits land in one batch of revisions.Verified against the pre-fix code:
The two guard tests pass either way, by design.
Note
Follow-up to #804, which touched the same function but not this branch of it. No Meta Trac ticket — happy to open one and reference it if that's preferred.