Skip to content

Commit 325320f

Browse files
committed
fix: added annotations in cms models and coverage to 100%
1 parent 458c592 commit 325320f

5 files changed

Lines changed: 25 additions & 1 deletion

File tree

.pii_annotations.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
source_path: ./
22
report_path: pii_report
33
safelist_path: .annotation_safe_list.yml
4-
coverage_target: 85.3
4+
coverage_target: 100.0
55
# See OEP-30 for more information on these values and what they mean:
66
# https://open-edx-proposals.readthedocs.io/en/latest/oep-0030-arch-pii-markup-and-auditing.html#docstring-annotations
77
annotations:

cms/djangoapps/contentstore/models.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ class ComponentLink(EntityLinkBase):
144144
"""
145145
This represents link between any two publishable entities or link between publishable entity and a course
146146
XBlock. It helps in tracking relationship between XBlocks imported from libraries and used in different courses.
147+
148+
.. no_pii:
147149
"""
148150
upstream_block = models.ForeignKey(
149151
Component,
@@ -315,6 +317,8 @@ class ContainerLink(EntityLinkBase):
315317
"""
316318
This represents link between any two publishable entities or link between publishable entity and a course
317319
xblock. It helps in tracking relationship between xblocks imported from libraries and used in different courses.
320+
321+
.. no_pii:
318322
"""
319323
upstream_container = models.ForeignKey(
320324
Container,
@@ -561,6 +565,8 @@ class LearningContextLinksStatus(models.Model):
561565
"""
562566
This table stores current processing status of upstream-downstream links in ComponentLink table for a
563567
course or a learning context.
568+
569+
.. no_pii:
564570
"""
565571
context_key = CourseKeyField(
566572
# Single entry for a learning context or course

cms/djangoapps/modulestore_migrator/models.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ class ModulestoreSource(models.Model):
4242
* When using the REST API directly, the default is to use the same behavior as the UI, but
4343
clients can also explicitly specify the `forward_source_to_target` boolean param in order to
4444
control whether `forwarded` is set to any given migration.
45+
46+
.. no_pii:
4547
"""
4648
key = LearningContextKeyField(
4749
unique=True,
@@ -74,6 +76,8 @@ class ModulestoreMigration(models.Model):
7476
contains the progress of the import.
7577
* A single ModulestoreSource may very well have multiple ModulestoreMigrations; however,
7678
at most one of them with be the "authoritative" migration, as indicated by `forwarded`.
79+
80+
.. no_pii:
7781
"""
7882

7983
## MIGRATION SPECIFICATION
@@ -179,6 +183,8 @@ class ModulestoreBlockSource(TimeStampedModel):
179183
180184
The semantics of `forwarded` directly mirror those of `ModulestoreSource.forwarded`. Please see
181185
that class's docstring for details.
186+
187+
.. no_pii:
182188
"""
183189
overall_source = models.ForeignKey(
184190
ModulestoreSource,
@@ -216,6 +222,8 @@ class ModulestoreBlockMigration(TimeStampedModel):
216222
* A single ModulestoreBlockSource may very well have multiple ModulestoreBlockMigrations; however,
217223
at most one of them with be the "authoritative" migration, as indicated by `forwarded`.
218224
This will coincide with the `overall_migration` being pointed to by `forwarded` as well.
225+
226+
.. no_pii:
219227
"""
220228
overall_migration = models.ForeignKey(
221229
ModulestoreMigration,

openedx/core/djangoapps/content/search/models.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ class SearchAccess(models.Model): # noqa: DJ008
2121
2222
a) in some deployments, users may be granted access to more than 1_000 individual courses, and
2323
b) the search filter request is stored in the JWT, which is limited to 8Kib.
24+
25+
.. no_pii:
2426
"""
2527
id = models.BigAutoField(
2628
primary_key=True,
@@ -70,6 +72,8 @@ def get_access_ids_for_request(request: Request, omit_orgs: list[str] = None) ->
7072
class IncrementalIndexCompleted(models.Model): # noqa: DJ008
7173
"""
7274
Stores the contex keys of aleady indexed courses and libraries for incremental indexing.
75+
76+
.. no_pii:
7377
"""
7478

7579
context_key = LearningContextKeyField(

openedx/core/djangoapps/content_staging/models.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ class StagedContent(models.Model):
3838
Use as a clipboard: for any given user, the most recent row with
3939
purpose=CLIPBOARD is the "current" clipboard content. But it can only be
4040
pasted if its status is READY.
41+
42+
.. no_pii:
4143
"""
4244

4345
class Meta:
@@ -95,6 +97,8 @@ class StagedContentFile(models.Model): # noqa: DJ008
9597
These usually come from a course's Files & Uploads page, but can also come
9698
from per-xblock file storage (e.g. video transcripts or images used in
9799
v2 content libraries).
100+
101+
.. no_pii:
98102
"""
99103
for_content = models.ForeignKey(StagedContent, on_delete=models.CASCADE, related_name="files")
100104
filename = models.CharField(max_length=255, blank=False)
@@ -112,6 +116,8 @@ class UserClipboard(models.Model): # noqa: DJ008
112116
Each user has a clipboard that can hold one item at a time, where an item
113117
is some OLX content that can be used in a course, such as an XBlock, a Unit,
114118
or a Subsection.
119+
120+
.. no_pii:
115121
"""
116122
# The user that copied something. Clipboards are user-specific and
117123
# previously copied items are not kept.

0 commit comments

Comments
 (0)