-
Notifications
You must be signed in to change notification settings - Fork 84
ENG-2149: basic DB support for monitor stewards #7131
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7131 +/- ##
=======================================
Coverage 87.17% 87.17%
=======================================
Files 534 535 +1
Lines 35312 35325 +13
Branches 4113 4113
=======================================
+ Hits 30783 30796 +13
Misses 3638 3638
Partials 891 891 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
1973231 to
6674d0c
Compare
adamsachs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quick self review:
| return set(endpoint_scopes.scopes).issubset(user_scopes) | ||
|
|
||
|
|
||
| def roles_have_scopes(roles: List[str], required_scopes: Iterable[str]) -> bool: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a simple abstraction for some scope/role checks, used in the fidesplus branch.
i wanted to leverage this same helper in other utility methods already in this module, to make the code DRYer, but it doesn't quite work, because the helpers here generally take the scopes directly from the endpoint as SecurityScopes
...api/alembic/migrations/versions/xx_2025_12_18_1400_b9c8e7f6d5a4_add_monitor_steward_table.py
Outdated
Show resolved
Hide resolved
Greptile Summary
Important Files Changed
Confidence score: 4/5
PR Description Notes:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9 files reviewed, 3 comments
...api/alembic/migrations/versions/xx_2025_12_23_1400_b9c8e7f6d5a4_add_monitor_steward_table.py
Show resolved
Hide resolved
...api/alembic/migrations/versions/xx_2025_12_23_1400_b9c8e7f6d5a4_add_monitor_steward_table.py
Show resolved
Hide resolved
051481d to
429dee1
Compare
| sa.ForeignKeyConstraint(["user_id"], ["fidesuser.id"], ondelete="CASCADE"), | ||
| sa.PrimaryKeyConstraint("id"), | ||
| sa.UniqueConstraint( | ||
| "user_id", "monitor_config_id", name="uq_monitorsteward_user_monitor" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
decided to add this to enforce uniqueness, i.e. at the moment we'll only support a single link between users and monitors. i got worried about accidental duplicates and the complexity to support multiple types of joins was not worth it for this first increment - we only need a single join, and it shouldn't be hard to remove constraints as we go forward (the opposite is not true - harder to add constraints then remove them!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9 files reviewed, 1 comment
vcruces
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! I tested adding, removing, and fetching monitor stewards. I also tested filtering by steward in /aggregate-results, and everything worked as expected. The migration applied and rolled back cleanly
Ticket ENG-2149
Description Of Changes
Initial DB model support for monitor stewards: join table for many-to-many relationship between users and monitors.
Steps to Confirm
Pre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and works