Making WordPress.org

Changeset 12587


Ignore:
Timestamp:
05/16/2023 05:12:07 AM (3 years ago)
Author:
dd32
Message:

Plugin Directory: Release Confirmations: Allow for releases to be confirmed (and built), that are not the stable version.

See #5352.
See #5901.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory
Files:
2 edited

Legend:

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

    r12538 r12587  
    9090                        }
    9191
     92                        // Check to see if the commit has touched tags that don't have known confirmed releases.
     93                        foreach ( $svn_changed_tags as $svn_changed_tag ) {
     94                                if ( 'trunk' === $svn_changed_tag ) {
     95                                        continue;
     96                                }
     97
     98                                $release = Plugin_Directory::get_release( $plugin, $svn_changed_tag );
     99                                if ( ! $release ) {
     100                                        // Use the actual version for stable releases, otherwise fallback to the tag name, as we don't have the actual header data.
     101                                        $version = ( $svn_changed_tag === $stable_tag ) ? $headers->Version : $svn_changed_tag;
     102
     103                                        Plugin_Directory::add_release(
     104                                                $plugin,
     105                                                [
     106                                                        'tag'       => $svn_changed_tag,
     107                                                        'version'   => $version,
     108                                                        'committer' => [ $last_committer ],
     109                                                        'revision'  => [ $last_revision ]
     110                                                ]
     111                                        );
     112
     113                                        $email = new Release_Confirmation_Email(
     114                                                $plugin,
     115                                                Tools::get_plugin_committers( $plugin_slug ),
     116                                                [
     117                                                        'who'     => $last_committer,
     118                                                        'readme'  => $readme,
     119                                                        'headers' => $headers,
     120                                                        'version' => $version,
     121                                                ]
     122                                        );
     123                                        $email->send();
     124
     125                                        echo "Plugin release {$svn_changed_tag} not confirmed; email triggered.\n";
     126                                }
     127                        }
     128
     129                        // Now check to see if the stable has been confirmed.
    92130                        $release = Plugin_Directory::get_release( $plugin, $stable_tag );
    93 
    94                         // This tag is unknown? Trigger email.
    95131                        if ( ! $release ) {
    96                                 Plugin_Directory::add_release(
    97                                         $plugin,
    98                                         [
    99                                                 'tag'       => $stable_tag,
    100                                                 'version'   => $headers->Version,
    101                                                 'committer' => [ $last_committer ],
    102                                                 'revision'  => [ $last_revision ]
    103                                         ]
    104                                 );
    105 
    106                                 $email = new Release_Confirmation_Email(
    107                                         $plugin,
    108                                         Tools::get_plugin_committers( $plugin_slug ),
    109                                         [
    110                                                 'who'     => $last_committer,
    111                                                 'readme'  => $readme,
    112                                                 'headers' => $headers,
    113                                         ]
    114                                 );
    115                                 $email->send();
    116 
    117                                 throw new Exception( 'Plugin release not confirmed; email triggered.' );
     132                                throw new Exception( "Plugin release {$stable_tag} not found." );
    118133                        }
    119134
     
    131146                                Plugin_Directory::add_release( $plugin, $release );
    132147
    133                                 throw new Exception( 'Plugin release not confirmed.' );
     148                                throw new Exception( "Plugin release {$stable_tag} not confirmed." );
    134149                        }
    135150
     
    373388                                $release = Plugin_Directory::get_release( $plugin, $tag );
    374389
    375                                 if ( ! $release || ( $release['zips_built'] && $release['confirmations_required'] ) ) {
     390                                if ( ! $release || ! $release['confirmed'] || $release['zips_built'] ) {
    376391                                        unset( $versions_to_build[ $i ] );
    377392                                } else {
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/email/class-release-confirmation.php

    r10214 r12587  
    3535                        $this->user_text( $this->args['who'] ),
    3636                        $this->args['readme']->name,
    37                         $this->args['headers']->Version,
     37                        $this->args['version'] ?? $this->args['headers']->Version,
    3838                        esc_url( Release_Confirmation_Shortcode::generate_access_url( $this->user ) )
    3939                );
Note: See TracChangeset for help on using the changeset viewer.