Making WordPress.org


Ignore:
Timestamp:
10/21/2019 07:12:19 AM (5 years ago)
Author:
dd32
Message:

Slack: Attempt to pipe commits to channels when the commit message starts with the component.

See #4471.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/common/includes/slack/trac/trac.php

    r7347 r9218  
    8080                $this->ticket_component_filters[ $component ] = array( $channel => true );
    8181            }
    82             if ( $this->bypass_primary_channel_for_ticket_filter_matches && empty( $this->ticket_component_filters[ $component ][ $this->primary_channel ] ) ) {
    83                 $this->ticket_component_filters[ $component ][ $this->primary_channel ] = false;
    84             }
     82            if ( $this->bypass_primary_channel_for_ticket_filter_matches && empty( $this->ticket_component_filters[ $component ][ $this->primary_channel ] ) ) {
     83                $this->ticket_component_filters[ $component ][ $this->primary_channel ] = false;
     84            }
    8585        }
    8686    }
     
    211211    }
    212212
    213     function get_commit_channels( $changed_files = null ) {
     213    function get_commit_channels( $changed_files = null, $log_text = null ) {
    214214        $channels = array();
    215215
     
    233233        }
    234234
     235        foreach ( $this->ticket_component_filters as $component => $channels_to_add ) {
     236            if ( 0 === stripos( $log_text, $component ) ) {
     237                $channels = array_merge( $channels, (array) $channels_to_add );
     238            }
     239        }
     240
    235241        if ( $this->firehose_channel ) {
    236242            $channels[ $this->firehose_channel ] = true;
Note: See TracChangeset for help on using the changeset viewer.