Repository navigation
test(catalog): pin the two model-preset convergence calls (#2465) - #2606
Conversation
|
✅ Deterministic PR hygiene checks passed. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe convergence contract tests now expect eight calls in ChangesConvergence contract coverage
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 43b50c7aac
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const handlerBody = source.slice(handlerStart, source.indexOf("url.pathname ===", handlerStart + 1)); | ||
| // The "all" branch and the materialize branch each converge; "custom" only moves the marker, | ||
| // so it deliberately does not. | ||
| expect(handlerBody.match(/await convergeCodexCatalog\(\)/g)?.length).toBe(2); |
There was a problem hiding this comment.
Assert convergence in each preset branch
This assertion only counts two calls anywhere in the entire PUT handler, so it still passes if the required all or preset branch loses its convergence call while the custom branch gains one, even though the test explicitly intends to pin both write paths and ensure custom does not converge. Split the handler into branch-specific slices and assert one call in all, zero in custom, and one in the materialization path, or invoke each mode with a convergence spy.
Useful? React with 👍 / 👎.
Summary
tests/codex-convergence-contract.test.tscountsconvergeCodexCatalog()calls per route file. #2465 added two/api/model-presetswrite paths, somodel-routes.tswent 6 -> 8 and the inventory assertion went red ondevat 10c2570.Raising the number alone would have been the wrong repair: the file's own comment says a count that only ever rises stops being a contract. So this raises the count and adds a companion assertion that names the two calls it accounts for — the "all" branch and the materialize branch of
PUT /api/model-presets, both of which change which models reach the catalog. The "custom" branch only moves the marker and deliberately does not converge, which the new test also pins by expecting exactly 2 rather than 3.Verification
Falsified: reverting the count to 6 makes the inventory test fail; deleting one
await convergeCodexCatalog()from the preset handler makes the new companion test fail while the (then-stale) count would still pass. Both directions checked.Checklist
devdocs-site/updateSummary by CodeRabbit