Repository navigation
Fix the plugin catalog route test count - #1136
Conversation
The route test asserted a hardcoded bundled plugin count of 13. Commit f13c2d3 removed the T3 sidebar plugin from the official catalog, so the real count is 12. The test broke CI on main. Derive the three counts from the registry, the same as the sibling service test. A future plugin add or remove will not break this test again. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
🚨 SLOP COP 🚨 · I am the SlopCop. I am now reviewing this pull request for security, code quality, performance, duplication, architecture, and test coverage. |
SawyerHood
left a comment
There was a problem hiding this comment.
🚨 SLOP COP 🚨 · review
ELI5: The test used a fixed plugin count. One plugin left the catalog, so the fixed count became wrong. This change counts the lists directly.
I found no blocking issue and no inline finding.
- Security: This change affects test code only. The new registry import adds no network, file-write, authentication, or dependency risk.
- Code quality: The three expressions match the registry and the sibling service test. They still detect an incorrect
autoInstallfilter. - Performance: The imported module already exists in the test graph. This change adds no runtime cost or material test cost.
- Validation: The forced plugin-catalog test passed at the pull request SHA. Both files and all seven tests passed.
- CI: All completed GitHub checks passed. The compatibility job skipped as expected.
The wider scan found old 13 / 8 / 5 values in unrelated mock and schema fixtures. Those values do not control catalog behavior.
The scan also found two pre-existing plugin-management UI trees. That architecture issue does not affect this small test fix.
I did not start a browser test because the pull request changes no runtime route or UI behavior. The focused test sends Hono requests through the real route and database.
## Summary - Derive `pluginCount`, `includedPluginCount`, and `optionalPluginCount` in `plugin-catalog-routes.test.ts` from the bundled plugin registry instead of hardcoding `13 / 8 / 5`. ## Why CI is red on `main`. Commit f13c2d3 ("Move T3 sidebar plugin to examples", get-bb#1109) removed `t3sidebar` from `OFFICIAL_PLUGINS`, so the bundled catalog went from 13 plugins to 12. That PR updated `plugin-catalog-service.test.ts`, which derives its counts from the registry, but it missed the route test, which hardcoded the numbers. ``` AssertionError: expected { catalog: { pluginCount: 12, ... } } to match object { catalog: { pluginCount: 13, ... } } ``` get-bb#1109 landed without a green run: its own CI run (31186905645) was cancelled when get-bb#1108 pushed on top of it. The route test now uses the same source of truth as the service test, so a future plugin add or remove will not break it again. ## Tests - `pnpm exec turbo run test --filter=@bb/server -- plugin-catalog` — 7 passed. - `pnpm exec turbo run test --filter=@bb/server` — 1336 passed. One unrelated local-only failure in `internal-skill-trees.test.ts`, which asserts file mode `0o644` but writes the file with no explicit `chmod`. It follows the umask, so it fails under umask `0002` and passes on CI runners under `0022`. - `pnpm exec turbo run typecheck --filter=@bb/server` — pass. - CI run 31187487485 on `main`: `Tests (server)` was the only failing job. All other jobs passed. ## Risk Test-only change. No product code is touched. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Summary
pluginCount,includedPluginCount, andoptionalPluginCountinplugin-catalog-routes.test.tsfrom the bundled plugin registry instead of hardcoding13 / 8 / 5.Why
CI is red on
main. Commit f13c2d3 ("Move T3 sidebar plugin to examples", #1109) removedt3sidebarfromOFFICIAL_PLUGINS, so the bundled catalog went from 13 plugins to 12. That PR updatedplugin-catalog-service.test.ts, which derives its counts from the registry, but it missed the route test, which hardcoded the numbers.#1109 landed without a green run: its own CI run (31186905645) was cancelled when #1108 pushed on top of it.
The route test now uses the same source of truth as the service test, so a future plugin add or remove will not break it again.
Tests
pnpm exec turbo run test --filter=@bb/server -- plugin-catalog— 7 passed.pnpm exec turbo run test --filter=@bb/server— 1336 passed. One unrelated local-only failure ininternal-skill-trees.test.ts, which asserts file mode0o644but writes the file with no explicitchmod. It follows the umask, so it fails under umask0002and passes on CI runners under0022.pnpm exec turbo run typecheck --filter=@bb/server— pass.main:Tests (server)was the only failing job. All other jobs passed.Risk
Test-only change. No product code is touched.
🤖 Generated with Claude Code