-
Notifications
You must be signed in to change notification settings - Fork 3
ENG-932 - add {current user} to "with text" condition #476
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
ENG-932 - add {current user} to "with text" condition #476
Conversation
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
@CodeRabbit full review |
✅ Actions performedFull review triggered. |
📝 WalkthroughWalkthroughAdds special handling for the "{current user}" token in the "with text" translation path, reorders logic to check current-user first, retains regex handling when applicable, and introduces a general string-includes matching fallback for non-regex, non-current-user targets. Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant Translator as conditionToDatalog ("with text")
participant User as CurrentUserResolver
participant Regex as RegexEngine
participant Match as StringIncludes
Caller->>Translator: translate(condition: "with text", target)
alt target == "{current user}"
Translator->>User: getCurrentUser()
User-->>Translator: userName
Translator->>Match: includes?(sourceString, userName)
Match-->>Translator: boolean
Translator-->>Caller: Datalog clauses (includes-based)
else target isRegex
Translator->>Regex: re-pattern(target)
Regex-->>Translator: pattern
Translator->>Regex: re-find(pattern, sourceString)
Regex-->>Translator: boolean
Translator-->>Caller: Datalog clauses (regex-based)
else non-regex general string
Translator->>Match: includes?(sourceString from block/title, target)
Match-->>Translator: boolean
Translator-->>Caller: Datalog clauses (block/title + includes)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Pre-merge checks✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
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 |
Intentionally left
targetOptionsblank, seems like it would just be confusing as it is the only option and 99% of input is raw text, but I'm 50/50 with this decision.Summary by CodeRabbit