Skip to content

Plugin Directory: Attribute SVN changes to the plugin each path belongs to - #804

Closed
obenland wants to merge 2 commits into
WordPress:trunkfrom
obenland:fix/svn-watcher-multi-plugin-commit
Closed

Plugin Directory: Attribute SVN changes to the plugin each path belongs to#804
obenland wants to merge 2 commits into
WordPress:trunkfrom
obenland:fix/svn-watcher-multi-plugin-commit

Conversation

@obenland

Copy link
Copy Markdown
Member

Problem

SVN_Watcher::get_plugin_changes_between() assumed one commit touches one plugin. It derived the slug from only the first path of the commit:

$plugin_slug = explode( '/', $log['paths'][0] )[1];

…and then walked every path in that commit, appending each tag to that single plugin's tags_touched.

A commit spanning multiple plugins — e.g. a committer bumping "Tested up to" across their whole portfolio — is therefore misread completely.

Observed impact

r3644696 on plugins.svn touched nine plugins in one commit. autoclose sorted first, so it absorbed everything:

E_USER_WARNING: ZIP build failed for autoclose 4.4.0: … URL 'https://plugins.svn.wordpress.org/autoclose/tags/4.4.0' doesn't exist
E_USER_WARNING: ZIP build failed for autoclose 4.3.0: … doesn't exist
E_USER_WARNING: ZIP build failed for autoclose 4.4.2: … doesn't exist

4.4.0 is better-search's tag, 4.3.0 contextual-related-posts', 4.4.2 top-10's. autoclose has never had a 4.x release.

Two consequences beyond the log noise:

  1. A colliding tag gets rebuilt silently. knowledgebase's 3.1.1 also exists as an autoclose tag, so that ZIP was re-exported and re-committed for no reason — no warning, invisible in the logs.
  2. The other plugins are never imported. Only one slug is extracted, so nothing queues the rest. Their post_modified still predated the commit: better-search, contextual-related-posts, knowledgebase, popular-authors, webberzone-code-block-highlighting, webberzone-link-warnings and where-did-they-go-from-here all missed the readme change entirely. (top-10 only recovered because a separate top-10-only commit landed three minutes later.)

Fix

Determine the slug from each path rather than from the commit, and record each revision once per plugin. The per-plugin flags (readme_touched, code_touched, assets_touched) now describe that plugin's own paths instead of the whole commit's.

The summarising is extracted into SVN_Watcher::summarize_plugin_changes(), which is pure — it takes the log array and returns the grouped result — so it can be tested without shelling out to SVN.

Tests

Adds tests/SVN_Watcher_Log_Summary_Test.php (6 tests, 23 assertions), covering the multi-plugin commit, per-plugin flag isolation, revision de-duplication, ordering by earliest revision, tag-deletion vs. file-deletion-inside-a-tag, and bare plugin-root paths.

Verified they fail against the previous logic and pass with the fix:

# before
FF...F  6 / 6
1) test_commit_spanning_multiple_plugins_is_split_per_plugin
   -  1 => 'better-search'
   -  2 => 'top-10'
Tests: 6, Assertions: 11, Failures: 3.

# after
......  6 / 6
OK (6 tests, 23 assertions)

Note

One intentional behaviour change: a commit whose only path for a plugin is the bare plugin root (/plugin-name, with no /trunk, /tags or /assets below it) no longer produces an entry. Previously it created one with an empty tag list and nothing to import. New-repo commits are unaffected — they're filtered by the PLUGIN_SVN_MANAGEMENT_USER check, and carry /trunk anyway.

No Meta Trac ticket yet — happy to open one and reference it if that's preferred.

Copilot AI lite review requested due to automatic review settings August 13, 2026 13:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown

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 props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props obenland.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@obenland
obenland force-pushed the fix/svn-watcher-multi-plugin-commit branch from c307115 to fb14639 Compare August 13, 2026 13:42
obenland and others added 2 commits August 18, 2026 21:23
…gs to.

SVN_Watcher derived the plugin slug from the first path of a commit and then
folded every path in that commit into that one plugin. A commit spanning
several plugins — a "Tested up to" sweep across a committer's portfolio, for
instance — therefore credited every plugin's tags to whichever plugin sorted
first, and queued no import at all for the rest.

The first plugin then tried to build ZIPs for tags it doesn't have, logging
`URL '...' doesn't exist` warnings from Zip\Builder, while the other plugins
in the commit never made it into the directory at all.

Determine the slug per path instead, and record each revision once per plugin.
The summarising is extracted into SVN_Watcher::summarize_plugin_changes() so it
can be exercised without shelling out to SVN.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The root ruleset runs the full WordPress standard, which the deployed
public_html/phpcs.xml relaxes, so the new test file tripped a number of
PEAR.Functions.FunctionCallSignature sniffs. Reformats the nested calls
with phpcbf, documents the test class and its summarize() helper, and
terminates the readme_touched comment that moved into the path loop.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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