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

feat: adding pathway status #2710

Merged
merged 2 commits into from
Feb 27, 2025

Conversation

deborahgu
Copy link
Member

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

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 sure you are inside the devstack container
  • Run make test-karma
  • All tests pass

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
@deborahgu deborahgu marked this pull request as ready for review February 26, 2025 21:36
@deborahgu deborahgu requested a review from a team as a code owner February 26, 2025 21:36
Comment on lines +103 to +108
UserCreditPathway.objects.select_related("pathway")
.filter(
user=user,
pathway__in=program_pathways_set,
)
.all()
Copy link
Contributor

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.

Copy link
Member Author

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:

  1. The user has their learner record open so they can see the button to send the record to an un-retired pathway
  2. We retire the pathway while that page is open
  3. 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?

Copy link
Contributor

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.

Copy link
Contributor

@justinhynes justinhynes left a comment

Choose a reason for hiding this comment

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

Looks good.

@deborahgu deborahgu merged commit d42973e into master Feb 27, 2025
9 checks passed
@deborahgu deborahgu deleted the dkaplan1/APER-3929_enable-pathway-retirement branch February 27, 2025 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants