Skip to content

Add SparkFun USB PID supplement - #902

Merged
zackees merged 1 commit into
mainfrom
codex/sparkfun-usb-pids
Jun 30, 2026
Merged

Add SparkFun USB PID supplement#902
zackees merged 1 commit into
mainfrom
codex/sparkfun-usb-pids

Conversation

@zackees

@zackeeszackees commented Jun 30, 2026

Copy link
Copy Markdown
Member

Summary

  • add a SparkFun USB PID fetcher for VID 1b4f with separate first-party and supplemental tiers
  • wire first-party SparkFun rows before generic USB-ID feeds and weak third-party rows after generic/first-party sources
  • document SparkFun source caveats and add focused parser tests

Source notes

  • SparkFun does not appear to publish a single public USB PID registry; sparkfun/usb-pid, sparkfun/usb-pids, and matching raw allocation-table paths return 404.
  • First-party rows come from SparkFun-maintained Arduino board packages, product-repo board files, UF2 �oard_config.h, and SparkFun product CircuitPython descriptors.
  • Weak supplemental rows come from PlatformIO �uild.hwids and Adafruit CircuitPython descriptors for SparkFun-named boards; they fill gaps only and do not override first-party rows.
  • A live fetch emitted 37 first-party rows, 37 supplemental rows, and 49 combined gap-fill rows. Spot checks: 1b4f:9206 Pro Micro 5V/16MHz, 1b4f:f016 SAMD51 Thing Plus, 1b4f:0035 Pro Micro ESP32-C3, 1b4f:8d24 Qwiic Micro, weak-only 1b4f:0027 ESP32-S2 Thing Plus, weak-only 1b4f:002e Teensy MicroMod, and ambiguous 1b4f:002a LoRaSerial / nRF52840 Mini Breakout.
  • SparkFun Apollo3 still has no SparkFun VID/PID rows in its package; Artemis/Apollo3 remains a CH340 bridge hint case. VID/PID rows are USB product metadata and do not prove fbuild support for boards missing from crates/fbuild-config/assets/boards.

Validation

  • uv run --no-project --with pytest pytest online-data-tools/test_sparkfun_usb_pids.py -q
  • ruff check online-data-tools/fetch_sparkfun_usb_pids.py online-data-tools/test_sparkfun_usb_pids.py
  • actionlint .github/workflows/update-data.yml
  • git diff --check
  • uv run --no-project --script online-data-tools/fetch_sparkfun_usb_pids.py --tier first-party --out $env:TEMP\sparkfun-first-party-usb-pids.json
  • uv run --no-project --script online-data-tools/fetch_sparkfun_usb_pids.py --tier supplemental --out $env:TEMP\sparkfun-supplemental-usb-pids.json
  • uv run --no-project --script online-data-tools/fetch_sparkfun_usb_pids.py --tier all --out $env:TEMP\sparkfun-all-usb-pids.json

Closes#736

Summary by CodeRabbit

  • New Features

    • Expanded SparkFun USB PID data ingestion to combine multiple source tiers and show their status in the update summary.
    • Added support for an additional SparkFun PID supplement source in the data tools.
  • Documentation

    • Updated the data tools guide with SparkFun-specific sourcing details and the new test command.
  • Tests

    • Added coverage for SparkFun PID parsing, merging behavior, and output generation.

@coderabbitai

coderabbitaiBot commented Jun 30, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 01232d1d-182d-4c29-8480-78dcd0ac3d95

📥 Commits

Reviewing files that changed from the base of the PR and between a78044e and 147a926.

📒 Files selected for processing (4)
  • .github/workflows/update-data.yml
  • online-data-tools/README.md
  • online-data-tools/fetch_sparkfun_usb_pids.py
  • online-data-tools/test_sparkfun_usb_pids.py

📝 Walkthrough

Walkthrough

This PR adds a new fetch_sparkfun_usb_pids.py script that scrapes SparkFun USB VID/PID data from boards.txt, USB descriptor headers, PlatformIO, and CircuitPython sources across two tiers, merges them, and writes JSON output. It includes a pytest suite, README documentation, and workflow wiring in update-data.yml for fetch, merge, and summary steps.

Changes

SparkFun USB PID supplement

Layer / File(s)Summary
Fetch script foundations
online-data-tools/fetch_sparkfun_usb_pids.py
Defines module purpose, constants, source dataclasses/configuration, regex patterns, and string/merge helper utilities.
Source parsers
online-data-tools/fetch_sparkfun_usb_pids.py
Implements parsers for boards.txt, USB descriptor text, and PlatformIO board JSON, filtering to SparkFun VID 1b4f.
Tiered collection logic
online-data-tools/fetch_sparkfun_usb_pids.py
Adds GitHub tree-walking helpers and collect_first_party/collect_platformio/collect_circuitpython/collect_supplemental/collect functions that fetch, merge, and gap-fill across tiers.
CLI entrypoint
online-data-tools/fetch_sparkfun_usb_pids.py
Implements main() parsing --tier/--out, writing sorted JSON output.
Test suite
online-data-tools/test_sparkfun_usb_pids.py
Adds fixtures and tests covering boards.txt, descriptor, and PlatformIO parsing, tier-merge gap-filling, and main() CLI behavior.
Workflow wiring
.github/workflows/update-data.yml
Adds tier-1/tier-4 fetch steps, conditionally includes their JSON in merge args, and extends the summary table.
README documentation
online-data-tools/README.md
Documents the new script, SparkFun tier rules, Apollo3 handling, and the new test command.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related issues

Poem

A rabbit hopped through SparkFun's trees,
Gathering PIDs with greatest ease 🐰
Tier one first, then tier four weak,
Merged and sorted, JSON sleek.
Boards.txt, descriptors, hwids too —
Hop along, the data's true! 🥕

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/sparkfun-usb-pids

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@zackees
zackees merged commit 1c78c67 into mainJun 30, 2026
6 of 14 checks passed
@zackees
zackees deleted the codex/sparkfun-usb-pids branch June 30, 2026 22:22
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

vid-ingest: SparkFun Electronics (0x1B4F — RedBoard/Pro Micro/Thing Plus)

1 participant

@zackees