Closed Bug 1836741 Opened 1 years ago Closed 1 year ago

Add initial trustwerty/fakespot client to fetch product information

Categories

(Firefox :: Shopping, task, P2)

Desktop
All
task

Tracking

()

RESOLVED FIXED
116 Branch
Tracking Status
firefox116 --- fixed

People

(Reporter: Gijs, Assigned: fchasen)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fidefe-shopping])

Attachments

(2 files, 1 obsolete file)

We should start building an API client in-tree. This should live in browser/components/shopping/, and it should not return anything unless the nimbus feature (bug 1836265) is enabled, and the user has opted in (bug 1836740).

The API notes doc should help with doing this.

Severity: -- → N/A
Type: defect → task
Priority: -- → P2
Component: General → Shopping
Assignee: nobody → fchasen

Correction to comment 0 - we want the API client code to live in toolkit, not in browser, so the android front-end can also use it.

  • Adds a shopping component in toolkit.
  • Creates a Product client to handle fetching and validating from the Shopping APIs.
  • Product config allows updating the shopping sites list and product id regex for each site.
  • Creates JSON schemas for validating the API responses.
Attachment #9339138 - Attachment description: WIP: Bug 1836741 - Shopping product client → WIP: Bug 1836741 - Shopping product client r?gijs
Attachment #9339138 - Attachment description: WIP: Bug 1836741 - Shopping product client r?gijs → Bug 1836741 - Shopping product client r?gijs
Attachment #9339138 - Attachment description: Bug 1836741 - Shopping product client r?gijs → Bug 1836741 - Shopping product client r=#shopping-reviewers
Attachment #9341303 - Attachment is obsolete: true

Adds an exported isProductURL(url) function that can accept a url string, nsIURI or URL and return if that url contains product information.

Backed out for causing failures due to ProductConfig.mjs

[task 2023-06-27T23:53:31.249Z] 23:53:31     INFO - Buffered messages finished
[task 2023-06-27T23:53:31.251Z] 23:53:31     INFO - TEST-UNEXPECTED-FAIL | browser/base/content/test/static/browser_all_files_referenced.js | there should be no unreferenced files - Got 5, expected +0
[task 2023-06-27T23:53:31.251Z] 23:53:31     INFO - Stack trace:
[task 2023-06-27T23:53:31.251Z] 23:53:31     INFO - chrome://mochikit/content/browser-test.js:test_is:1608
[task 2023-06-27T23:53:31.251Z] 23:53:31     INFO - chrome://mochitests/content/browser/browser/base/content/test/static/browser_all_files_referenced.js:checkAllTheFiles:1026
[task 2023-06-27T23:53:31.252Z] 23:53:31     INFO - chrome://mochikit/content/browser-test.js:handleTask:1131
[task 2023-06-27T23:53:31.252Z] 23:53:31     INFO - chrome://mochikit/content/browser-test.js:_runTaskBasedTest:1203
[task 2023-06-27T23:53:31.252Z] 23:53:31     INFO - chrome://mochikit/content/browser-test.js:Tester_execTest:1345
[task 2023-06-27T23:53:31.253Z] 23:53:31     INFO - chrome://mochikit/content/browser-test.js:nextTest/<:1120
[task 2023-06-27T23:53:31.253Z] 23:53:31     INFO - chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus/<:1056
[task 2023-06-27T23:53:31.254Z] 23:53:31     INFO - Not taking screenshot here: see the one that was previously logged
[task 2023-06-27T23:53:31.255Z] 23:53:31     INFO - TEST-UNEXPECTED-FAIL | browser/base/content/test/static/browser_all_files_referenced.js | file only referenced from unreferenced files: chrome://global/content/shopping/ProductConfig.mjs referenced from chrome://global/content/shopping/ShoppingProduct.mjs - 
[task 2023-06-27T23:53:31.255Z] 23:53:31     INFO - Stack trace:
[task 2023-06-27T23:53:31.256Z] 23:53:31     INFO - chrome://mochikit/content/browser-test.js:test_ok:1580
[task 2023-06-27T23:53:31.256Z] 23:53:31     INFO - chrome://mochitests/content/browser/browser/base/content/test/static/browser_all_files_referenced.js:checkAllTheFiles:1037
[task 2023-06-27T23:53:31.256Z] 23:53:31     INFO - chrome://mochikit/content/browser-test.js:handleTask:1131
[task 2023-06-27T23:53:31.257Z] 23:53:31     INFO - chrome://mochikit/content/browser-test.js:_runTaskBasedTest:1203
[task 2023-06-27T23:53:31.257Z] 23:53:31     INFO - chrome://mochikit/content/browser-test.js:Tester_execTest:1345
[task 2023-06-27T23:53:31.258Z] 23:53:31     INFO - chrome://mochikit/content/browser-test.js:nextTest/<:1120
[task 2023-06-27T23:53:31.258Z] 23:53:31     INFO - chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus/<:1056
[task 2023-06-27T23:53:31.259Z] 23:53:31     INFO - Not taking screenshot here: see the one that was previously logged
Flags: needinfo?(fchasen)
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 116 Branch
Pushed by fchasen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a60baa68669b Add isProductURL check in ShoppingProduct r=jhirsch
Backout by csabou@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0873af398c2c Backed out changeset a60baa68669b for causing xpcshell failures on test_product.js.
Flags: needinfo?(fchasen)
Attachment #9341400 - Attachment description: Bug 1836741 - Add isProductURL check in ShoppingProduct r?jhirsch → Bug 1836741 - Add isProductURL check in ShoppingProduct r=jhirsch
Pushed by fchasen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7f69c86c9261 Add isProductURL check in ShoppingProduct r=jhirsch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: