-
Notifications
You must be signed in to change notification settings - Fork 71
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
feat: adding pathway status #2710
feat: adding pathway status #2710
Conversation
course-discovery is adding the concept of retired pathways, which it will expose with a status field through the API. We still want to ingest retired and unpublished pathways, because we don't want to break any of our existing foreign key relationships. However, we don't want to expose them to either the Learner Record MFE or the program dashboard. Still todo: * verification * documentation updates * ADR FIXES: APER-3929
* fixing enum usage * improving tests * fixing the way we hide retired programs
UserCreditPathway.objects.select_related("pathway") | ||
.filter( | ||
user=user, | ||
pathway__in=program_pathways_set, | ||
) | ||
.all() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would we want to add a check on the status to be empty or published here?
I believe this would result is not including unpublished or retired pathways to a learner when fetching their program record details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the way I made the changes to copy_catalog
, a retired or unpublished pathway is no longer linked to a program at all, which means that it can't make a UserCreditPathway
. it doesn't delete old UserCreditPathway objects, but I don't think it should, because those are effectively audit logs, as I understand it. I suppose technically there could be a race condition where:
- The user has their learner record open so they can see the button to send the record to an un-retired pathway
- We retire the pathway while that page is open
- They press the button and the query comes back and returns no longer valid
UserCreditPathway
objects.
But I'm not sure I'm that worried about that race condition? What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think I'm worried about it too much, it seems like a narrow edge case. This sounds like a case that could only occur when the copy catalog mgmt command is running, as this is the only time Credentials currently updates its Discovery data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
course-discovery is adding the concept of retired pathways, which it will expose with a status field through the API. We still want to ingest retired and unpublished pathways, because we don't want to break any of our existing foreign key relationships. However, we don't want to expose them to either the Learner Record MFE or the program dashboard.
Still todo:
FIXES: APER-3929
Run JavaScript tests locally with Karma
There is work being done on a fix to get Karma to run in CI. Until then, however, contributors are required to run these tests locally.
make test-karma