Avoid SVN timeouts during publishing to dotorg#79919
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 Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @Copilot. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
There was a problem hiding this comment.
Pull request overview
Updates the GitHub Actions workflow that publishes Gutenberg releases to the WordPress.org plugin SVN repository to reduce the likelihood of SVN timeouts and make failures less confusing during releases.
Changes:
- Splits “publish trunk” and “create tag” into separate SVN transactions, with tagging performed as a server-side
svn cp. - Switches the plugin repo URL from a hard-coded value to a GitHub Actions variable.
- Increases SVN import timeout to 600s and breaks download/unzip/cleanup into discrete steps.
| - name: Commit changes | ||
| if: steps.check_svn_tag.outputs.exists != 'true' | ||
| working-directory: ./trunk | ||
| run: | | ||
| svn st | grep '^?' | awk '{print $2}' | xargs -r svn add | ||
| svn st | grep '^!' | awk '{print $2}' | xargs -r svn rm | ||
| svn cp . "../tags/$VERSION" | ||
| svn commit . "../tags/$VERSION" \ | ||
| -m "Releasing version $VERSION" \ | ||
| svn commit -m "Releasing version $VERSION" \ | ||
| --no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD" \ | ||
| --config-option=servers:global:http-timeout=600 | ||
|
|
||
| - name: Tag the new version | ||
| if: steps.check_svn_tag.outputs.exists != 'true' | ||
| run: | | ||
| svn cp "$PLUGIN_REPO_URL/trunk" "$PLUGIN_REPO_URL/tags/$VERSION" \ | ||
| -m "Tagging version $VERSION" \ | ||
| --no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD" \ | ||
| --config-option=servers:global:http-timeout=600 |
There was a problem hiding this comment.
Spotted with the help of an AI agent.
This split makes the release easier to recover from, but the tag step now copies $PLUGIN_REPO_URL/trunk without pinning the revision created by the preceding svn commit.
For URL-to-URL copies, Subversion uses HEAD when no source revision is supplied, so a concurrent manual/workflow update to WordPress.org SVN trunk between these two steps could make tags/$VERSION point at different contents than the commit this run just produced.
The old working-copy copy avoided that by committing trunk and tag together. If we want the new cheap server-side copy, we should capture the revision from the trunk commit and copy that exact revision, for example:
commit_output="$( svn commit -m "Releasing version $VERSION" ... )"
echo "$commit_output"
trunk_revision="$( sed -nE 's/^Committed revision ([0-9]+)\.$/\1/p' <<< "$commit_output" )"
svn cp "$PLUGIN_REPO_URL/trunk@$trunk_revision" "$PLUGIN_REPO_URL/tags/$VERSION" \
-m "Tagging version $VERSION" \
--no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD" \
--config-option=servers:global:http-timeout=600The exact parsing can be adjusted, but the important part is that tags/$VERSION is created from the revision this run just committed, not whatever trunk happens to be at tag time.
Reference checked: Subversion svn copy docs document URL-to-URL copies as server-side copies and note that URL sources use HEAD when no peg revision is supplied.
There was a problem hiding this comment.
Came here to highlight this. If Tag the new version fails after Commit changes succeeds, trunk will be updated but the version will be untagged.
There was a problem hiding this comment.
Hmm. There should never be two people trying to commit to the .org repository at the same time. And concurrency from the GH Actions workflow should prevent two workflow runs from committing at the same time.
I think that there should be an equivalent @committers Version X.Y of the Gutenberg plugin is being released. announcement in Slack similar to the Core release would be sufficient to avoid this.
Very few people actually have commit access to the plugin itself, and releasing is almost entirely handled through this workflow. So I don't know how this scenario can realistically occur.
…//github.com/WordPress/gutenberg into fix/svn-timeouts-during-publishing-to-dotorg
|
@copilot I've gone and made some larger changes to this PR to simplify/consolidate logic and separate the tagging and committing operations into separate jobs. Please re-review the PR. |
Reviewed. One bug found and fixed in the new |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
Converting this to Draft state so #79858 can be merged first and conflicts can be resolved. |
What?
This modifies the logic responsible for committing changes to the WordPress.org plugin repository to be less likely to encounter timeout issues.
Closes #79804.
Why?
This workflow frequently encounters timeouts, which makes it appear like the release has not been published. However, the release often is published despite the error. This makes it quite confusing to know what needs to be addressed and what was successful, and can lead to contributors unintentionally ignoring or missing legitimate errors.
How?
In the current state, the full contents of the plugin are transmitted twice in the same transaction. This PR splits the operations into two atomic transactions:
trunkThe tagging transaction has also been changed to a remote server-side transaction, which does not read, download, or upload any file content and relies on the "cheap copy" in SVN.
Because theupload-tagstep creates a tag for a version aftertrunkhas been updated to a newer version, the same cheap copy command cannot be used and the full contents of the plugin needs to be transmitted during the commit. This could likely be improved, but it's not handled in this PR for the time being because it's a less common path.The committing and tagging logic have also been split into separate jobs. To improve tagging commands,
branchesare now utilized in the .org directory to allow for improved logic around tagging releases that occur after a newer one has been published intrunk.Use of AI Tools
Yes. Claude Code was used to create the initial draft of this PR before being reviewed by myself.