chore(ers): add BDD scenarios for condition operators equals, contains, regex - #3797
Conversation
…s, regex Cover the three untested condition operators in multi-strategy ERS: - equals: exact match, negative match, case-insensitive (EqualFold) - contains: substring match, negative match, AND logic (multiple conditions) - regex: pattern match, negative match, AND logic (regex + exists) All 9 scenarios use LDAP strategies with user_name entities to avoid the claims provider bug (opentdf#3790). Each feature file is @stateless and runs independently. Part of DSPX-4100. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughAdds BDD feature coverage for ERS ChangesERS condition operators
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
With @stateless, the platform starts once per feature file and the ERS config from the Background is fixed for all scenarios. Scenarios that need different strategy configs must be in separate feature files. Split into 5 feature files: - ers-condition-equals: match + no-match (shared strategy) - ers-condition-equals-ci: case-insensitive (values: ["ALICE"]) - ers-condition-contains: substring match + no-match - ers-condition-regex: pattern match + no-match - ers-condition-and-logic: multiple conditions AND logic + partial match Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment was edited
Fixes and additions per Elizabeth Healy's review: 1. Fix AND partial-match: change conditions from contains "an" + "di" to contains "a" + "di" so alice matches one (not zero) — properly tests AND short-circuit 2. Fix contains case-insensitivity: change values to ["ALI"] (uppercase) so existing scenarios actually validate case-insensitive matching 3. Add mixed-operator AND: new ers-condition-and-mixed.feature with regex + contains conditions (diana matches both, alice matches only regex) 4. Add multi-value OR: new ers-condition-equals-multi.feature with values: ["alice", "diana"] testing OR-within-condition semantics 5. Array claim testing noted as blocked by opentdf#3790 (requires Entity_Claims which needs JWTClaimsContextKey fix) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
Adds BDD test coverage for the three untested condition operators in multi-strategy ERS strategy matching:
@ers-condition-equals— 3 scenarios: exact match (alice PERMIT), negative match (bob DENY), case-insensitive matching (values: ["ALICE"]matches userNamealice)@ers-condition-contains— 3 scenarios: substring match ("ali"in"alice"PERMIT), negative match (bob DENY), AND logic (twocontainsconditions — only"diana"matches both)@ers-condition-regex— 3 scenarios: pattern match (^[a-d].*matches alice PERMIT), negative match (henry DENY), AND logic (regex + exists conditions)All 9 scenarios use LDAP strategies with
user_nameentities, avoiding the claims provider bug (#3790). Each feature file is@statelessand runs independently.Coverage before/after
existsequalscontainsregexRelated
Test plan
--godog.tags=@ers-condition-equals/@ers-condition-contains/@ers-condition-regex🤖 Generated with Claude Code
Summary by CodeRabbit
contains,equals(including case-insensitive and multi-value),regex, and mixed-operator AND logic.PERMITandDENYresults across the new scenarios.