Skip to content

Conversation

@irtazaakram
Copy link
Member

Comment on lines 16 to 17
auth.User:
".. no_pii:": "This model has no PII"
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the User model really have no PII ? And why do we have to declare annotations for common dependencies like Django or waffle redundantly in this repo anyways?!

Copy link
Member Author

Choose a reason for hiding this comment

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

The auth.User model does have some PII (username, email, and password), so I’ve added the annotations for it.
I think get_models_requiring_annotations method in find_django.py seems to treats all models (including those from external dependencies) as requiring annotation.

pii_check: commands[0]> code_annotations django_find_annotations --config_file .pii_annotations.yml --lint --report --coverage
Configured for report path: pii_report
Configured for source path: ./
Found safelist at .annotation_safe_list.yml. Reading.

Performing linting checks...
Linting passed without errors.

Model coverage report
----------------------------------------
Found 35 total models.
31 were eligible for annotation, 5 were annotated.
Coverage is 16.1%

Coverage found 26 uncovered models:
   auth.User
   oel_collections.Collection
   oel_collections.CollectionPublishableEntity
   oel_components.Component
   oel_components.ComponentType
   oel_components.ComponentVersion
   oel_components.ComponentVersionContent
   oel_contents.Content
   oel_contents.MediaType
   oel_publishing.Container
   oel_publishing.ContainerVersion
   oel_publishing.Draft
   oel_publishing.EntityList
   oel_publishing.EntityListRow
   oel_publishing.LearningPackage
   oel_publishing.PublishLog
   oel_publishing.PublishLogRecord
   oel_publishing.PublishableEntity
   oel_publishing.PublishableEntityVersion
   oel_publishing.Published
   oel_tagging.ObjectTag
   oel_tagging.Tag
   oel_tagging.TagImportTask
   oel_tagging.Taxonomy
   oel_units.Unit
   oel_units.UnitVersion

Coverage threshold not met! Needed 100.0, actually 16.1!

Comment on lines +13 to +16
migrations.AlterModelOptions(
name='entitylistrow',
options={'ordering': ['order_num']},
),
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is this migration coming from when there's no changes to the model - is it related to Django 5.2 specifically?

Copy link
Member Author

Choose a reason for hiding this comment

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

This migration isn't related to Django 5.2 It reflects a change that was made to the entitylistrow model last week, https://github.com/openedx/openedx-learning/pull/292/files#diff-f814bfe5a65c31e277927ed66550877cb86f65b735347d1b478eae5f91825886

Copy link
Contributor

Choose a reason for hiding this comment

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

@irtazaakram Thanks!

Copy link
Contributor

@bradenmacdonald bradenmacdonald left a comment

Choose a reason for hiding this comment

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

LGTM

@irtazaakram irtazaakram merged commit 251355c into main Apr 10, 2025
11 checks passed
@irtazaakram irtazaakram deleted the django52support branch April 10, 2025 07:35
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.

Add Django 5.2 support to openedx-learning

4 participants