WordPress.org

Making WordPress.org

Changeset 9531


Ignore:
Timestamp:
02/24/2020 06:28:21 AM (22 months ago)
Author:
dd32
Message:

Trac: Github PRs: Include the PR bodytext in the Trac notification.

This should help include some more context in the PRs and also make it easier to keep all pertitant information in one place (Trac).

See #5054.

Location:
sites/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/dotorg/trac/pr/functions.php

    r9372 r9531  
    2424        'closed_at'       => $data->closed_at,
    2525        'mergeable_state' => $data->mergeable_state,
     26        'body'            => $data->body,
    2627        'user'            => (object) [
    2728            'url'  => $data->user->html_url,
  • sites/trunk/api.wordpress.org/public_html/dotorg/trac/pr/webhook.php

    r9373 r9531  
    5858        }
    5959
     60        // Remove the specific Trac Ticket and PR Body from the DB version.
    6061        $_pr_data_no_ticket = clone $pr_data;
    61         unset( $_pr_data_no_ticket->trac_ticket );
     62        unset( $_pr_data_no_ticket->trac_ticket, $_pr_data_no_ticket->body );
    6263
    6364        // Step 3. If not in DB, or $pr_data->trac_ticket isn't yet in the DB, add a new row of it.
     
    8384                "''This ticket was mentioned in [{$pr_data->html_url} PR #{$pr_number}] " .
    8485                    "on [https://github.com/{$pr_repo}/ {$pr_repo}] " .
    85                     "by [{$pr_data->user->url} {$pr_data->user->name}].''"
     86                    "by [{$pr_data->user->url} {$pr_data->user->name}].''" .
     87                    ( trim( $pr_data->body ) ? "\n{$pr_data->body}" : '' )
    8688            );
    8789        }
  • sites/trunk/trac.wordpress.org/templates/site.html

    r9514 r9531  
    55
    66<?python
    7     scripts_version = '134'
     7    scripts_version = '135'
    88    project_slug = req.environ['HTTP_HOST'].split(':')[0].split('.')[0]
    99    wporg_endpoint = 'https://make.wordpress.org/' + project_slug + '/'
  • sites/trunk/trac.wordpress.org/templates/ticket_change.html

    r9367 r9531  
    3333
    3434<py:choose>
    35 <py:when test="'author' in change and ('slackbot' == change.author or 'ircbot' == change.author or ( 'prbot' == change.author and change.comment.startswith('\'\'') ) )"
     35<py:when test="'author' in change and ('slackbot' == change.author or 'ircbot' == change.author)"
    3636         py:with="wporg_user = wporg_sanitize_user_nicename(change.author)"  >
    3737  <h3 class="change chat-bot">
     
    5353    </div>
    5454  </h3>
     55</py:when>
     56<py:when test="'author' in change and 'prbot' == change.author and change.comment.startswith('\'\'')"
     57         py:with="
     58           wporg_user  = wporg_sanitize_user_nicename(change.author);
     59           pr_byline   = change.comment.partition('\n')[0];
     60           pr_comment  = ''.join(change.comment.partition('\n')[1:]) or False;
     61           prbot_class = 'prbot with-context' if pr_comment else 'prbot without-context';
     62         ">
     63  <h3 class="change chat-bot ${prbot_class}">
     64    <span class="avatar">
     65      <span class="username-line">
     66        <img src="https://wordpress.org/grav-redirect.php?user=${wporg_user}&amp;s=48" srcset="https://wordpress.org/grav-redirect.php?user=${wporg_user}&amp;s=96 2x" height="48" width="48" />
     67        ${wiki_to_html(context, pr_byline, escape_newlines=preserve_newlines)}
     68      </span>
     69      <br /><span class="time-ago">${dateinfo(change.date)} ago</span>
     70    </span>
     71  </h3>
     72  <div py:if="pr_comment" class="comment searchable" xml:space="preserve">
     73    ${wiki_to_html(context, pr_comment, escape_newlines=preserve_newlines)}
     74  </div>
    5575</py:when>
    5676<py:otherwise>
  • sites/trunk/wordpress.org/public_html/style/trac/wp-trac.css

    r9356 r9531  
    880880    background: #fff;
    881881    padding: 0 11px 1px 1em;
     882}
     883#changelog h3.change.prbot.with-context {
     884    color: inherit;
     885    margin: 1em -1em;
     886    border: 1px;
     887    border-bottom: none;
    882888}
    883889#changelog h3.change:after,
Note: See TracChangeset for help on using the changeset viewer.