Skip to content

[Do not merge] fix: remove annotated models from safelist and annotate openedx models on PII#38712

Open
Akanshu-2u wants to merge 3 commits into
openedx:masterfrom
Akanshu-2u:aaich/BOMS-572
Open

[Do not merge] fix: remove annotated models from safelist and annotate openedx models on PII#38712
Akanshu-2u wants to merge 3 commits into
openedx:masterfrom
Akanshu-2u:aaich/BOMS-572

Conversation

@Akanshu-2u
Copy link
Copy Markdown
Contributor

@Akanshu-2u Akanshu-2u commented Jun 4, 2026

Description:

This PR fixes pii_check for edx-platform by adding missing model annotations and correcting the safelist so the annotation tool passes cleanly.

Changes:

  • Added/fixed inline PII annotations in the targeted edx-platform models (including no_pii and pii metadata where required).
  • Cleaned safelist conflicts by removing entries for models that are now annotated inline.
  • Restored required safelist entries for non-local, generated, and historical models so coverage is complete.
  • Fixed malformed annotation syntax in one model block.

Validation:

  • Ran the pii annotation check with lint and coverage.
  • Result: lint passed and coverage reached 100% (all eligible models annotated).

Private JIRA Link:

BOMS-572

@Akanshu-2u Akanshu-2u changed the title fix: remove annotated models from safelist and annotate openedx models on PII [Do not merge] fix: remove annotated models from safelist and annotate openedx models on PII Jun 5, 2026
@Akanshu-2u Akanshu-2u requested a review from Copilot June 5, 2026 07:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds/standardizes PII annotation markers on several Django models and refreshes the repository annotation safelist to reflect current coverage.

Changes:

  • Add .. no_pii: markers to multiple models’ docstrings.
  • Add explicit .. pii, .. pii_types, and .. pii_retirement metadata to models storing Apple identifiers and employee email addresses.
  • Update .annotation_safe_list.yml by removing older entries and adding a larger set of non-local/generated models.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
openedx/core/djangoapps/notifications/models.py Adds .. no_pii: annotation to NotificationPreference model docstring.
openedx/core/djangoapps/embargo/models.py Adds .. no_pii: annotation to GlobalRestrictedCountry model docstring.
openedx/core/djangoapps/discussions/models.py Fixes .. no_pii: directive formatting to include a space.
common/djangoapps/third_party_auth/models.py Annotates Apple migration identifiers as PII with type/retirement metadata.
common/djangoapps/student/models/user.py Adds .. no_pii: to history model and adds PII metadata docstring to AllowedAuthUser.
.annotation_safe_list.yml Removes older safelist blocks and adds/updates safelist coverage for many models.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .annotation_safe_list.yml Outdated
Comment on lines +260 to +264
# Via django-wiki https://github.com/openedx/django-wiki
wiki.Article:

# Additional non-local or generated models requiring safelist coverage
agreements.HistoricalUserAgreement:
".. no_pii:": "No PII"
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.

implemented

Model to store users' Apple Unique Identifier during migration
process of Apple team from edx Inc. to edx LLC.

.. pii: Contains Apple user identifiers (old_apple_id, transfer_id, new_apple_id).
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.

not required


class AllowedAuthUser(TimeStampedModel):
"""
Tracks which employee email addresses are allowed to log in with password on a given site.
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.

not required

@Akanshu-2u Akanshu-2u requested a review from Copilot June 5, 2026 08:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Comment thread .annotation_safe_list.yml
Comment thread .annotation_safe_list.yml
Comment on lines +252 to +260
# Additional non-local or generated models requiring safelist coverage
agreements.HistoricalUserAgreement:
".. no_pii:": "No PII"
assessment.HistoricalSharedFileUpload:
".. no_pii:": "No PII"
casbin_adapter.CasbinRule:
".. no_pii:": "No PII"
channel_integration.ApiResponseRecord:
".. no_pii:": "No PII"
Comment on lines 1061 to +1067
"""
Model to store users' Apple Unique Identifier during migration
process of Apple team from edx Inc. to edx LLC.

.. pii: Contains Apple user identifiers (old_apple_id, transfer_id, new_apple_id).
.. pii_types: external_service
.. pii_retirement: local_api
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.

2 participants