SAP HANA: Get group membership working. Get account type working. - #84
Conversation
WalkthroughIntroduces an early-exit path in preprocessExpressions within pkg/bcel/helpers.go. If the input begins with the literal prefix "cel:", the function now strips this prefix and returns the remaining string immediately, skipping all subsequent processing steps such as quoting and dot-field transformations. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Caller
participant Helpers as preprocessExpressions
Caller->>Helpers: preprocessExpressions(input)
alt input starts with "cel:"
Note right of Helpers: Strip "cel:" prefix
Helpers-->>Caller: return remainder (no further processing)
else
Note right of Helpers: Proceed with normal processing<br/>(quoting, dot-field transforms, etc.)
Helpers-->>Caller: return processed string
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
pkg/bcel/helpers.go (1)
16-18: Update function comment to document the "cel:" prefix behavior.The function comment doesn't mention the new early-exit behavior for expressions prefixed with "cel:". This is a significant feature that should be documented.
Apply this diff to update the comment:
-// preprocessExpressions replaces all column expressions with the appropriate map access. -// It also detects 'bare strings' and automatically quotes them. -// Example input: ".role_name == 'Admin'" -> "cols['role_name'] == 'Admin'". +// preprocessExpressions replaces all column expressions with the appropriate map access. +// It also detects 'bare strings' and automatically quotes them. +// If the expression is prefixed with "cel:", the prefix is stripped and the remainder is returned +// without any preprocessing, allowing raw CEL expressions to be used. +// Example input: ".role_name == 'Admin'" -> "cols['role_name'] == 'Admin'".
🧹 Nitpick comments (1)
pkg/bcel/helpers.go (1)
20-23: Verify "cel:" prefix edge case and add test
- No tests cover the
"cel:"prefix; confirm that returning an empty string for input"cel:"is intended and add a test.- Optional: simplify to
if strings.HasPrefix(expr, "cel:") { return expr[4:] }.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
examples/sap-hana-test.ymlis excluded by none and included by none
📒 Files selected for processing (1)
pkg/bcel/helpers.go(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.go
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.go: Error handling: usefmt.Errorfwith contextual messages; check specific errors witherrors.Is
Organize imports: standard library first, then third-party, then project imports; alphabetize within each group
Naming: CamelCase for exported identifiers; camelCase for unexported; preserve acronyms like ID, URL, HTTP, API
Limit line length to a maximum of 200 characters
Comments for exported items must be complete sentences ending with periods
Do not uselog.Fatalorlog.Panic(ruleguard-enforced)
Files:
pkg/bcel/helpers.go
Description
Useful links:
This also adds a new behavior: If you prefix a mapping with
cel:, we don't replace dots withcol[...]. This lets you use things like string.startsWith() and other CEL functions.Summary by CodeRabbit