Skip to content

Conversation

malinajirka
Copy link
Contributor

#WOOMOB-1501

Description

This PR replaces /wc-analytics/variations with /v3/variations endpoint.

Note: WooCommerce 10.3+ is required as the new endpoint isn't available on the previous versions.

Testing information

  1. Clear apps data
  2. Login
  3. Wait until the Local Catalog worker finishes (you can observe logs)
  4. Verify it completes successfully and use app inspector to check the PosVariations table contains data

The tests that have been performed

The above

Images/gif

N/A

  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if necessary. Use the "[Internal]" label for non-user-facing changes.

@malinajirka malinajirka added this to the 23.5 milestone Oct 14, 2025
@malinajirka malinajirka requested a review from Copilot October 14, 2025 18:13
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the product variations endpoint from the deprecated WooCommerce Analytics API to the standard WooCommerce v3 REST API, requiring WooCommerce 10.3+ for compatibility.

  • Replaces /wc-analytics/variations with /v3/variations endpoint
  • Updates endpoint configuration and API client implementation
  • Adds new variations endpoint to the API endpoints list

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
wc-wp-api-endpoints.txt Adds the new /variations/ endpoint to the API endpoints configuration
WooPosProductRestClient.kt Updates the variations fetching method to use the v3 endpoint instead of wc-analytics

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@wpmobilebot
Copy link
Collaborator

📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
App NameWooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commit5788735
Direct Downloadwoocommerce-wear-prototype-build-pr14757-5788735.apk

@wpmobilebot
Copy link
Collaborator

📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.

App NameWooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commit5788735
Direct Downloadwoocommerce-prototype-build-pr14757-5788735.apk

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 38.37%. Comparing base (277fac2) to head (5788735).
⚠️ Report is 2 commits behind head on trunk.

Files with missing lines Patch % Lines
...st/wpcom/wc/product/pos/WooPosProductRestClient.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##              trunk   #14757      +/-   ##
============================================
- Coverage     38.37%   38.37%   -0.01%     
+ Complexity    10008    10007       -1     
============================================
  Files          2115     2115              
  Lines        118142   118142              
  Branches      15779    15779              
============================================
- Hits          45336    45335       -1     
  Misses        68597    68597              
- Partials       4209     4210       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@samiuelson samiuelson self-assigned this Oct 15, 2025
@samiuelson samiuelson requested a review from Copilot October 15, 2025 12:13
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@samiuelson samiuelson left a comment

Choose a reason for hiding this comment

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

Hi, @malinajirka, I'm getting error during variations sync:

E  Local Catalog Variations sync failed on page 1: Missing required header in response: Server Date.
E  Failed to sync variations: Missing required header in response: Server Date.
E  Local catalog FULL sync failed: Missing required header in response: Server Date.. Retrying ...

Could you please try to reproduce it on your end? I just logged into the fresh-installed app and opened POS.

@malinajirka
Copy link
Contributor Author

Thanks for looking into this @samiuelson! What version of WooCommerce are you using on your site? The failure seems to suggest the endpoint isn't available. This PR requires version 10.3+ as mentioned in the description. Let me know if you are able to reproduce the issue even 10.3+, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants