Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requirement builder with the new data format #588

Merged
merged 6 commits into from
Dec 4, 2021

Conversation

SamChou19815
Copy link
Contributor

Summary

Depends on #587.

This PR switches the requirement building algorithm to use the new data format proposed in #522. It only builds the first graph (the graph that keeps all the edges with constraint violations) for now, since the current data enforces that there are no constraint violations.

Test Plan

Load it the first time and compare your requirement progress against staging. It should be mostly the same. There might be some discrepancies with edges from requirement with warnings to AP/IB credits, since the new implementation fixes the bug in the old system (See #553 (comment) when I first write the migration script).

Screen Shot 2021-11-14 at 17 54 59

After that, you can play around with adding courses and requirements from both the semester view and the requirement bar, with both regular and self-check requirements. Everything should work fine.

I would like to get more eyes on this since it's a pretty significant change.

@dti-github-bot
Copy link
Member

dti-github-bot commented Nov 14, 2021

[diff-counting] Significant lines: 655.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 14, 2021

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

https://cornelldti-courseplan-dev--pr588-requirement-graph-bu-lxmxr55u.web.app

(expires Fri, 10 Dec 2021 17:00:30 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@SamChou19815 SamChou19815 force-pushed the requirement-graph-builder branch from 3f6b9c0 to 59616ae Compare November 14, 2021 23:32
@SamChou19815 SamChou19815 marked this pull request as ready for review November 15, 2021 18:17
@SamChou19815 SamChou19815 requested a review from a team as a code owner November 15, 2021 18:17
@SamChou19815 SamChou19815 force-pushed the delete-unused-ap-ib-override branch from cc36672 to 3a671c8 Compare November 16, 2021 19:53
@SamChou19815 SamChou19815 force-pushed the requirement-graph-builder branch from 59616ae to 8b47015 Compare November 16, 2021 19:53
@SamChou19815 SamChou19815 force-pushed the delete-unused-ap-ib-override branch from 3a671c8 to 64422dd Compare November 17, 2021 01:39
@SamChou19815 SamChou19815 force-pushed the requirement-graph-builder branch from 8b47015 to fe125f1 Compare November 17, 2021 02:03
@SamChou19815 SamChou19815 force-pushed the delete-unused-ap-ib-override branch from 64422dd to a4728a9 Compare November 17, 2021 04:17
@SamChou19815 SamChou19815 force-pushed the requirement-graph-builder branch from fe125f1 to 64747ee Compare November 17, 2021 04:20
Base automatically changed from delete-unused-ap-ib-override to master November 18, 2021 01:17
@SamChou19815 SamChou19815 force-pushed the requirement-graph-builder branch from 64747ee to 7265ffa Compare November 18, 2021 01:18
@hahnbeelee
Copy link
Contributor

When I dragged CS 4121 for the CS Practicum requirement it fulfilled both the CS Elective and CS Practicum requirement. This doesn't happen on prod.
image

@hahnbeelee
Copy link
Contributor

hahnbeelee commented Nov 30, 2021

When I added a course from the add modal from the req bar for tech elec it got counted as tech elec and cs elec

image

image

@hahnbeelee
Copy link
Contributor

hahnbeelee commented Nov 30, 2021

Weird bug where I added CS 3300 as an external spec from the req bar, but it didn't actually get added? The course card isn't in the semester view, and it isn't being counted for actually fulfilling the requirement (0/3)

I refreshed and it completely disappeared.

Did it again and it was fine. Maybe something weird just happened
image

@hahnbeelee
Copy link
Contributor

Fulfilled course cards are not showing for self-select (specifically the CS major tech elec) - notice 2/3 but no courses listed
image

@hahnbeelee
Copy link
Contributor

local vs. prod.
image
image

Copy link
Contributor

@hahnbeelee hahnbeelee left a comment

Choose a reason for hiding this comment

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

I see the change of AP/IB not fulfilling requirements by default.
Tested + Works as desired:
Delete a course
add a course
add semester
clear semester
delete a semester

Weird behavior with:

  • selectable requirements

src/global-firestore-data/override-fulfillment-choices.ts Outdated Show resolved Hide resolved
@@ -90,7 +90,7 @@ export const addCourseToSemester = (
year: number,
season: FirestoreSemesterSeason,
newCourse: FirestoreSemesterCourse,
requirementID?: string,
choiceUpdater: (choice: FirestoreCourseOptInOptOutChoices) => FirestoreCourseOptInOptOutChoices,
Copy link
Contributor

@hahnbeelee hahnbeelee Nov 30, 2021

Choose a reason for hiding this comment

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

How does choiceUpdater work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a function that takes in the current choice as parameter and return the updated choice.

### Fix dragged-from-req-bar courses double counting issue:

Filtering out from a full list of all potentially eligible requirements instead of filter from nothing.

### Self-check double counting issue

Same as above, need to add all eligible courses to opt-out to prevent double counting.

### Fulfilled self-check course not showing up

Use requirement graph instead of now unused `derivedSelectableRequirementData` as data source to find fulfilled courses.

### Self-check choices not showing up in add modal
@SamChou19815
Copy link
Contributor Author

@hahnbeelee all the above-mentioned issues should be fixed now. How I fixed them is explain in the commit message.

Copy link
Contributor

@hahnbeelee hahnbeelee left a comment

Choose a reason for hiding this comment

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

Thank you! I found something else - when I add CS 4210 the modal says it's mapping to "CS Electives" but when I added it it automatically fulfilled all the requirements it could possibly fulfill. LOL
image

@SamChou19815
Copy link
Contributor Author

SamChou19815 commented Dec 2, 2021

Thank you! I found something else - when I add CS 4210 the modal says it's mapping to "CS Electives" but when I added it it automatically fulfilled all the requirements it could possibly fulfill. LOL image

@hahnbeelee Should be fixed in the last commit. Turns out a filter condition is inverted 😅

Copy link
Contributor

@hahnbeelee hahnbeelee left a comment

Choose a reason for hiding this comment

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

I think this is my last round of comments.

src/components/Semester/Semester.vue Outdated Show resolved Hide resolved
@@ -3,7 +3,7 @@ import { checkNotNull } from '../../utilities';
import {
semestersCollection,
toggleableRequirementChoicesCollection,
selectableRequirementChoicesCollection,
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we completely deprecating selectableRequirementChoicesCollection?

Copy link
Contributor

Choose a reason for hiding this comment

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

if so should we delete it from firebase-admin-config.ts and store.ts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All migrated away

Copy link
Contributor

@hahnbeelee hahnbeelee left a comment

Choose a reason for hiding this comment

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

LGTM!

@SamChou19815 SamChou19815 merged commit b448fc0 into master Dec 4, 2021
@SamChou19815 SamChou19815 deleted the requirement-graph-builder branch December 4, 2021 00:19
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.

3 participants