[wp-trac] [WordPress Trac] #55668: skipOnAutomatedBranches() does not work as expected, take 2

WordPress Trac noreply at wordpress.org
Wed May 4 00:31:18 UTC 2022

#55668: skipOnAutomatedBranches() does not work as expected, take 2
 Reporter:  SergeyBiryukov    |      Owner:  (none)
     Type:  defect (bug)      |     Status:  new
 Priority:  normal            |  Milestone:  5.9.4
Component:  Build/Test Tools  |    Version:
 Severity:  normal            |   Keywords:  has-patch
  Focuses:                    |
 Background: #49050, #50401, #54112.

 As part of the changes in [51868] / #54112, the `GITHUB_REF` and
 `GITHUB_EVENT_NAME` environment variables added in [49267] are no longer
 passed to the Docker container, which breaks the
 `skipOnAutomatedBranches()` method and causes it to still run on branches
 other than `trunk`.

 This was never noticed before, as most of these tests check the year in
 `license.txt`, the version in `package.json`, the year in bundled themes'
 `readme.txt`, etc. By the time WordPress 5.9 was released in January, all
 of these files were already updated.

 Summary of the changes in the attached patch:
 * Pass the `GITHUB_REF` and `GITHUB_EVENT_NAME` environment variables to
 the Docker container, so that they are available to PHPUnit.
 * Update the `'refs/heads/trunk' !== $github_ref` condition to account for
 renaming the `master` branch to `trunk` in November 2021, following the
 repositories-to-use-main-instead-of-master/ decision made in June 2020].
 * Remove obsolete references to the `master` branch in favor of `trunk`.
 * Remove the redundant `'false' !== $github_event_name` condition. It
 appears to be copied in [49267] from `'false' !== $travis_pull_request`
 added in [47000]. Based on the list of [https://docs.github.com/en/actions
 /using-workflows/events-that-trigger-workflows], the event name can never
 be `'false'` as a string.

Ticket URL: <https://core.trac.wordpress.org/ticket/55668>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list