Making WordPress.org

Changeset 14253


Ignore:
Timestamp:
12/10/2024 06:27:34 AM (14 months ago)
Author:
dd32
Message:

Plugin Directory: Allow the plugin management user commits to be imported into the Plugin Directory.

This allows for automated commits from the plugin directory to be processed as normal, while still skipping over irrelevant items.

See https://github.com/WordPress/wordpress.org/pull/343.
See #7783.

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/admin/class-status-transitions.php

    r14127 r14253  
    276276            'http://plugins.svn.wordpress.org/' . $post->post_name,
    277277            sprintf(
     278                // WARNING: When changing this, please update the regex in SVN_Watcher::get_plugin_changes_between().
    278279                'Adding %1$s by %2$s.',
    279280                html_entity_decode( $post->post_title ),
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/cli/class-svn-watcher.php

    r13709 r14253  
    6767     */
    6868    protected function get_plugin_changes_between( $rev, $head_rev = 'HEAD' ) {
    69 
    7069        $logs = SVN::log( self::SVN_URL, array( $rev, $head_rev ) );
    7170        if ( $logs['errors'] ) {
     
    9594
    9695        foreach ( $logs['log'] as $log ) {
    97             // Discard automated changes, these should not trigger plugin imports
    98             if ( defined( 'PLUGIN_SVN_MANAGEMENT_USER' ) && PLUGIN_SVN_MANAGEMENT_USER == $log['author'] ) {
    99                 continue;
     96            // Discard some commits from the plugin management user.
     97            if (
     98                defined( 'PLUGIN_SVN_MANAGEMENT_USER' ) &&
     99                PLUGIN_SVN_MANAGEMENT_USER == $log['author']
     100            ) {
     101                /*
     102                 * If the commit matches the "new repo created" message, we'll skip it.
     103                 *
     104                 * See Status_Transitions::approved_create_svn_repo()
     105                 */
     106                if ( preg_match( '/^Adding (.+) by (.+)\.$/i', $log['msg'] ) ) {
     107                    continue;
     108                }
     109
     110                /*
     111                 * If the commit includes an "Author:" byline, we'll use that as the actual author.
     112                 * This can be used for automated commits that are made on behalf of a user.
     113                 */
     114                if ( preg_match( '/^Author: (.+)\.$/im', $log['msg'], $matches ) ) {
     115                    $log['author'] = $matches[1];
     116                }
    100117            }
    101118
Note: See TracChangeset for help on using the changeset viewer.