openedx / openedx/openedx-platform
remove nonfunctional code from retirement
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8.2k
- Forks
- 4.4k
- Avg merge
- 6d 18h
- Merged PRs (30d)
- 42
Description
Summary
In edx_api.py, the CredentialsApi and EcommerceApi classes contain nonfunctional code.
EcommerceApi.retire_learnerEcommerceApi.get_tracking_keyCredentialsApi.retire_learner
Additionally, ecommerce has, I believe, been deprecated in the open source organization, so theoretically that entire EcommerceApi class should be removed. However, I don't know if any instances are still using it anyway, so I'm uncomfortable saying the class is safe to go.
Acceptance Criteria
- Remove the methods from
edx_api.pyEcommerceApi.retire_learnerEcommerceApi.get_tracking_keyCredentialsApi.retire_learner
- Remove any references to those methods.
- There is definitely a reference in retire_one_user.py
- I think that is probably except for the tests for those 2 Python files, but because of the way we get the name of the method from the configuration you aren't going to be able to do IDE/github autodetect, you're actually going to have to do searches for the code. But an initial search for that code doesn't find any other calls.
- Update the doc at driver_setup.rst
Background
Over on slack in #ecommerce, @MoisesGSalas wrote up a thread in 2024, referencing an earlier discussion on discourse about the retire_one_learner script:
There's an API call to the endpoint /api/v2/user/retire in ecommerce, but skimming through the code I never found it. Has this ever worked?
This references code that is now in edx-platform, but was previously in tubular.
At the time I answered, I think incorrectly, that no evidence that the endpoints in question (for both e-commerce and credentials) ever existed:
as far as I can tell the variants of this call were first added in May 2018 on these two lines, but as far as I can tell no endpoint like that existed in edx-platform at that time either at user_ api/urls.py or anywhere else.
I was confused at the time, because the history of this file, which has moved back and forth between tubular and edx-platform, makes it hard to track what worked at what times, and because the replace_usernames method from each class does exist on the two IDAs.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with scripts/user_retirement/utils/edx_api.py and scripts/user_retirement/retire_one_learner.py, then search the repository for the named methods and configuration-based references. Check the tests for these Python files and update scripts/user_retirement/docs/driver_setup.rst. Done means the three methods and their references are removed, tests pass, and the driver documentation reflects the remaining behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100