Making WordPress.org

Changeset 13959


Ignore:
Timestamp:
08/09/2024 07:12:35 AM (5 weeks ago)
Author:
dd32
Message:

Plugin Directory: Release Confirmation: Remove releases for deleted tags earlier.

When a SVN tag is removed the relevant release is deleted [13711], but that only applied when release confirmation was enabled.

As of the changes in #7696 releases now exist even if release confiramtion isn't enabled, as such as should always remove any release meta for any non-explicitely-confirmed releases.

This also has the effect of resolving an edge-case where the deleted tag is present within trunk/readme.txt as the Stable Tag but the release was discarded/not-confirmed, in that case $stable_tag would be set to the fallback value of 'trunk' for the SVN import and ultimately release confirmation would reject the import (as trunk is not currently valid for that scenario).
That would cause the release NOT to be deleted, although the tag was. Replacing the tag with the corrected data would not re-trigger the confirmation process if the release was previously discarded.

See #7696, #5900.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/cli/class-import.php

    r13958 r13959  
    154154        unset( $_requires_plugins, $unmet_dependencies );
    155155
     156        /*
     157         * If a tag has been deleted, we should also remove any unconfirmed releases.
     158         * NOTE: remove_release() will not remove a confirmed release, but will remove a discarded release.
     159         *
     160         * Additionally; this must occur before the below release confirmation checks,
     161         * if the trunk readme has it's stable_tag set to one of these deleted (now non-existent) tags,
     162         * then $stable_tag will be set to the fallback 'trunk', causing the RC checks to fail.
     163         */
     164        foreach ( $svn_tags_deleted as $svn_deleted_tag ) {
     165            if ( Plugin_Directory::remove_release( $plugin, $svn_deleted_tag ) ) {
     166                echo "Plugin tag {$svn_deleted_tag} deleted; release removed.\n";
     167            }
     168        }
     169
    156170        // Release confirmation
    157171        if ( $plugin->release_confirmation ) {
     172            // If the stable tag is trunk, we shouldn't continue, as we don't support that for RC.
    158173            if ( 'trunk' === $stable_tag ) {
    159174                throw new Exception( 'Plugin cannot be released from trunk due to release confirmation being enabled.' );
     
    206221
    207222                    echo "Plugin release {$svn_changed_tag} not confirmed; email triggered.\n";
    208                 }
    209             }
    210 
    211             // Check to see if any of the releases were deleted.
    212             foreach ( $svn_tags_deleted as $svn_deleted_tag ) {
    213                 // Note: Confirmed releases will not be deleted, only unconfirmed ones.
    214                 if ( Plugin_Directory::remove_release( $plugin, $svn_deleted_tag ) ) {
    215                     echo "Plugin tag {$svn_deleted_tag} deleted; release removed.\n";
    216223                }
    217224            }
Note: See TracChangeset for help on using the changeset viewer.