fix: support benchmark competition type - #656
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (14)
Included review availability: Your plan includes up to 1 review per rolling hour; 0 remain after this review. WalkthroughThe change adds ChangesCompetition type support
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The PR adds support for the stored benchmark competition type and exposes it only where intended; no actionable merge-blocking risk remains beyond normal checks and review. Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 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.
All reported issues were addressed across 14 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Summary
benchmarkcompetition type across the schema and capability registryInvestigation
The demo row
comp_training_guide_benchmarkalready storescompetition_type = benchmark. The blank picker was a missing application codepath; this PR does not mutate demo data.Verification
pnpm test -- test/lib/competitions/capabilities.test.ts --bail=1pnpm type-checkinapps/wodsmith-startpnpm type-checkinpackages/wodsmith-dbpnpm type-checkinapps/crewadmin@example.comlat checkSummary by cubic
Adds first-class support for the
benchmarkcompetition type and tightens type contracts so create only accepts selectable types while update accepts any registered type. Benchmark stays editable on organizer pages, uses the standard leaderboard, fails closed for capability gates, and remains hidden from generic creation.benchmarktoCOMPETITION_TYPE_REGISTRYwith no capabilities and standard leaderboard; addisCompetitionTypeValue; exposecompetitionTypeOptions()(all types) andselectableCompetitionTypeOptions()(create-only); keep unknown types safe incompetitionCan,leaderboardVariant, andisSelectableType.competitionTypeOptions()and validates withisCompetitionTypeValue; create flow validates withisSelectableCompetitionTypeValueand hard-guards selectable types before submit; server schemas useSelectableCompetitionTypeIdfor create andCompetitionTypeId+isCompetitionTypeValuefor update."in-person" | "online"withCompetitionTypeacross sidebars, leaderboard, judge scheduling, and Crew rotations; widen DB toCompetitionTypeand addCOMPETITION_TYPES.BENCHMARK; no data migration.SelectableCompetitionTypeIdis"in-person" | "online".Migration
"in-person" | "online"narrowings withCompetitionType; useSelectableCompetitionTypeIdfor create paths.Written for commit 51448e6. Summary will update on new commits.
Summary by CodeRabbit
New Features
Documentation
Tests