Skip to content

info provider for pololu.com - #1577

Merged
jbtronics merged 3 commits into
Part-DB:masterfrom
samyk:provider-pololu
Oct 5, 2026
Merged

jbtronics merged 3 commits into
Part-DB:masterfrom
samyk:provider-pololu

Conversation

@samyk

@samyk samyk commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Adds an info provider for the Pololu shop, in the style of the Pollin and Reichelt providers: pololu.com has no API, so it reads the shop's pages. It needs no key and is off until PROVIDER_POLOLU_ENABLED=1 is set.

What it does:

  • Search by keyword or Pololu item number via the shop's product search (first result page, 10 results). An item number as keyword returns exactly that product.
  • Details from the product page, plus the "Specs" and "Resources" tabs when the product has them (up to three page requests).
  • Returns name, short description, category (breadcrumbs), manufacturer (the "Brand:" field), manufacturing status, product URL, the description tab as notes, all pictures at full size with captions, USD price breaks, stock, the files under "File downloads" (datasheets, dimension diagrams, 3D models, drill guides) plus recommended links that point directly at a file, the Specs tables as parameters (grouped by heading), and the mass from "Weight".
  • The item number is the provider id and the supplier part number. It is used as MPN only when the brand is Pololu; for resold products (e.g. Tamiya) the MPN is left empty rather than set to Pololu's number.
  • Implements URLHandlerInfoProviderInterface for pololu.com/product/<n> URLs.

Politeness:

  • A requestDelay setting (PROVIDER_POLOLU_REQUEST_DELAY, default 1 s) is the minimum time between two page requests; the last-request time is kept in the cache so it holds across requests.
  • After an HTTP 403, 429 or 503 the provider throws and sends nothing for one hour.

Includes unit tests with mocked HTTP (11 tests), the settings class, four translation strings and a docs section.

Notes for review:

  • Verified against the live site for a Pololu-brand product (2130) and a resold one (2196). The manufacturing status mapping beyond "Active and Preferred" is keyword-based and was only seen for that one value.
  • Sale prices: the code takes the last number in the price cell; no product on sale was seen.
  • There is no captcha detection, only the three status codes.

samyk added 2 commits October 3, 2026 14:16
Pololu has no API, so like the Pollin and Reichelt providers this one reads the
website: the products-only search for keywords and item numbers, and the
product page for name, description, brand, status, category, all pictures,
price breaks and stock. Specifications and file downloads (dimension diagrams,
3D models, datasheets) live on separate tabs, which are only requested when
the product page links them, so a lookup needs at most three page requests.

The Pololu item number is the provider id and order number. It is only used
as MPN for Pololu's own products, as the shop also sells other brands.

Pololu is a small shop, so the page requests are spaced by a configurable
delay (PROVIDER_POLOLU_REQUEST_DELAY) and the provider stops sending requests
for an hour once the site answers with 403, 429 or 503.
@codecov

codecov Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.10526% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.66%. Comparing base (a7f2d49) to head (e10b656).

Files with missing lines Patch % Lines
...es/InfoProviderSystem/Providers/PololuProvider.php 92.10% 21 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1577      +/-   ##
============================================
+ Coverage     64.46%   64.66%   +0.20%     
- Complexity    10210    10316     +106     
============================================
  Files           762      763       +1     
  Lines         32711    32977     +266     
============================================
+ Hits          21087    21326     +239     
- Misses        11624    11651      +27     

☔ View full report in Codecov by Harness.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jbtronics

Copy link
Copy Markdown
Member

Looks good.

Thank you.

@jbtronics
jbtronics merged commit 8d3a550 into Part-DB:master Oct 5, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants