refactor(c/driver_manager): replace std::regex in profile interpolation - #4780
refactor(c/driver_manager): replace std::regex in profile interpolation#4780kevinushey wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved blocking issues were identified.
Pull request overview
Replaces regex-based profile interpolation with a linear scanner while preserving existing behavior and adding edge-case coverage.
Changes:
- Adds regression tests for delimiters, whitespace, malformed input, NULs, errors, and nonrecursive expansion.
- Synchronizes C and Go implementations.
- Removes unused regex includes.
File summaries
| File | Description |
|---|---|
go/adbc/drivermgr/adbc_driver_manager.cc |
Removes unused regex include |
go/adbc/drivermgr/adbc_driver_manager_profiles.cc |
Synchronized scanner implementation |
c/driver_manager/adbc_driver_manager.cc |
Removes unused regex include |
c/driver_manager/adbc_driver_manager_test.cc |
Adds regression coverage |
c/driver_manager/adbc_driver_manager_profiles.cc |
Implements scanner-based interpolation |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Thanks Kevin! +1 on the approach, although I'll let David and Matt weigh in on the implementation details (I haven't followed the syntax for env var escapes). The error coming off of the check jobs isn't all that helpful...I can investigate this evening. That workflow hasn't been updated for some time. I haven't heard back from CRAN about the fix that I had submitted...I am guessing it didn't work which is why they archived it, although I do wish they had let me know first 😮💨 . I'll pick this and push to a tweaked CRAN release this evening in case that's somehow faster. |
zeroshade
left a comment
There was a problem hiding this comment.
This looks okay to me, but we should fix the failing CI first
|
I can try to run down the failing CI, but it might take a few iterations (especially since I'll need a maintainer to help run the workflows as I make changes) |
Profile interpolation currently constructs a
std::regexto expand{{ env_var(NAME) }}expressions. Replace it with a linear scanner that preserves whitespace trimming, overlapping delimiters, literal malformed braces, and existing error messages. This removes the regex construction path implicated in #4638.Keep the Go driver manager copies synchronized and remove the remaining unused
<regex>includes. Add regression coverage for delimiter edge cases, whitespace, adjacent substitutions, embedded NULs, long brace sequences, errors, and nonrecursive expansion.The interpolation helper follows the existing internal test-helper export convention (
InternalAdbcprefix andADBC_EXPORT) so shared-library tests link on Linux and Windows.The R check workflow explicitly skips Pandoc installation, which these packages do not need. This avoids the action's automatic dependency probe, which ignores the local driver manager override and fails to find the archived package on CRAN.
Validation:
c/symbols.map, linked and ran interpolation success/error checks, and verified the helper is exported.dotnetis unavailable; no C# files changed.The CRAN GCC 16 sanitizer environment was not reproduced locally.
Closes #4638