Make WordPress Core

Opened 2 months ago

Closed 2 months ago

#63390 closed defect (bug) (fixed)

Add version number tests for package-lock and composer files.

Reported by: peterwilsoncc's profile peterwilsoncc Owned by: peterwilsoncc's profile peterwilsoncc
Milestone: 6.8.2 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch has-unit-tests dev-reviewed
Focuses: tests Cc:

Description

WordPress currently tests the version numbers are the same for version.php, license.txt and package.json.

The same tests ought to be included for composer.json (1 instance) and package-lock.json (2 instances).

As WordPress is currently in a reduced release cadence for major releases, I intend to add these tests to both trunk and the 6.8 branch.

Pull request incoming.

Change History (6)

This ticket was mentioned in PR #8768 on WordPress/wordpress-develop by @peterwilsoncc.


2 months ago
#1

  • Keywords has-patch has-unit-tests added

Adds version number tests for composer.json and package-lock.json.

These tests are the equivalent to the existing package.json test.

Trac ticket: https://core.trac.wordpress.org/ticket/63390

Initial push breaks the version numbers to demonstrate failing tests.

#2 @peterwilsoncc
2 months ago

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

In 60219:

Build/Test Tools: Test version in additional config files.

Introduces tests to ensure the version numbers in package-lock.json (two instances) and composer.json match the WordPress version specified in version.php.

In pull requests, the package-lock.json file is updated automatically to match the version in package.json. The new test is intended to ensure the version numbers are correct in production branches.

Fixes #63390.

#3 @peterwilsoncc
2 months ago

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

Reopening to merge to the 6.8 branch.

Even thought the changes are to the tests files, I'll get another committer to sign off on the changes if someone could be so kind as to do so.

#4 @peterwilsoncc
2 months ago

In 60221:

Build/Test Tools: Fix file name references in [60219].

While it's true that package.json uses the format x.y.z, for the tests of other files using the same format it's best practice for the comments to reference the file being tested rather than provide a cool story about an unrelated file.

Cool story.

Follow up to [60219].

See #63390.

#5 @jorbin
2 months ago

  • Keywords dev-reviewed added; dev-feedback removed

[60219], [60220], [60221] all look good for backport to the 6.8 branch to me. I know [60220] isn't on this ticket, but since it touches similar tests and makes it a bit clearer what is being tested, so I think it should go in as well.

#6 @peterwilsoncc
2 months ago

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

In 60223:

Build/Test Tools: Test version in additional config files.

Introduces tests to ensure the version numbers in package-lock.json (two instances) and composer.json match the WordPress version specified in version.php.

In pull requests, the package-lock.json file is updated automatically to match the version in package.json. The new test is intended to ensure the version numbers are correct in production branches.

Reviewed by jorbin.
Merges [60219], [60221] to the 6.8 branch.

Fixes #63390.

Note: See TracTickets for help on using tickets.