Change default mtree schema from "spock" to "pgedge_ace"#116
Change default mtree schema from "spock" to "pgedge_ace"#116mason-sharp wants to merge 1 commit intomainfrom
Conversation
Update ace.yaml, default_config.yaml, configuration docs, and visualise.sh. Add -S flag to visualise.sh for schema override. CHANGELOG documents the breaking change and migration path. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe default database schema for Merkle tree CDC metadata changed from Changes
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@visualise.sh`:
- Around line 37-40: The ace_schema value parsed from getopts (flag -S) is
user-controlled and must be validated before being interpolated into SQL
identifiers; add a validation step in visualise.sh after getopts (or immediately
after assigning ace_schema) that rejects any value that does not match a safe
SQL identifier pattern (e.g., starts with a letter or underscore and contains
only letters, digits or underscores), print a clear error mentioning the -S
argument and ace_schema, and exit non‑zero; ensure the validation is applied to
ace_schema before any use in SQL-building code paths (references: ace_schema,
getopts handling for -S).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 26d8201f-292b-4deb-bfba-396f166093f7
📒 Files selected for processing (5)
ace.yamldocs/CHANGELOG.mddocs/configuration.mdinternal/cli/default_config.yamlvisualise.sh
| while getopts ":S:s:t:H:U:d:hv" opt; do | ||
| case "$opt" in | ||
| S) ace_schema="$OPTARG" ;; | ||
| s) table_schema="$OPTARG" ;; |
There was a problem hiding this comment.
Validate -S input before interpolating it into SQL identifiers.
ace_schema is now user-controlled and is interpolated into SQL identifier context without validation/escaping. Reject invalid identifier input early to prevent malformed SQL and injection-by-quote patterns.
🔧 Proposed fix
while getopts ":S:s:t:H:U:d:hv" opt; do
case "$opt" in
S) ace_schema="$OPTARG" ;;
@@
esac
done
+
+# Validate schema override (unquoted SQL identifier form)
+if [[ ! "$ace_schema" =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]]; then
+ echo "Invalid -S <ace_schema>: must be a valid unquoted SQL identifier" >&2
+ exit 2
+fi🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@visualise.sh` around lines 37 - 40, The ace_schema value parsed from getopts
(flag -S) is user-controlled and must be validated before being interpolated
into SQL identifiers; add a validation step in visualise.sh after getopts (or
immediately after assigning ace_schema) that rejects any value that does not
match a safe SQL identifier pattern (e.g., starts with a letter or underscore
and contains only letters, digits or underscores), print a clear error
mentioning the -S argument and ace_schema, and exit non‑zero; ensure the
validation is applied to ace_schema before any use in SQL-building code paths
(references: ace_schema, getopts handling for -S).
Update ace.yaml, default_config.yaml, configuration docs, and visualise.sh. Add -S flag to visualise.sh for schema override. CHANGELOG documents the breaking change and migration path.
Users of mtree functionality with previous versions will want to change their default schema back to "spock".