openedx/openedx-platform

remove nonfunctional code from retirement

開放

#37,720 建立於 2025年12月3日

 (5 則留言) (0 個反應) (0 位負責人)Python (4,331 個分叉)auto 404
code healthgood first issuehelp wanted

倉庫指標

星標
 (8,150 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Summary

In edx_api.py, the CredentialsApi and EcommerceApi classes contain nonfunctional code.

  • EcommerceApi.retire_learner
  • EcommerceApi.get_tracking_key
  • CredentialsApi.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.py
    • EcommerceApi.retire_learner
    • EcommerceApi.get_tracking_key
    • CredentialsApi.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.

貢獻者指南