Skip to content

Conversation

@tbradsha
Copy link
Contributor

@tbradsha tbradsha commented Nov 18, 2025

Closes MONOREP-232

This PR runs Phan against older Woo stubs. I've put the new test in the linting workflow (now that said workflow runs on trunk as well).

Proposed changes:

We've had a few cases where Jetpack releases have unleashed some fatals because an assumption that users ran fairly recent WooCommerce versions.

p1759248959778399/1759158780.923629-slack-CK365S85V
p1763478353571209/1763474992.105219-slack-CK365S85V
p1759758846239149/1759158780.923629-slack-CK365S85V

If there's a need we could consider generating new woocommerce-internal stubs, but that'd be for another PR should we want.

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

Does this pull request change what data or activity we track or use?

Testing instructions:

Hopefully there's a new "Static analysis (WooCommerce)" job in the CI that completes successfully.

@github-actions github-actions bot added the Actions GitHub actions used to automate some of the work around releases and repository management label Nov 18, 2025
@github-actions
Copy link
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add a "[Type]" label (Bug, Enhancement, Janitorial, Task).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

@tbradsha tbradsha force-pushed the add/tooling/phan_against_woo branch from b7738ec to ef7fcd5 Compare November 18, 2025 22:09
@jp-launch-control
Copy link

jp-launch-control bot commented Nov 18, 2025

Code Coverage Summary

This PR did not change code coverage!

That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷

Full summary · PHP report · JS report

@tbradsha tbradsha force-pushed the add/tooling/phan_against_woo branch from 594a55a to 4e09285 Compare November 19, 2025 16:16
@tbradsha tbradsha force-pushed the add/tooling/phan_against_woo branch from e31ce66 to baa5f13 Compare November 20, 2025 16:06
@tbradsha tbradsha added [Status] Needs Review This PR is ready for review. and removed [Status] In Progress labels Nov 20, 2025
@tbradsha tbradsha requested a review from a team November 20, 2025 16:53
Comment on lines +618 to +622
- name: Run Phan against WooCommerce 7.0 stubs
env:
WOO_VERSION: '7.0'
run: |
composer require --dev "php-stubs/woocommerce-stubs:${WOO_VERSION}"
Copy link
Contributor

Choose a reason for hiding this comment

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

We could merge this into the existing Phan run as a three line change: two adding the WOO_VERSION constant with a comment and one adding "php-stubs/woocommerce-stubs:${WOO_VERSION}" to the existing composer update command.

Is there a benefit to doing this as a completely separate run?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, four lines: one more to mention old-Woo in the name of the step too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Initially I had it configured to run on 4 Woo versions, so a separate job made sense.

Now it's only running on one Woo version, and it'd be a simple change to move it into the current Phan run, but that already takes 10 minutes. Adding the old Woo run to the existing one would extend that another 5 minutes (wall time), which is a painful amount of time to wait for something to pass or fail.

Copy link
Contributor

Choose a reason for hiding this comment

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

Adding the old Woo run to the existing one would extend that another 5 minutes (wall time)

That's not what I suggested. Still two runs, just the second would be "old WP and old Woo" instead of only "old WP" (and this separate one for "old Woo").

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Misread. Sounds like a plan!

@tbradsha
Copy link
Contributor Author

I'll close this in favor of a new one after #46026 is merged.

@tbradsha tbradsha closed this Nov 20, 2025
@github-actions github-actions bot removed the [Status] Needs Review This PR is ready for review. label Nov 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Actions GitHub actions used to automate some of the work around releases and repository management [Type] Janitorial

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants