Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Syncpack and use it to pin @wordpress packages to wp-6.0 #37034

Merged
merged 36 commits into from Mar 8, 2023

Conversation

samueljseay
Copy link
Contributor

@samueljseay samueljseay commented Mar 2, 2023

All Submissions:

Changes proposed in this Pull Request:

There is a desire to sync all @wordpress packages in the repository to the same versions for consistency. We chose to match L2 as the version. Wordpress 6.2 will be released at the end of March which will put us at package version 6.0 for the next Wordpress release (7.6.0) so I'm pre-emptively setting the version to 6.0 here. Another reason I jumped to 6.0 is that the 5.9 packages are really looking old now and caused quite a few problems/conflicts.

But, important note we don't need to pin @wordpress dependencies that are used as part of dev or testing because these dependencies are not exposed in Wordpress itself. This PR excludes those dependencies from being synchronized. At some point we may want to update and sync these dependencies (but not to wp-6.0) but it can be done one piece at a time because wholesale updating them could cause issues for teams that we haven't anticipated.

Other things of note:

  • I updated syncpack to latest version. It has more informative output and fixes some oddities I saw during dev.

  • Updating versions required fixing an issue with PostCSS version being used. I moved the postcss-loader to 4+ and with that you need to depend on postcss directly as well, I opted for 8+ which is already a dependency of the admin package.

  • I excluded block editor packages in product-editor. This is because this project is bleeding edge WIP utilising block editor directly, and I don't want to cause issues for them as they are probably relying on latest APIs right now.

  • I pinned @types/wordpress__components to try and best match the types of the components package in 6.0 as possible.

How to test the changes in this Pull Request:

Notes for testing/review:

  1. A lot of the file changes here were automated by Syncpack, I don't expect you to check them all.
  2. Probably the most valuable testing here would be a smoke test of the application. I would use the Live Branches feature to test this. (Please reach out if you need help enabling this).

When I say smoke test, I mean look for things that are obviously broken or a white screen type error in the basic WooCommerce screens, including onboarding and the WooCommerce home screen.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you created a changelog file for each project being changed, ie pnpm --filter=<project> changelog add?
  • Have you included testing instructions?

FOR PR REVIEWER ONLY:

  • I have reviewed that everything is sanitized/escaped appropriately for any SQL or XSS injection possibilities. I made sure Linting is not ignored or disabled.

As part of this update, it was required to update PostCSS and
postcss-loader versions. A slight API change was needed in the
internal style build module to support this.
@github-actions github-actions bot added focus: react admin package: @woocommerce/e2e-environment Issues related to @woocommerce/e2e-environment package. package: @woocommerce/e2e-core-tests Issues related to @woocommerce/e2e-core-tests package. package: @woocommerce/e2e-utils Issues related to @woocommerce/e2e-utils package. package: @woocommerce/components issues related to @woocommerce/components package: @woocommerce/currency issues related to @woocommerce/currency package: @woocommerce/customer-effort-score issues related to @woocommerce/customer-effort-score package: @woocommerce/data issues related to @woocommerce/data package: @woocommerce/date issues related to @woocommerce/date package: @woocommerce/eslint-plugin issues related to @woocommerce/eslint-plugin package: @woocommerce/experimental issues related to @woocommerce/experimental package: @woocommerce/explat issues related to @woocommerce/explat package: @woocommerce/navigation issues related to @woocommerce/navigation package: @woocommerce/onboarding issues related to @woocommerce/onboarding package: dependency-extraction-webpack-plugin issues related to @woocommerce/dependency-extraction-webpack-plugin plugin: woocommerce Issues related to the WooCommerce Core plugin. labels Mar 2, 2023
@samueljseay samueljseay marked this pull request as ready for review March 2, 2023 10:47
@samueljseay samueljseay changed the title Use syncpack to pin @wordpress packages to wp-6.0 [WIP] Use syncpack to pin @wordpress packages to wp-6.0 Mar 2, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2023

Test Results Summary

Commit SHA: 1794a6f

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202610m 49s
E2E Tests189006019513m 39s

To view the full API test report, click here.
To view the full E2E test report, click here.
To view all test reports, visit the WooCommerce Test Reports Dashboard.

@codecov
Copy link

codecov bot commented Mar 2, 2023

Codecov Report

Merging #37034 (1794a6f) into trunk (6f8f35b) will increase coverage by 0.0%.
The diff coverage is 100.0%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##             trunk   #37034   +/-   ##
========================================
  Coverage     46.7%    46.7%           
