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

feat!: Add enforcing entity association loader #257

Merged

Conversation

wschurman
Copy link
Member

@wschurman wschurman commented Feb 20, 2025

Why

This adds an enforcing version of the entity association loader and makes the association loader have a similar pattern to loads/mutations.

Before this PR:

entity.associationLoader() // result-based association loader

After this PR:

entity.associationLoader().withAuthorizationResults() // result-based association loader
entity.associationLoader().enforcing() // enforcing association loader

This also moves the queryContext arg into the associationLoader call to match the other loader/mutator methods more closely.

How

Using a similar pattern to loaders and mutators, wrap the result-based association loader in an enforcing wrapper.

Test Plan

Full test coverage.

Copy link

codecov bot commented Feb 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (be9c40e) to head (0e75f7f).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #257   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           78        80    +2     
  Lines         2029      2053   +24     
  Branches       278       277    -1     
=========================================
+ Hits          2029      2053   +24     
Flag Coverage Δ
integration 100.00% <100.00%> (ø)
unittest 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@wschurman wschurman force-pushed the @wschurman/02-20-feat_add_enforcing_entity_association_loader branch from 61ffc23 to 1e7d917 Compare February 20, 2025 21:50
@wschurman wschurman marked this pull request as ready for review February 20, 2025 21:56
@wschurman wschurman requested review from ide and quinlanj February 20, 2025 21:56
@ide
Copy link
Member

ide commented Feb 23, 2025

I imagine we'll also want to make enforcing() be the default for association loaders too.

@wschurman wschurman changed the base branch from @wschurman/02-19-chore_switch_barreling_to_ctix to graphite-base/257 February 24, 2025 03:08
@wschurman wschurman force-pushed the @wschurman/02-20-feat_add_enforcing_entity_association_loader branch from 1e7d917 to 863332f Compare February 24, 2025 03:08
@wschurman wschurman changed the base branch from graphite-base/257 to @wschurman/02-20-chore_add_ci_check_for_needing_to_run_ctix February 24, 2025 03:08
@wschurman wschurman force-pushed the @wschurman/02-20-feat_add_enforcing_entity_association_loader branch from 863332f to adcaf3b Compare February 24, 2025 03:16
@wschurman wschurman force-pushed the @wschurman/02-20-chore_add_ci_check_for_needing_to_run_ctix branch from f624836 to 3ce8e42 Compare February 24, 2025 03:16
Copy link
Member Author

wschurman commented Feb 24, 2025

Merge activity

  • Feb 23, 10:20 PM EST: A user started a stack merge that includes this pull request via Graphite.
  • Feb 23, 10:33 PM EST: Graphite rebased this pull request as part of a merge.
  • Feb 23, 10:35 PM EST: A user merged this pull request with Graphite.

@wschurman wschurman changed the base branch from @wschurman/02-20-chore_add_ci_check_for_needing_to_run_ctix to graphite-base/257 February 24, 2025 03:30
@wschurman wschurman changed the base branch from graphite-base/257 to main February 24, 2025 03:32
@wschurman wschurman force-pushed the @wschurman/02-20-feat_add_enforcing_entity_association_loader branch from adcaf3b to 0e75f7f Compare February 24, 2025 03:33
@wschurman wschurman merged commit c6f74a1 into main Feb 24, 2025
2 checks passed
@wschurman wschurman deleted the @wschurman/02-20-feat_add_enforcing_entity_association_loader branch February 24, 2025 03: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.

2 participants