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

LA-41 Update POST endpoints for data categories, subjects and uses for new taxonomy functionality #5468

Merged
merged 9 commits into from
Nov 19, 2024

Conversation

eastandwestwind
Copy link
Contributor

@eastandwestwind eastandwestwind commented Nov 6, 2024

Closes https://ethyca.atlassian.net/browse/LA-41

Description Of Changes

Update POST endpoints for data categories, subjects and uses for new taxonomy functionality. Specifically enables us to do 2 things:

  1. Create a new resource without having to specify a fides_key. We generate fides_key in the BE in this case
  2. When we attempt to create a new resource that has the same name as a disabled resource, we automatically re-enable that existing resource

Code Changes

  • Adds new overrides to our generic endpoints for taxonomy
  • Adds test assertions for all new use cases

Steps to Confirm

  • Confirm that all unit tests pass
  • To manually test, you'll need to manually ping the API for POST /data_use, POST /data_category, and POST /data_subejct. Confirm that you can create a resource without having to specify a fides key

Pre-Merge Checklist

  • All CI Pipelines Succeeded
  • Documentation:
    • documentation complete, PR opened in fidesdocs
    • documentation issue created in fidesdocs
    • if there are any new client scopes created as part of the pull request, remember to update public-facing documentation that references our scope registry
  • Issue Requirements are Met
  • Relevant Follow-Up Issues Created
  • Update CHANGELOG.md
  • For API changes, the Postman collection has been updated
  • If there are any database migrations:
    • Ensure that your downrev is up to date with the latest revision on main
    • Ensure that your downgrade() migration is correct and works
      • If a downgrade migration is not possible for this change, please call this out in the PR description!

Copy link

vercel bot commented Nov 6, 2024

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

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
fides-plus-nightly ⬜️ Ignored (Inspect) Visit Preview Nov 19, 2024 3:27pm

@eastandwestwind eastandwestwind requested a review from a team as a code owner November 6, 2024 15:53
Copy link

cypress bot commented Nov 6, 2024

fides    Run #11077

Run Properties:  status check passed Passed #11077  •  git commit ae466fd2a6 ℹ️: Merge 477c17ebcb7e9878a75bd5dd0a02c0f5665690ce into 6fc80862e4123e0a335cf52f9678...
Project fides
Branch Review refs/pull/5468/merge
Run status status check passed Passed #11077
Run duration 00m 39s
Commit git commit ae466fd2a6 ℹ️: Merge 477c17ebcb7e9878a75bd5dd0a02c0f5665690ce into 6fc80862e4123e0a335cf52f9678...
Committer Catherine Smith
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 4
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.
View all changes introduced in this branch ↗︎

model.active is False,
)
if disabled_resource_with_name:
return model.update(db=db, data=disabled_resource_with_name, active=True) # type: ignore[union-attr]
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if the incoming data doesn't match the DB model we're reactivating? Should we pass in the incoming data instead of the disabled_resource_with_name?

Suggested change
return model.update(db=db, data=disabled_resource_with_name, active=True) # type: ignore[union-attr]
return model.update(db=db, data=data, active=True) # type: ignore[union-attr]

Copy link
Contributor Author

@eastandwestwind eastandwestwind Nov 19, 2024

Choose a reason for hiding this comment

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

Yes good call!

Copy link
Contributor

@galvana galvana left a comment

Choose a reason for hiding this comment

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

Thanks for making the recommended changes, approved!

@eastandwestwind eastandwestwind merged commit 8c59e5d into main Nov 19, 2024
37 checks passed
Copy link

cypress bot commented Nov 19, 2024

fides    Run #11081

Run Properties:  status check passed Passed #11081  •  git commit 8c59e5d396: LA-41 Update POST endpoints for data categories, subjects and uses for new taxo...
Project fides
Branch Review main
Run status status check passed Passed #11081
Run duration 00m 37s
Commit git commit 8c59e5d396: LA-41 Update POST endpoints for data categories, subjects and uses for new taxo...
Committer Catherine Smith
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 4
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.
View all changes introduced in this branch ↗︎

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