Skip to content

Change default mtree schema from "spock" to "pgedge_ace"#116

Open
mason-sharp wants to merge 1 commit intomainfrom
task/default-schema
Open

Change default mtree schema from "spock" to "pgedge_ace"#116
mason-sharp wants to merge 1 commit intomainfrom
task/default-schema

Conversation

@mason-sharp
Copy link
Copy Markdown
Member

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".

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>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 20, 2026

📝 Walkthrough

Walkthrough

The default database schema for Merkle tree CDC metadata changed from "spock" to "pgedge_ace" across configuration files, documentation, and tooling. A new command-line flag (-S) was added to visualise.sh to allow custom schema specification. Breaking change documentation was added.

Changes

Cohort / File(s) Summary
Configuration Schema Update
ace.yaml, internal/cli/default_config.yaml
Updated mtree.cdc.schema default value from "spock" to "pgedge_ace" in both files.
Documentation Updates
docs/CHANGELOG.md, docs/configuration.md
Added breaking change entry in CHANGELOG documenting the schema default migration; updated configuration documentation to reflect the new "pgedge_ace" default with migration guidance.
Script Enhancement
visualise.sh
Added -S flag for custom schema specification, updated default schema from spock to pgedge_ace, and revised usage text and examples accordingly.

Poem

🐰 With whiskers twitched and joy so bright,
We hop from spock to pgedge-ace's light!
The schema shifts, the flags take flight,
A breaking change done oh-so-right! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: updating the default mtree schema from 'spock' to 'pgedge_ace', which is the primary purpose of this PR.
Description check ✅ Passed The description is directly related to the changeset, covering the key files modified (ace.yaml, default_config.yaml, docs, visualise.sh) and explaining the breaking change and migration guidance for users.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch task/default-schema

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 34f13e0 and e528c2c.

📒 Files selected for processing (5)
  • ace.yaml
  • docs/CHANGELOG.md
  • docs/configuration.md
  • internal/cli/default_config.yaml
  • visualise.sh

Comment thread visualise.sh
Comment on lines +37 to 40
while getopts ":S:s:t:H:U:d:hv" opt; do
case "$opt" in
S) ace_schema="$OPTARG" ;;
s) table_schema="$OPTARG" ;;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant