Document the AccessRuleId write contract on ICollectionRepository - #8186
Document the AccessRuleId write contract on ICollectionRepository#8186Hinton wants to merge 1 commit into
Conversation
CreateAsync and ReplaceAsync both ignore Collection.AccessRuleId, and that is a contract of the interface rather than a quirk of MSSQL — EF Core enforces the same thing through PropertySaveBehavior.Ignore in DatabaseContext. Documenting it only on the Dapper implementation hid it from the consumers who need it and implied it was provider-specific. Move the contract to ICollectionRepository, where callers see it and every implementation inherits it. What stays on the Dapper methods is only the mechanism by which MSSQL upholds it.
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE This is a documentation-only change that moves the Code Review DetailsNo findings. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8186 +/- ##
=======================================
Coverage 68.21% 68.21%
=======================================
Files 2343 2343
Lines 101919 101919
Branches 9197 9197
=======================================
+ Hits 69520 69525 +5
Misses 30085 30085
+ Partials 2314 2309 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🎟️ Tracking
Follow-up to #7981 review comment.
📔 Objective
CreateAsyncandReplaceAsyncboth ignoreCollection.AccessRuleId— a new collection is always created ungoverned, and an ordinary collection edit can neither erase nor forge a PAM association. That is a contract ofICollectionRepository, not a quirk of MSSQL: EF Core enforces exactly the same thing viaPropertySaveBehavior.Ignoreon the property inDatabaseContext, and both are covered by the shared[DatabaseTheory]tests inCollectionRepositoryReplaceTests.Documenting it only on the Dapper implementation hid it from the consumers who need it, and implied it was provider-specific.
ICollectionRepository.CreateAsync/ReplaceAsync, where callers see it and every implementation inherits it.@AccessRuleIdand deliberately ignore it).Documentation only — no behaviour change.