Making WordPress.org

Changeset 11305


Ignore:
Timestamp:
11/02/2021 07:25:50 AM (4 years ago)
Author:
dd32
Message:

Theme Directory: Slack Firehose: Include the commit message into the Slack logging when it's not an automated commit.

See #5899.

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

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-wporg-themes-upload.php

    r11304 r11305  
    138138     */
    139139    protected $importing_from = 'upload';
     140
     141    /**
     142     * The SVN commit message, if user defined.
     143     *
     144     * @var string
     145     */
     146    protected $commit_msg = '';
    140147
    141148    /**
     
    177184        $this->version_status = 'new';
    178185        $this->importing_from = 'upload';
     186        $this->commit_msg     = '';
    179187
    180188        // $this->tmp_dir = '';    // Temporary folder per each instance of this class. Doesn't need to be reset each time.
     
    222230     * @return true|WP_Error See ::import() for error conditions.
    223231     */
    224     public function process_update_from_svn( $slug, $version, $changeset = 0, $author = '' ) {
     232    public function process_update_from_svn( $slug, $version, $changeset = 0, $author = '', $commit_message = '' ) {
    225233        $this->reset_properties();
    226234
    227235        $this->importing_from = 'svn';
    228236        $this->theme_slug     = $slug;
     237        $this->commit_msg     = $commit_message;
    229238
    230239        // Check out from SVN.
     
    17611770                            ''
    17621771                        ),
     1772                ];
     1773            }
     1774
     1775            if ( $this->commit_msg ) {
     1776                $fields[] = [
     1777                    'type' => 'mrkdwn',
     1778                    'text' => "*Commit Message:*\n{$this->commit_msg}",
    17631779                ];
    17641780            }
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/jobs/class-svn-import.php

    r11233 r11305  
    7171
    7272            $changeset = (int) $element->xpath( '@revision' )[0];
    73             $author    = (string) $element->xpath( 'author' )[0];
    74             $msg       = (string) $element->xpath( 'msg' )[0];
     73            $author    = trim( (string) $element->xpath( 'author' )[0] );
     74            $msg       = trim( (string) $element->xpath( 'msg' )[0] );
    7575
    7676            $info = compact( 'slug', 'version', 'changeset', 'author', 'msg' );
     
    116116            $args['version'],
    117117            $args['changeset'] ?? false,
    118             $args['author'] ?? false
     118            $args['author'] ?? false,
     119            $args['msg'] ?? ''
    119120        );
    120121
Note: See TracChangeset for help on using the changeset viewer.