Skip to content

Harden registry validator and test suite#9

Merged
bharvey88 merged 1 commit into
mainfrom
fix/7-validator-test-hardening
Jul 9, 2026
Merged

Harden registry validator and test suite#9
bharvey88 merged 1 commit into
mainfrom
fix/7-validator-test-hardening

Conversation

@bharvey88

Copy link
Copy Markdown
Collaborator

What does this change?

Closes #7. A batch of small correctness and hardening items from the #1 review: validator gaps, weak tests, and the manual-flash copy.

Validator (scripts/validate_registry.py)

  • A manifest with an empty or missing parts[] now errors instead of passing silently.
  • A part with no path key is reported as an error instead of crashing the whole run with a KeyError.
  • head_ok() now also catches TimeoutError, so a read-phase timeout is treated as "part unreachable" rather than escaping and aborting the check.
  • The structural checks are factored into a pure check_manifest_shape() so they can be unit-tested offline.

Tests

  • New scripts/test_validate_registry.py (stdlib unittest, no new deps) pins all three validator fixes. Wired into the registry CI job as an offline step ahead of the live check.
  • Category-filter test now asserts which cards are visible, not just the count, and picks its category deterministically instead of depending on devices[0]'s position.
  • New test pins the release-notes URL allowlist: an off-github.com html_url from the API must fall back to the safe https://github.com/<repo>/releases link.
  • tests/package.json npm test now runs playwright test instead of the exit-1 boilerplate.

Copy

  • Manual-flash fallback now shows esptool write-flash --port <port> 0x0 <file> (esptool v5 spelling, with the required --port).

Repo

  • Added .gitattributes with vendor/** -text so the pinned esp-web-tools copy is never line-ending-normalized.

Checklist

  • Playwright tests pass locally (cd tests && npx playwright test) (11 passed)
  • Any new runtime file/dir is added to the cp list in .github/workflows/pages.yml (n/a: no new runtime files; .gitattributes and the validator test are not shipped)
  • No new build step, framework, or runtime CDN dependency
  • If devices.json changed: python scripts/validate_registry.py passes (devices.json unchanged; ran the validator anyway, passes)

🤖 Generated with Claude Code

Closes #7.

Validator (scripts/validate_registry.py):
- Empty or missing parts[] now errors instead of passing silently.
- A part with no path is reported instead of crashing with KeyError; the
  shape check treats empty/null paths the same as the network loop's skip.
- head_ok() also catches TimeoutError, so read-phase timeouts no longer
  escape and abort the run.
- Structural checks extracted into a pure check_manifest_shape().

Tests:
- New scripts/test_validate_registry.py (stdlib unittest, no deps) pins the
  validator fixes; wired into the registry CI job as an offline step.
- Category-filter test asserts which cards are visible and picks its category
  deterministically instead of depending on devices[0].
- New test pins the release-notes URL allowlist fallback href.
- tests/package.json npm test now runs playwright test.

Copy:
- Manual-flash fallback shows esptool write-flash --port <port> 0x0 <file>.

Repo:
- Add .gitattributes with vendor/** -text.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@bharvey88, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 58 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 985aff76-f917-4b0a-8e80-eca6feeb6c96

📥 Commits

Reviewing files that changed from the base of the PR and between 84d4d29 and 665e9e1.

📒 Files selected for processing (7)
  • .gitattributes
  • .github/workflows/validate.yml
  • js/views/device.js
  • scripts/test_validate_registry.py
  • scripts/validate_registry.py
  • tests/installer.spec.js
  • tests/package.json
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/7-validator-test-hardening

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.

@bharvey88 bharvey88 merged commit b45fe28 into main Jul 9, 2026
3 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.

Validator and test hardening

1 participant