Skip to content

feat: simplify retirement cleanup by removing custom redaction value parameters - #38934

Merged
robrap merged 3 commits into
openedx:masterfrom
ktyagiapphelix2u:ktyagi/BOMS-529
Jul 31, 2026
Merged

feat: simplify retirement cleanup by removing custom redaction value parameters#38934
robrap merged 3 commits into
openedx:masterfrom
ktyagiapphelix2u:ktyagi/BOMS-529

Conversation

@ktyagiapphelix2u

Copy link
Copy Markdown
Contributor

Description

This PR simplifies the user retirement cleanup flow by removing caller-defined redaction override parameters (redacted_username, redacted_email, redacted_name) across the API endpoint, API client, and CLI script.

Since redaction is performed immediately prior to deletion, customizable redaction values add unnecessary complexity. The fields are now hardcoded to "redacted" in the pre-deletion UPDATE query.

Private Jira Ticket

https://2u-internal.atlassian.net/browse/BOMS-529

@ktyagiapphelix2u
ktyagiapphelix2u requested a review from a team as a code owner July 29, 2026 07:01
Comment on lines +1055 to +1057
original_username="redacted",
original_email="redacted",
original_name="redacted"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This would follow our earlier patterns more closely:

Suggested change
original_username="redacted",
original_email="redacted",
original_name="redacted"
original_username="redacted-before-delete",
original_email="redacted-before-delete@safe.com",
original_name="redacted-before-delete"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@robrap Updated

Comment on lines +1090 to +1091
assert '"original_username" = \'redacted\'' in sql_lower, (
f"UPDATE query missing '\"original_username\" = redacted': {sql_lower}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: The default message for failure would probably be fine, and the code would be much simpler to read:

Suggested change
assert '"original_username" = \'redacted\'' in sql_lower, (
f"UPDATE query missing '\"original_username\" = redacted': {sql_lower}"
assert '"original_username" = \'redacted\'' in sql_lower

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated

@robrap
robrap enabled auto-merge (squash) July 31, 2026 17:17
@robrap
robrap merged commit 387ee5d into openedx:master Jul 31, 2026
41 checks passed
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