Switch over to use LessonId#4431
Conversation
… V3 format - Reverted changes to optimiser service for it to return V1 serialization strings - Reverted timetable export service to accept `ClassNo` or `LessonId`
|
@zehata is attempting to deploy a commit to the modsbot's projects Team on Vercel. A member of the Team first needs to authorize it. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #4431 +/- ##
==========================================
+ Coverage 54.52% 57.85% +3.32%
==========================================
Files 274 316 +42
Lines 6076 7237 +1161
Branches 1455 1765 +310
==========================================
+ Hits 3313 4187 +874
- Misses 2763 3050 +287 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
… one lesson across all lesson types.
…produce a valid `ClassNo`
… does not appear when modifying a lesson
|
Linter didn't catch the debug |
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
|
I ran the tests again on my machine, and couldn't reproduce the test failure. Can we re-run the CircleCI test? |
leslieyip02
left a comment
There was a problem hiding this comment.
This is gonna take a while. Will continue reviewing tomorrow. Mostly seems good so far though!
- Added recovery path for empty TA module lesson configs - Added tests for enabling TA modules
|
I haven't actually reviewed this back yet. I'm just pushing it because I have something else to do tonight. |
| * Hydrate timetable lessons with interactability info\ | ||
| * See type defintion of {@link InteractableLesson} for properties added | ||
| */ | ||
| export function getInteractableLessons( |
There was a problem hiding this comment.
Can we refactor this function for better readability?
- Extract some of the more complex boolean expressions into helpers (e.g.
canBeSelectedAsActiveLesson,canBeAddedToLessonConfig, etc). - I'm not a fan of the triply-nested
mapValues. Maybe we can extract each level to a helper (e.g.getInteractableLesson(lesson, lessonId, ...),groupInteractableLessonsByLessonId(lessonMap, ...), etc)?
| if (!isV1(lessonsIdentifier)) { | ||
| const configIsV2 = isV2(lessonsIdentifier); | ||
| const migratedLessonConfig: [ClassNo] | LessonId[] = configIsV2 | ||
| ? migrateLessonTypeLessonsFromLessonIndicesToLessonIds( |
There was a problem hiding this comment.
I think we should split the logic in migrateModuleLessonConfig into migrateLessonConfigV1, migrateLessonConfigV2 and migrateLessonConfig for better readability.
- Removed some frivolous docstring from `interactabilityHydration.ts`, adjusted logic
|
|
When a lesson is active - For non-TA modules, only lessons in the config will show up for other lesson types, thus `alreadyAddedToLessonConfig` is necessarily true, and the function would have returned before that check - For TA modules, we show all lessons regardless of lesson type Thus, whether the lesson is of the same lesson type as the active lesson does not affect the result
|
Thanks for covering for me for some of the changes. I am still going to be doing a final manual check later, just running everything manually as a final check. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
|
I've updated the export deployment to point at the website deployment. This should simplify testing the export service: https://nusmods-export-iu6oqsuwj-modsbots-projects.vercel.app/. |
|
@leslieyip02 I have done a manual check (which is by no means thorough) as a sanity check. I tested migration from v2 config with multiple populated semesters, validating a malformed config, running optimiser and the export service. I did not notice anything out of the blue, so I think it should be ok. |
leslieyip02
left a comment
There was a problem hiding this comment.
LGTM. Thanks for the massive effort on this issue! Let's keep monitoring this.
|
Thanks a lot for reviewing and helping with the changes! |
ClassNoorLessonIdContext
This activates the
LessonIdintroduced in #4427 to resolve #4283Implementation
As discussed in #4387 (reply in thread)
Module lesson configs are now stored as
for non-TA modules, and as
for TA modules
Because
ClassNodoes not change when the faculty modifies timetables, changes made to lessons will not cause configs to become invalid unless theClassNowas deleted.Migration and validation logic has been updated to migrate v1 and v2 configs.
Tested that:
https://nusmods.com/timetable/sem-2/share?CS1010E=TUT:09,SEC:2&CS1010S=REC:18,LEC:1,TUT:33Other Information
Just pushing this to get Greptile to review it. Not ready for review yet.