Skip to content

migrate autograder types#136

Merged
lanceu0128 merged 4 commits into
mainfrom
autograder-type-migration
Jun 27, 2026
Merged

migrate autograder types#136
lanceu0128 merged 4 commits into
mainfrom
autograder-type-migration

Conversation

@lanceu0128

@lanceu0128 lanceu0128 commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator
  • moves autograder types to the shared types folder (about to be used in frontend)
  • defines autograder types as zod schemas first
  • makes changes to the autograder types that were alr made in the professor repo

Summary by CodeRabbit

  • New Features

    • Added clearer grading job status tracking across the grading workflow.
    • Expanded grading job and test result data support, including richer result details and timestamps.
  • Bug Fixes

    • Tightened submission validation to accept only properly formatted HTTPS GitHub repository URLs.
    • Improved validation for grading job timing fields to ensure consistent data handling.
  • Refactor

    • Consolidated shared grading-related types and schemas for more consistent behavior across the app.

@lanceu0128 lanceu0128 self-assigned this Jun 27, 2026
@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@lanceu0128, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 35 minutes and 16 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: dff79df7-303d-4564-8110-da7db6c42b22

📥 Commits

Reviewing files that changed from the base of the PR and between 60002e0 and a12776d.

📒 Files selected for processing (3)
  • .github/workflows/firebase-hosting-merge.yml
  • .github/workflows/firebase-hosting-pull-request.yml
  • shared/src/types/autograder.ts
📝 Walkthrough

Walkthrough

Shared grading-job schemas and the grading status enum now live in shared packages. Backend code adds a Firestore Timestamp-validated public job schema, types the submit route’s job objects, and updates cleanup/firestore helpers to import grading types from the new locations.

Changes

Shared grading contracts and backend wiring

Layer / File(s) Summary
Shared schemas and status enum
shared/src/constants/index.ts, shared/src/types/autograder.ts, shared/src/types/index.ts
GradingJobStatus moves into shared constants, shared Zod schemas define test, suite, public job, internal job, and submit payload shapes, and the types barrel re-exports the autograder module.
Backend public job typing
backend/functions/src/models/autograder.ts, backend/functions/src/routes/grading.ts
The backend public grading-job schema adds Firestore Timestamp validation, and the submit route annotates the constructed public and internal job objects with the new types.
Backend import rewiring
backend/functions/src/scheduled/cleanupStaleJobs.ts, backend/functions/src/utils/firestore.ts
Grading job imports in cleanup and Firestore helpers switch to the shared constants, shared types, and the backend public model.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I hop through schemas, neat and bright,
With status carrots shared just right 🥕
Firestore timestamps gleam at night,
And grading burrows feel just tight.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: migrating autograder types into shared code.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch autograder-type-migration

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
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@shared/src/types/autograder.ts`:
- Line 13: The shared autograder schema still allows impossible negative values
because it uses z.int() for durationMs and related counters. Tighten the
validators in autograder types so the fields for elapsed time and progress
counts only accept non-negative integers, using the existing schema definitions
in the autograder contract. Apply the same constraint consistently across all
affected fields referenced in this schema so backend writes and frontend reads
reject invalid negative state.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d46797b5-85e5-4b31-86d5-3818b2a33d23

📥 Commits

Reviewing files that changed from the base of the PR and between 26f6294 and 60002e0.

📒 Files selected for processing (8)
  • backend/functions/src/models/autograder.ts
  • backend/functions/src/routes/grading.ts
  • backend/functions/src/scheduled/cleanupStaleJobs.ts
  • backend/functions/src/types/grading.ts
  • backend/functions/src/utils/firestore.ts
  • shared/src/constants/index.ts
  • shared/src/types/autograder.ts
  • shared/src/types/index.ts
💤 Files with no reviewable changes (1)
  • backend/functions/src/types/grading.ts

Comment thread shared/src/types/autograder.ts Outdated
@github-actions

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit a12776d):

https://h4i-applications--pr136-autograder-type-migr-tncqfbzy.web.app

(expires Sat, 04 Jul 2026 05:20:32 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 22093378deab11a21f59ccd5f5596d569dc5fc0d

@lanceu0128 lanceu0128 merged commit 1bca033 into main Jun 27, 2026
7 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