Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#55668 closed defect (bug) (fixed)

skipOnAutomatedBranches() does not work as expected, take 2

Reported by: sergeybiryukov's profile SergeyBiryukov Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.0.1 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch commit dev-reviewed
Focuses: Cc:

Description (last modified by SergeyBiryukov)

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 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 events that trigger workflows, the event name can never be 'false' as a string.

Attachments (1)

55668.diff (4.4 KB) - added by SergeyBiryukov 2 years ago.

Download all attachments as: .zip

Change History (11)

@SergeyBiryukov
2 years ago

#1 @SergeyBiryukov
2 years ago

  • Description modified (diff)

#2 @SergeyBiryukov
2 years ago

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

In 53349:

Build/Test Tools: Pass GitHub Actions environment variables to the Docker container.

This ensures that WP_UnitTestCase::skipOnAutomatedBranches() has access to the GITHUB_REF and GITHUB_EVENT_NAME variables, so that some tests can be skipped when appropriate.

Additionally, account for renaming the master branch to trunk in November 2021.

Follow-up to [40241], [46999], [49264], [49267], [51868].

Fixes #55668.

#3 @SergeyBiryukov
2 years ago

  • Keywords commit dev-feedback added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for backporting to the 6.0 and 5.9 branches after a second committer's review.

This ticket was mentioned in Slack in #core by sergey. View the logs.


2 years ago

#5 @SergeyBiryukov
2 years ago

  • Description modified (diff)

#6 @peterwilsoncc
2 years ago

  • Keywords dev-reviewed added; dev-feedback removed

Approved for backporting.

#7 @SergeyBiryukov
2 years ago

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

In 53350:

Build/Test Tools: Pass GitHub Actions environment variables to the Docker container.

This ensures that WP_UnitTestCase::skipOnAutomatedBranches() has access to the GITHUB_REF and GITHUB_EVENT_NAME variables, so that some tests can be skipped when appropriate.

Additionally, account for renaming the master branch to trunk in November 2021.

Follow-up to [40241], [46999], [49264], [49267], [51868].

Merges [53349] to the 6.0 branch.
Fixes #55668.

#8 @SergeyBiryukov
2 years ago

In 53351:

Build/Test Tools: Pass GitHub Actions environment variables to the Docker container.

This ensures that WP_UnitTestCase::skipOnAutomatedBranches() has access to the GITHUB_REF and GITHUB_EVENT_NAME variables, so that some tests can be skipped when appropriate.

Additionally, account for renaming the master branch to trunk in November 2021.

Follow-up to [40241], [46999], [49264], [49267], [51868].

Merges [53349] to the 5.9 branch.
Fixes #55668.

This ticket was mentioned in Slack in #core by sergey. View the logs.


2 years ago

#10 @SergeyBiryukov
2 years ago

  • Milestone changed from 5.9.4 to 6.0.1

Moving this to 6.0.1 to clear the 5.9.4 milestone, it was the only ticket there.

Note: See TracTickets for help on using tickets.