Skip to content

chore: updated final exam schedule#280

Merged
tsurbs merged 4 commits intomainfrom
update-final-s2026
Mar 9, 2026
Merged

chore: updated final exam schedule#280
tsurbs merged 4 commits intomainfrom
update-final-s2026

Conversation

@yl25946
Copy link
Copy Markdown
Contributor

@yl25946 yl25946 commented Mar 9, 2026

No description provided.

@railway-app
Copy link
Copy Markdown

railway-app Bot commented Mar 9, 2026

This PR was not deployed automatically as @yl25946 does not have access to the Railway project.

In order to get automatic PR deploys, please add @yl25946 to your workspace on Railway.

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cmucourses Ready Ready Preview Mar 9, 2026 8:32pm
cmucourses-staging Error Error Mar 9, 2026 8:32pm

Request Review

Comment thread apps/frontend/src/components/finals/scripts/generate-final.py Outdated
Comment on lines +74 to +79
start_datetime = datetime.datetime(
date_obj.year, date_obj.month, date_obj.day, start_time.tm_hour, start_time.tm_min)
end_datetime = datetime.datetime(
date_obj.year, date_obj.month, date_obj.day, end_time.tm_hour, end_time.tm_min)

return [start_datetime.timestamp(), end_datetime.timestamp()]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The script uses timezone-naive datetime objects, causing timestamp() to use the system's local timezone instead of the intended EST. This can generate incorrect timestamps.
Severity: HIGH

Suggested Fix

Use timezone-aware datetime objects. Before calling .timestamp(), attach the correct timezone information (e.g., using zoneinfo or pytz to specify 'America/New_York') to the datetime objects to ensure the generated timestamps are always correct, regardless of the environment.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: apps/frontend/src/components/finals/scripts/generate-final.py#L74-L79

Potential issue: The `generate-final.py` script creates naive `datetime` objects without
timezone information. When `datetime.timestamp()` is called, it implicitly uses the
system's local timezone to generate a Unix timestamp. The code's docstring specifies
that the input times are in EST, but this is not enforced. If the script is run on a
machine not configured to the EST timezone (e.g., a UTC-based server), the timestamps in
the generated `finals.json` will be incorrect, causing final exam times to be displayed
with a significant offset.

@tsurbs tsurbs self-assigned this Mar 9, 2026
@tsurbs
Copy link
Copy Markdown
Contributor

tsurbs commented Mar 9, 2026

LGTM

@tsurbs tsurbs self-requested a review March 9, 2026 19:49
@tsurbs tsurbs assigned yl25946 and unassigned tsurbs Mar 9, 2026
@yl25946
Copy link
Copy Markdown
Contributor Author

yl25946 commented Mar 9, 2026

Wait I updated the data so there's no weird Cc thing

@tsurbs tsurbs merged commit 3163ff8 into main Mar 9, 2026
2 of 4 checks passed
@tsurbs tsurbs deleted the update-final-s2026 branch March 9, 2026 23:14
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.

2 participants