Skip to content

[#567] Fix pre-event judging setup and access - #568

Merged
DVidal1205 merged 2 commits into
mainfrom
codex/fix-prod-judging-flow
Sep 13, 2026
Merged

[#567] Fix pre-event judging setup and access#568
DVidal1205 merged 2 commits into
mainfrom
codex/fix-prod-judging-flow

Conversation

@DVidal1205

Copy link
Copy Markdown
Contributor

Why

The production KH IX judging flow could not be prepared before judges entered rooms. Schedule capacity was derived from live room presence, the judge project page failed when KH IX was upcoming, and room activation redirected to the container origin.

What

Closes: #567

  • Build schedule capacity from configured rooms, independent of current judge presence.
  • Default judging to the active hackathon or nearest upcoming start date with stable tie-breaking.
  • Add a hackathon dropdown for authenticated judges so they can browse historical projects read-only; preserve unrestricted officer previews and keep guests room-bound.
  • Keep room presence and announcements tied to the current judging event while browsing history.
  • Build activation redirects from the configured public Blade URL.
  • Add regression coverage and update the judging feature artifacts.

Test Plan

  • Manually inspected production KH IX Setup, Projects, Rooms, Schedule, Hacker access, and Evaluations; switched to KH VIII and back. Reproduced the reported failures and found no additional blocker.
  • Confirmed the production server error in Coolify logs and traced it to upcoming-hackathon scope selection.
  • pnpm --filter=@forge/blade exec vitest run src/tests/judging/prod-flow-regressions.test.tsx src/tests/projects/project-judge-privacy.test.tsx — 30 passed.
  • Disposable Postgres integration run for judging access and schedule — 9 passed.
  • API surface and solver tests — 13 passed.
  • pnpm verify:precommit — passed.
  • pnpm build — passed (21 tasks).
  • Final API/security, Next boundary, and test-coverage reviews — no remaining findings.

Checklist

  • Database: No schema changes, OR I ran pnpm db:generate and committed the generated files in packages/db/drizzle/
  • Environment Variables: No environment variables changed, OR I have contacted the Development Lead to modify them on Coolify BEFORE merging.

Co-authored-by: Codex <codex@openai.com>
@DVidal1205 DVidal1205 added Bug Something isn't working Minor Small change - 1 reviewer required Blade Change modifies code in Blade app API Change modifies code in the global API/tRPC package labels Sep 12, 2026
@DVidal1205 DVidal1205 self-assigned this Sep 12, 2026
Co-authored-by: Codex <codex@openai.com>
@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

📝 Walkthrough

Walkthrough

The change updates judging to select the active or nearest upcoming hackathon, support historical read-only browsing for authenticated judges, and keep guests bound to their room hackathon. It adds judge hackathon listing and access checks, uses the configured public redirect URL, and adds regression coverage. Schedule generation now includes configured rooms without current judge staffing.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: 🔵 Low · up to 1d2d9

Historical browsing can show operational data from the wrong event, and legacy MLH room configuration can leak into saved schedules. These bounded issues should be corrected before production use.

🚥 Pre-merge checks | ✅ 6 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 13 files. (12 skipped… Write docstrings for the functions missing them to satisfy the coverage threshold.
Linked Issues check ❓ Inconclusive The summary supports schedule capacity from configured rooms, active/upcoming selection, judge history access, read-only historical views, guest room binding, public URL redirects, presence retention,… Provide implementation or test evidence that equal-start upcoming hackathons use stable ID tie-breaking.
✅ Passed checks (6 passed)
Check name Status Explanation
Title check ✅ Passed The title starts with the required issue number, describes the judging setup and access changes, and is 45 characters long.
Description check ✅ Passed The description directly explains the schedule, judging access, redirect, testing, and validation changes in the pull request.
Out of Scope Changes check ✅ Passed The changed source, tests, solver updates, and judging feature artifacts directly support issue #567. No unrelated change is demonstrated. The summary reports no schema, dependency, or environment-var…
No Hardcoded Secrets ✅ Passed No hardcoded API keys, passwords, tokens, or secret values appear in the pull-request additions. Credential-related code uses environment variables, generated random values, or runtime credentials suc…
Validated Env Access ✅ Passed No changed file adds direct process.env access. The activation route imports env from ~/env and uses env.BLADE_URL and env.NODE_ENV. Existing process.env references remain in unchanged val…
No Typescript Escape Hatches ✅ Passed No prohibited TypeScript escape hatches were introduced. The pull-request additions contain no any type, @ts-ignore, @ts-expect-error, or non-null assertion expressions. Structural and diff sear…
Full details: Linked Issues check

Explanation

The summary supports schedule capacity from configured rooms, active/upcoming selection, judge history access, read-only historical views, guest room binding, public URL redirects, presence retention, and regression coverage for issue #567. It does not establish stable ID tie-breaking when upcoming hackathons have equal start dates. The available test summary also does not state coverage for that case.

Full details: Docstring Coverage

Explanation

Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 13 files. (12 skipped: 12 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-prod-judging-flow

Warning

Some tools did not complete. Review the errors below.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

apps/blade/src/app/_components/projects/judge-project-workspace.tsx

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

apps/blade/src/app/judge/activate/[linkId]/route.ts

ESLint skipped: the matched ESLint configuration already failed (missing-dependency).

apps/blade/src/app/judge/projects/page.tsx

ESLint skipped: the matched ESLint configuration already failed (missing-dependency).

  • 10 others

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.

🟡 Other comments (3)
packages/api/src/utils/judging-schedule/source.ts-114-114 (1)

114-114: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Exclude MLH rooms from scheduled-room selection. isScheduled is mutable, and imports retain legacy challenge rows, so a root challenge labeled MLH can remain scheduled. Its building-backed room enters eligibleRooms, reaches the solver, and can appear in a saved appointment. Apply a case-insensitive challengeLabel exclusion here and in appointmentMoveChoices.

packages/api/src/routers/judging.ts-205-213 (1)

205-213: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Keep operational context on the current judging event.

When hackathonId is supplied, getContext and listAnnouncements use it for rooms, presence, and announcements. A historical or future ID can therefore return stale or future operational state. Resolve those queries with the active or nearest-upcoming hackathon, and use the requested ID only for workspace data.

.forge/features/project-judging-scheduler/spec.md-125-125 (1)

125-125: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Align the scope requirement with AC02.

Replace “in a room with judges for that challenge” with “in a scheduled room for that challenge.” The current wording conflicts with the defined rule that judge presence is operational status, not scheduling capacity.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: QUIET

Plan: Advanced

Run ID: b345e1dc-824f-4fbb-843c-6b5aebf25687

📥 Commits

Reviewing files that changed from the base of the PR and between 5737bb5 and 1d2d90c.

⛔ Files ignored due to path filters (1)
  • packages/api/src/tests/root/__snapshots__/api-surface.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (25)
  • .forge/features/judging-magic-access/spec.md
  • .forge/features/judging-magic-access/srd.md
  • .forge/features/judging-magic-access/status.md
  • .forge/features/judging-magic-access/test-cases.md
  • .forge/features/project-judging-scheduler/spec.md
  • .forge/features/project-judging-scheduler/srd.md
  • .forge/features/project-judging-scheduler/status.md
  • .forge/features/project-judging-scheduler/test-cases.md
  • .forge/features/project-judging/spec.md
  • .forge/features/project-judging/srd.md
  • .forge/features/project-judging/status.md
  • .forge/features/project-judging/test-cases.md
  • apps/blade/src/app/_components/projects/judge-project-workspace.tsx
  • apps/blade/src/app/judge/activate/[linkId]/route.ts
  • apps/blade/src/app/judge/projects/page.tsx
  • apps/blade/src/tests/judging/prod-flow-regressions.test.tsx
  • apps/blade/src/tests/projects/project-judge-privacy.test.tsx
  • packages/api/src/routers/judging.ts
  • packages/api/src/routers/projects.ts
  • packages/api/src/tests/integration/judging-access.test.ts
  • packages/api/src/tests/integration/judging-schedule.test.ts
  • packages/api/src/tests/judging-schedule/solver.test.ts
  • packages/api/src/utils/judging-schedule/solver.ts
  • packages/api/src/utils/judging-schedule/source.ts
  • packages/api/src/utils/judging/scope.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.

@jesusthecreator017

Copy link
Copy Markdown
Contributor

I tested out each feature implemented it all works just small UI issues in certain places but thats OOS for this PR 👍🏽

@DVidal1205
DVidal1205 added this pull request to the merge queue Sep 13, 2026
Merged via the queue into main with commit c23ab5e Sep 13, 2026
13 checks passed
@DVidal1205
DVidal1205 deleted the codex/fix-prod-judging-flow branch September 13, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API Change modifies code in the global API/tRPC package Blade Change modifies code in Blade app Bug Something isn't working Minor Small change - 1 reviewer required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix pre-event judging setup and guest access

3 participants