Making WordPress.org

Opened 7 months ago

Closed 7 months ago

#7388 closed defect (bug) (fixed)

Github PR linking can get confused

Reported by: dd32's profile dd32 Owned by:
Milestone: Priority: normal
Component: Trac Keywords:
Cc:

Description

As experienced with https://github.com/WordPress/wordpress.org/pull/186 + https://meta.trac.wordpress.org/ticket/7382 sometimes the GitHub PR linking gets confused as to the correct ticket to interact with.

It appears that it treated a Themes.trac link as a meta.trac link, and subsequently threw an unhandled exception.

The exception shouldn't have occurred, but it should've been handled gracefully as well.

Exception generated by the above PR:

E_ERROR: Uncaught Exception: JSON Error: 404 Ticket 158677 does not exist. in dotorg/trac/pr/class-trac.php:145

Stack trace:
#0 dotorg/trac/pr/class-trac.php(104): WordPressdotorg\API\Trac\GithubPRs\Trac->_api('ticket.update', Array)
#1 dotorg/trac/pr/class-trac.php(45): WordPressdotorg\API\Trac\GithubPRs\Trac->api('ticket.update', Array)
#2 dotorg/trac/pr/webhook.php(149): WordPressdotorg\API\Trac\GithubPRs\Trac->update('158677', '''This ticket w...', Array, true)
#3 {main}
 thrown
Source: POST https://api.wordpress.org/dotorg/trac/pr/webhook.php

Change History (3)

#1 @dd32
7 months ago

In 13081:

API: GitHub PRs: Tweak how the matching Trac ticket for a PR is found.

This should reduce some cases of the ticket being misidentified.

See #7388.

#2 @dd32
7 months ago

The exception shouldn't have occurred, but it should've been handled gracefully as well.

Upon looking closer... I think throwing it isn't the worst option here, as it ends up in our logging.

The exception shouldn't occur if the correct trac is located in the first place.

#3 @dd32
7 months ago

  • Resolution set to fixed
  • Status changed from new to closed

After testing the above change with #7382 and re-deliveries of the webhooks, it looks like that worked.

I had to clear some incorrect data from the database, which shouldn't happen again.

Note: See TracTickets for help on using tickets.