Skip to content

Add explicit names on relationships to submissions and grader results#581

Merged
jon-bell merged 1 commit intostagingfrom
prepare-for-new-submission-fks
Jan 18, 2026
Merged

Add explicit names on relationships to submissions and grader results#581
jon-bell merged 1 commit intostagingfrom
prepare-for-new-submission-fks

Conversation

@jon-bell
Copy link
Contributor

@jon-bell jon-bell commented Jan 18, 2026

Summary by CodeRabbit

  • Chores
    • Refined internal data retrieval mechanisms across submissions, assignments, and grading workflows to improve consistency and ensure reliable access to grading information and submission results throughout the application, API endpoints, and automated submission processing.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 18, 2026

Walkthrough

This PR updates database query selections across 13 files to use explicit foreign key constraint names instead of generic relation paths. Relations such as grader_results(*) are replaced with named foreign key references like grader_results!grader_results_submission_id_fkey(*) for precise data retrieval.

Changes

Cohort / File(s) Summary
LLM Hint API
app/api/llm-hint/route.ts
Updated type GradrResultTestWithGraderResults and POST query select block to reference explicit foreign keys: grader_results!grader_result_tests_grader_result_id_fkey and submissions!grader_results_submission_id_fkey
Assignment Pages
app/course/[course_id]/assignments/[assignment_id]/commitHistory.tsx, page.tsx, submissions/[submissions_id]/layout.tsx, submissions/[submissions_id]/results/page.tsx
Replaced generic grader_results(*) with explicit foreign key path grader_results!grader_results_submission_id_fkey(*) in submission metadata queries
Management Pages
app/course/[course_id]/manage/assignments/[assignment_id]/assignmentsTable.tsx, test/page.tsx
Updated grader results selection to use specific foreign key constraints instead of generic relation expansion
Dashboard & Hooks
app/course/[course_id]/studentDashboard.tsx, hooks/useSubmission.tsx
Narrowed grader results relation paths to explicit foreign key references in assignment and submission queries
Autograder Functions
supabase/functions/autograder-create-submission/index.ts, autograder-submit-feedback/index.ts, autograder-trigger-grading-workflow/index.ts, github-repo-webhook/index.ts
Updated repository and submission queries to use explicit foreign key constraint names for relation joins
Database Type Definitions
utils/supabase/DatabaseTypes.d.ts
Updated five GetResult type signatures (AssignmentWithRepositoryAndSubmissionsAndGraderResults, SubmissionWithGraderResultsAndReview, SubmissionWithGraderResultsAndFiles, SubmissionWithGraderResultsAndErrors, RepositoryWithSubmissionsAndGraderResults) to use explicit foreign key paths

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested labels

backend, database

Suggested reviewers

  • ironm00n

Poem

Queries now trace their paths with care,
Foreign keys named everywhere—
From API routes to database calls,
Precision echoes through these halls. 🗝️

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding explicit foreign key names to relationships targeting submissions and grader results across the codebase.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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 and usage tips.

@jon-bell jon-bell merged commit d25bb95 into staging Jan 18, 2026
5 of 13 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.

1 participant