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

WordPress Trac noreply at wordpress.org
Wed May 4 00:36:37 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            |  Resolution:
 Keywords:  has-patch         |     Focuses:
------------------------------+---------------------
Description changed by SergeyBiryukov:

Old description:

> 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 [https://make.wordpress.org/core/2020/06/18/proposal-update-all-git-
> 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.

New description:

 Background: #39486, #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
 [https://make.wordpress.org/core/2020/06/18/proposal-update-all-git-
 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#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list