+ Complexity   17188    17187    -1     
========================================
  Files          429      429           
  Lines        64821    64828    +7     
========================================
+ Hits         30251    30274   +23     
+ Misses       34570    34554   -16     
Impacted Files Coverage Δ
plugins/woocommerce/includes/class-wc-tracker.php 89.8% <100.0%> (+0.1%) ⬆️
.../includes/import/class-wc-product-csv-importer.php 75.1% <100.0%> (+0.2%) ⬆️
...lugins/woocommerce/includes/wc-order-functions.php 76.4% <100.0%> (+0.1%) ⬆️
...udes/data-stores/class-wc-order-data-store-cpt.php 91.1% <0.0%> (+3.5%) ⬆️

@github-actions github-actions bot added package: @woocommerce/api Issues related to @woocommerce/api package. package: @woocommerce/admin-e2e-tests issues related to @woocommerce/admin-e2e-tests labels Mar 7, 2023
@samueljseay samueljseay requested review from a team and jonathansadowski and removed request for a team March 7, 2023 22:09
@samueljseay samueljseay changed the title [WIP] Use syncpack to pin @wordpress packages to wp-6.0 Use syncpack to pin @wordpress packages to wp-6.0 Mar 7, 2023
@samueljseay samueljseay changed the title Use syncpack to pin @wordpress packages to wp-6.0 Update Syncpack and use it to pin @wordpress packages to wp-6.0 Mar 7, 2023
@samueljseay
Copy link
Contributor Author

@lsinger was asking about my process with Syncpack so I thought I'd put it here.

When you want to update a dependency via Syncpack you can start by adding a dependency group filter like the ones I added in syncpackrc as part of this PR.

Once you've done that there will be some packages out of date. I used to wholesale update them all at once but I've been bitten by that before so instead now I do:

pnpm syncpack list-mismatches

This will list all the places your dependency group is out of date.

Now rather than running blind pnpm syncpack fix-mismatches I like to fix it package by package so user --filter

pnpm syncpack fix-mismatches --filter <package name>

Then you can update the lockfile by running pnpm i and then do all the checks you feel are appropriate, e.g. I run:

pnpm build # at root
pnpm run -r --filter='release-posts' --filter='woocommerce/client/admin...' --filter='!@woocommerce/e2e*' --filter='!@woocommerce/api' --color lint # the CI lint
pnpm test # at root

If you're happy with that then you can commit changes to the lock file and package json files and move on to the next dependency. As time goes on we should need less of these mass wholesale dep changes because we'll have most things in sync with syncpack.

Copy link
Contributor

@jonathansadowski jonathansadowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this. Based on e2e tests passing as well as some manual testing, I'm satisfied that there aren't any serious regressions because of it. Great work 👍

@samueljseay samueljseay merged commit bec3ec1 into trunk Mar 8, 2023
21 checks passed
@samueljseay samueljseay deleted the dev/pin-wp-deps-6 branch March 8, 2023 21:13
@github-actions github-actions bot added this to the 7.6.0 milestone Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: dependency-extraction-webpack-plugin issues related to @woocommerce/dependency-extraction-webpack-plugin package: @woocommerce/admin-e2e-tests issues related to @woocommerce/admin-e2e-tests package: @woocommerce/api Issues related to @woocommerce/api package. package: @woocommerce/components issues related to @woocommerce/components package: @woocommerce/currency issues related to @woocommerce/currency package: @woocommerce/customer-effort-score issues related to @woocommerce/customer-effort-score package: @woocommerce/data issues related to @woocommerce/data package: @woocommerce/date issues related to @woocommerce/date package: @woocommerce/e2e-core-tests Issues related to @woocommerce/e2e-core-tests package. package: @woocommerce/e2e-environment Issues related to @woocommerce/e2e-environment package. package: @woocommerce/e2e-utils Issues related to @woocommerce/e2e-utils package. package: @woocommerce/eslint-plugin issues related to @woocommerce/eslint-plugin package: @woocommerce/experimental issues related to @woocommerce/experimental package: @woocommerce/explat issues related to @woocommerce/explat package: @woocommerce/navigation issues related to @woocommerce/navigation package: @woocommerce/onboarding issues related to @woocommerce/onboarding plugin: woocommerce Issues related to the WooCommerce Core plugin.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants