Skip to content

Tig 209 tiger path egr course sliding window#519

Merged
angelina-ji merged 10 commits intomasterfrom
TIG-209-TigerPath-EGR-CourseSlidingWindow
Apr 14, 2026
Merged

Tig 209 tiger path egr course sliding window#519
angelina-ji merged 10 commits intomasterfrom
TIG-209-TigerPath-EGR-CourseSlidingWindow

Conversation

@angelina-ji
Copy link
Copy Markdown
Contributor

No description provided.

rohanmatta11 and others added 10 commits February 17, 2026 13:56
… only), and add owner (owners only). Meant for owner > admin hierarchy
The OIT MobileApp API (error 900908 unauthorized) has been replaced
with the Princeton registrar front-end API, which requires no OIT
subscription and is publicly accessible via Bearer token.

- scrape_registrar.py: use cloudscraper to bypass Cloudflare and
  extract apiToken and apiBaseUrl from registrar.princeton.edu;
  add get_course_ids_for_term() via /classes/{term} endpoint;
  add get_full_course_details() returning all course fields in one call
- scrape_parse.py: remove MobileApp dependency entirely; derive
  semester dates from term code; use registrar API in parallel
- scrape_all.py: warn and skip instead of crashing on 0-course terms
  (historical terms 1214-1234 are not in the registrar API)
- requirements.txt: add cloudscraper==1.2.71

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@linear
Copy link
Copy Markdown

linear Bot commented Apr 14, 2026

@angelina-ji angelina-ji merged commit 9cbe891 into master Apr 14, 2026
1 check passed
@angelina-ji angelina-ji deleted the TIG-209-TigerPath-EGR-CourseSlidingWindow branch April 14, 2026 01:40
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9bc8988e16

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +54 to +56
.then((data) => {
setDetails(data);
setLoading(false);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Guard detail fetch against out-of-order responses

Each course selection triggers a new fetch, but prior requests are never cancelled or ignored; if a user clicks courses quickly, an older response can resolve last and overwrite details for the currently selected course. In that case the panel can display ratings/comments from course A while the header still shows course B, which is a correctness issue in normal interactive use.

Useful? React with 👍 / 👎.

Comment thread tigerpath/views.py
Comment on lines +266 to +267
if not evaluations:
return JsonResponse(empty)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Continue building details when evaluations are empty

This early return exits before the DB description lookup and course metadata enrichment, so courses with no evaluation rows always get an empty payload even when a description exists locally. The UI explicitly supports rendering description without eval data, so this branch drops useful details for exactly that case.

Useful? React with 👍 / 👎.

Comment thread tigerpath/views.py
Comment on lines +355 to +358
evaluations.sort(key=lambda e: e.get("evalTerm", ""), reverse=True)
raw_rating = evaluations[0].get("rating")
rating = round(float(raw_rating), 2) if raw_rating is not None else None
return course_id, rating
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Cache fetched ratings in _fetch_quality_rating

The helper checks course_details_* cache but never stores successful fetches back into that key. As a result, callers like get_schedule repeatedly hit the external evaluations API for the same courses (especially when quality_rating is missing or null), which adds avoidable latency and external load instead of converging to cache hits.

Useful? React with 👍 / 👎.

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