Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undeclared data categories #4781

Merged
merged 12 commits into from
Apr 22, 2024
Merged

Undeclared data categories #4781

merged 12 commits into from
Apr 22, 2024

Conversation

galvana
Copy link
Contributor

@galvana galvana commented Apr 9, 2024

Closes PROD-1873

Description Of Changes

Updating datamap report table with two new columns:

  • System undeclared data categories - A list of data categories aggregated from all of a system's datasets that are not declared in any of the system's data uses
  • Data use undeclared data categories - A list of data categories from a data use's dataset that are not declared in the current data use or any sibling data uses

Code Changes

  • Adding new columns to DatamapReportTable.tsx
  • Misc fixes for front-end cache invalidation
  • Helper functions on System and PrivacyDeclaration models to aggregate and report on associated data categories

Steps to Confirm

System undeclared data categories

  • Navigate to Data Inventory > Add System, set the System name and set Dataset references
    to the Postgres sample dataset, click Save
  • Navigate to Data Inventory > Reporting, the System undeclared data categories should not be visible
  • Click on Edit columns and enable the System undeclared data categories column, click Save
  • The enabled column should be visible and expandable
  • System undeclared data categories should say "12 system undeclared data categories"
  • Navigate back to the system and add a new data use with the user data category
  • Navigate back to the datamap report table. Enable the column again. The System undeclared data categories column should now show a single undeclared data category, System Data: Operations Data

Data use undeclared data categories

  • Remove the dataset from the system, create a new data use on the system, set the data category to System and add the Postgres dataset
  • Navigate to Data Inventory > Reporting, the Data use undeclared data categories should not be visible
  • Click on Edit columns and enable the Data use undeclared data categories column, click Save
  • The enabled column should be visible and expandable
  • Data use undeclared data categories should say "11 system undeclared data categories"
  • Navigate back to the system and change the data category on the data use to user
  • Navigate back to the datamap report table. Enable the column again. The Data use undeclared data categories column should now show a single undeclared data category, System Data: Operations Data

Pre-Merge Checklist

  • All CI Pipelines Succeeded
  • Issue Requirements are Met
  • Update CHANGELOG.md

Copy link

vercel bot commented Apr 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
fides-plus-nightly ⬜️ Ignored (Inspect) Visit Preview Apr 22, 2024 11:52pm

Copy link

cypress bot commented Apr 9, 2024

Passing run #7320 ↗︎

0 4 0 0 Flakiness 0
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.

Details:

Merge 2ee07d0 into c7df743...
Project: fides Commit: 6d219f6f22 ℹ️
Status: Passed Duration: 00:33 💡
Started: Apr 18, 2024 8:09 PM Ended: Apr 18, 2024 8:10 PM

Review all test suite changes for PR #4781 ↗︎

Copy link

codecov bot commented Apr 9, 2024

Codecov Report

Attention: Patch coverage is 95.45455% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 86.62%. Comparing base (c7df743) to head (2ee07d0).
Report is 1 commits behind head on main.

Files Patch % Lines
src/fides/api/models/sql_models.py 93.75% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4781      +/-   ##
==========================================
+ Coverage   86.61%   86.62%   +0.01%     
==========================================
  Files         339      340       +1     
  Lines       20090    20132      +42     
  Branches     2586     2595       +9     
==========================================
+ Hits        17400    17440      +40     
- Misses       2217     2218       +1     
- Partials      473      474       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@galvana galvana requested a review from adamsachs April 15, 2024 22:08
@galvana galvana marked this pull request as ready for review April 15, 2024 22:13
@galvana galvana changed the title Undeclared data category helper functions Undeclared data categories Apr 15, 2024
@@ -47,7 +47,8 @@ export const ColumnSettingsModal = <T,>({
.map((c) => ({
id: c.id,
displayText: c.columnDef?.meta?.displayText || c.id,
isVisible: c.getIsVisible(),
isVisible:
tableInstance.getState().columnVisibility[c.id] ?? c.getIsVisible(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

requirements.txt Show resolved Hide resolved
Comment on lines +510 to +512
system = relationship(
System, back_populates="privacy_declarations", lazy="selectin"
)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need to be careful of this change, it makes the system retrieval on privacy declarations eager

Copy link
Contributor

Choose a reason for hiding this comment

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

Are you concerned about performance on this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that's my main concern with that change. I'm planning on running nox -s performance_tests between main and this branch to see if there are any significant timing changes.

Copy link
Contributor

@pattisdr pattisdr Apr 18, 2024

Choose a reason for hiding this comment

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

Systems already feel very bogged down, at some point we may reach a tipping point where we need to rearchitect some of this - not this specifically I just mean generally System/Privacy Declaration

@pattisdr pattisdr self-requested a review April 16, 2024 15:10
@pattisdr
Copy link
Contributor

Plan to start review Wed 4/17 -

Copy link
Contributor

@pattisdr pattisdr left a comment

Choose a reason for hiding this comment

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

this is looking great, I just have a few questions, also these are the best testing instructions I've ever seen. Really helpful for someone that wasn't involved in the conversations for this feature.

src/fides/api/models/sql_models.py Show resolved Hide resolved
src/fides/api/util/taxonomy_utils.py Show resolved Hide resolved
src/fides/api/models/sql_models.py Outdated Show resolved Hide resolved
src/fides/api/models/sql_models.py Show resolved Hide resolved
@galvana galvana requested a review from pattisdr April 18, 2024 19:51
@galvana galvana merged commit 887b31c into main Apr 22, 2024
20 checks passed
@galvana galvana deleted the PROD-1873-undeclared_data_categories branch April 22, 2024 23:53
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