Skip to content

Fix remaining 8.4+ templates and change module path to ProxySQL/dbdeployer#24

Merged
renecannao merged 2 commits intomasterfrom
fix/group-repl-compat-and-module-path
Mar 24, 2026
Merged

Fix remaining 8.4+ templates and change module path to ProxySQL/dbdeployer#24
renecannao merged 2 commits intomasterfrom
fix/group-repl-compat-and-module-path

Conversation

@renecannao
Copy link
Copy Markdown

Summary

Two changes in this PR:

1. MySQL 8.4+ compatibility for remaining templates

  • group/init_nodes.gotxt: version-aware CHANGE REPLICATION SOURCE TO
  • replication/semi_sync_start.gotxt: version-aware START/STOP REPLICA
  • single/clear.gotxt: version-aware stop/reset replica
  • group_replication.go: pass replication command fields to template data

2. Module path change

Updates go.mod and all 94 Go source files from github.com/datacharmer/dbdeployer to github.com/ProxySQL/dbdeployer.

Test results

  • All 9 unit test packages pass
  • Build succeeds with new module path

Copilot AI review requested due to automatic review settings March 23, 2026 23:42
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 23, 2026

Warning

Rate limit exceeded

@renecannao has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 9 minutes and 20 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2016b5cc-0372-4c4d-bebf-66202a0948d9

📥 Commits

Reviewing files that changed from the base of the PR and between ee4342f and 2b3d08f.

📒 Files selected for processing (98)
  • abbreviations/abbreviations.go
  • abbreviations/abbreviations_test.go
  • cmd/admin.go
  • cmd/admin_default_sandbox.go
  • cmd/cookbook.go
  • cmd/data_load.go
  • cmd/defaults.go
  • cmd/delete.go
  • cmd/delete_binaries.go
  • cmd/deploy.go
  • cmd/downloads.go
  • cmd/export.go
  • cmd/export_test.go
  • cmd/global.go
  • cmd/import.go
  • cmd/info.go
  • cmd/init.go
  • cmd/multiple.go
  • cmd/remote.go
  • cmd/replication.go
  • cmd/root.go
  • cmd/sandboxes.go
  • cmd/single.go
  • cmd/templates.go
  • cmd/tree.go
  • cmd/unpack.go
  • cmd/update.go
  • cmd/use.go
  • cmd/versions.go
  • common/capabilities.go
  • common/capabilities_test.go
  • common/checks.go
  • common/checks_test.go
  • common/fileutil.go
  • common/fileutil_test.go
  • common/stack_test.go
  • common/strutils.go
  • common/strutils_test.go
  • common/tprintf.go
  • common/tprintf_test.go
  • common/version_test.go
  • concurrent/concurrent.go
  • cookbook/cookbook_templates.go
  • cookbook/recipes.go
  • cookbook/recipes_test.go
  • data_load/data_load.go
  • defaults/catalog.go
  • defaults/defaults.go
  • defaults/logging.go
  • docs/coding/minimal-sandbox.go
  • docs/coding/minimal-sandbox2.go
  • downloads/remote_registry.go
  • downloads/remote_registry_test.go
  • downloads/remote_tarballs.go
  • go.mod
  • main.go
  • mkreadme/make_readme.go
  • mkwiki/make_docs.go
  • ops/defaults.go
  • ops/delete_binaries.go
  • ops/downloads.go
  • ops/downloads_test.go
  • ops/init.go
  • ops/sql.go
  • ops/unpack.go
  • ops/versions.go
  • rest/rest.go
  • rest/rest_test.go
  • sandbox/group_replication.go
  • sandbox/group_templates.go
  • sandbox/import_templates.go
  • sandbox/mock.go
  • sandbox/multi-source-replication.go
  • sandbox/multi_templates.go
  • sandbox/multiple.go
  • sandbox/ndb_replication.go
  • sandbox/ndb_templates.go
  • sandbox/pxc_replication.go
  • sandbox/pxc_templates.go
  • sandbox/repl_templates.go
  • sandbox/replication.go
  • sandbox/sandbox.go
  • sandbox/sandbox_test.go
  • sandbox/templates.go
  • sandbox/templates/group/init_nodes.gotxt
  • sandbox/templates/replication/semi_sync_start.gotxt
  • sandbox/templates/single/clear.gotxt
  • sandbox/tidb_templates.go
  • test/sort_versions.go
  • ts/commands.go
  • ts/conditions.go
  • ts/setup.go
  • ts/test_helpers.go
  • ts/ts_test.go
  • ts_static/ts_static_test.go
  • unpack/gunzip.go
  • unpack/unpack-shell.go
  • unpack/unpack.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/group-repl-compat-and-module-path

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.

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces crucial updates to dbdeployer, enhancing its compatibility with newer MySQL versions and formalizing its new organizational home. It ensures that replication operations function correctly with MySQL 8.4 and later by adapting template commands, and it completes the migration of the project's Go module path to github.com/ProxySQL/dbdeployer, reflecting the project's new ownership.

Highlights

  • MySQL 8.4+ Compatibility: Updated replication-related templates (group/init_nodes.gotxt, replication/semi_sync_start.gotxt, single/clear.gotxt) to use version-aware commands for CHANGE REPLICATION SOURCE TO and START/STOP REPLICA, ensuring compatibility with MySQL 8.4 and newer versions. The group_replication.go file was also updated to pass these replication command fields to template data.
  • Go Module Path Migration: Migrated the Go module path across the entire codebase from github.com/datacharmer/dbdeployer to github.com/ProxySQL/dbdeployer. This change affects the go.mod file and all 94 Go source files, updating import statements accordingly.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates dbdeployer to (1) generate replication/group-replication scripts that are compatible with MySQL 8.4+ syntax changes, and (2) rename the Go module path from github.com/datacharmer/dbdeployer to github.com/ProxySQL/dbdeployer, updating imports accordingly.

Changes:

  • Make remaining templates version-aware for CHANGE REPLICATION SOURCE TO and START/STOP/RESET REPLICA vs SLAVE.
  • Plumb replication command fields into group replication template data.
  • Rename the Go module path and update Go imports (and a couple of hardcoded GitHub wiki URLs).

Reviewed changes

Copilot reviewed 98 out of 98 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
unpack/unpack.go Update imports to new module path.
unpack/unpack-shell.go Update imports to new module path.
unpack/gunzip.go Update imports to new module path.
ts_static/ts_static_test.go Update imports to new module path.
ts/ts_test.go Update imports to new module path.
ts/test_helpers.go Update imports to new module path.
ts/setup.go Update imports to new module path.
ts/conditions.go Update imports to new module path.
ts/commands.go Update imports to new module path.
test/sort_versions.go Update imports to new module path.
sandbox/tidb_templates.go Update imports to new module path.
sandbox/templates/single/clear.gotxt Add version-aware stop/reset replication commands for MySQL 8.0.22+.
sandbox/templates/replication/semi_sync_start.gotxt Switch to template-provided Start/StopReplica commands.
sandbox/templates/group/init_nodes.gotxt Use version-aware ChangeMasterTo + parameter names for 8.0.23+ syntax.
sandbox/templates.go Update imports to new module path.
sandbox/sandbox_test.go Update imports to new module path.
sandbox/sandbox.go Update imports to new module path.
sandbox/replication.go Update imports to new module path.
sandbox/repl_templates.go Update imports to new module path.
sandbox/pxc_templates.go Update imports to new module path.
sandbox/pxc_replication.go Update imports to new module path.
sandbox/ndb_templates.go Update imports to new module path.
sandbox/ndb_replication.go Update imports to new module path.
sandbox/multiple.go Update imports to new module path.
sandbox/multi_templates.go Update imports to new module path.
sandbox/multi-source-replication.go Update imports to new module path.
sandbox/mock.go Update imports to new module path.
sandbox/import_templates.go Update imports to new module path.
sandbox/group_templates.go Update imports to new module path.
sandbox/group_replication.go Pass replication command strings into group replication template data; update imports.
rest/rest_test.go Update imports to new module path.
rest/rest.go Update imports to new module path.
ops/versions.go Update imports to new module path.
ops/unpack.go Update imports to new module path.
ops/sql.go Update imports to new module path.
ops/init.go Update imports to new module path.
ops/downloads_test.go Update imports to new module path.
ops/downloads.go Update imports to new module path.
ops/delete_binaries.go Update imports to new module path.
ops/defaults.go Update imports to new module path.
mkwiki/make_docs.go Update wiki base URLs to new GitHub org/repo.
mkreadme/make_readme.go Update imports to new module path.
main.go Update imports to new module path.
go.mod Change module path to github.com/ProxySQL/dbdeployer.
downloads/remote_tarballs.go Update imports to new module path.
downloads/remote_registry_test.go Update imports to new module path.
downloads/remote_registry.go Update imports to new module path.
docs/coding/minimal-sandbox2.go Update imports to new module path.
docs/coding/minimal-sandbox.go Update imports to new module path.
defaults/logging.go Update imports to new module path.
defaults/defaults.go Update imports to new module path.
defaults/catalog.go Update imports to new module path.
data_load/data_load.go Update imports to new module path.
cookbook/recipes_test.go Update imports to new module path.
cookbook/recipes.go Update imports to new module path.
cookbook/cookbook_templates.go Update imports to new module path.
concurrent/concurrent.go Update imports to new module path.
common/version_test.go Update imports to new module path.
common/tprintf_test.go Update imports to new module path.
common/tprintf.go Update imports to new module path.
common/strutils_test.go Update imports to new module path.
common/strutils.go Update imports to new module path.
common/stack_test.go Update imports to new module path.
common/fileutil_test.go Update imports to new module path.
common/fileutil.go Update imports to new module path.
common/checks_test.go Update imports to new module path.
common/checks.go Update imports to new module path.
common/capabilities_test.go Update imports to new module path.
common/capabilities.go Update imports to new module path.
cmd/versions.go Update imports to new module path.
cmd/use.go Update imports to new module path.
cmd/update.go Update imports to new module path.
cmd/unpack.go Update imports to new module path.
cmd/tree.go Update imports to new module path.
cmd/templates.go Update imports to new module path.
cmd/single.go Update imports to new module path.
cmd/sandboxes.go Update imports to new module path.
cmd/root.go Update imports to new module path.
cmd/replication.go Update imports to new module path.
cmd/remote.go Update imports to new module path.
cmd/multiple.go Update imports to new module path.
cmd/init.go Update imports to new module path.
cmd/info.go Update imports to new module path.
cmd/import.go Update imports to new module path.
cmd/global.go Update imports to new module path.
cmd/export_test.go Update imports to new module path.
cmd/export.go Update imports to new module path.
cmd/downloads.go Update imports to new module path.
cmd/deploy.go Update imports to new module path.
cmd/delete_binaries.go Update imports to new module path.
cmd/delete.go Update imports to new module path.
cmd/defaults.go Update imports to new module path.
cmd/data_load.go Update imports to new module path.
cmd/cookbook.go Update imports to new module path.
cmd/admin_default_sandbox.go Update imports to new module path.
cmd/admin.go Update imports to new module path.
abbreviations/abbreviations_test.go Update imports to new module path.
abbreviations/abbreviations.go Update imports to new module path.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 12 to +15
{{ range .Slaves }}
$SBDIR/{{.NodeLabel}}{{.Node}}/use -u root -e 'STOP SLAVE'
$SBDIR/{{.NodeLabel}}{{.Node}}/use -u root -e '{{.StopReplica}}'
$SBDIR/{{.NodeLabel}}{{.Node}}/use -u root -e 'set global rpl_semi_sync_slave_enabled=1'
$SBDIR/{{.NodeLabel}}{{.Node}}/use -u root -e 'START SLAVE'
$SBDIR/{{.NodeLabel}}{{.Node}}/use -u root -e '{{.StartReplica}}'
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

semi_sync_start.gotxt now references {{.StopReplica}} inside range .Slaves, but the per-slave template data built in CreateMasterSlaveReplication only includes StartReplica (not StopReplica). This will render as <no value> and break the generated script. Either add StopReplica to each slave map in the replication template data, or change the template to reference the root value (e.g. {{$.StopReplica}}).

Copilot uses AI. Check for mistakes.
Comment on lines 19 to +28
VERSION={{.Version}}
sortable_version=$(echo "$VERSION" | awk -F. '{printf "%03d%03d%03d", $1, $2, $3}')
is_slave=$(ls data | grep relay)
if [ -n "$is_slave" ]
then
./use -e "stop slave; reset slave;"
if [[ "v$sortable_version" > "v008000022" ]] || [[ "v$sortable_version" == "v008000022" ]]; then
./use -e "stop replica; reset replica;"
else
./use -e "stop slave; reset slave;"
fi
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

The new stop/reset replica switch is based only on the numeric version and will incorrectly use REPLICA commands for MariaDB (e.g. 10.x), where STOP/RESET SLAVE is still expected. Since single-template data already provides Flavor and SortableVersion, consider using those instead of re-parsing .Version with awk, and gate REPLICA syntax on non-MariaDB flavors + SortableVersion >= 008000022.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces two main changes: compatibility with MySQL 8.4+ for several templates and a project-wide module path update. The template changes correctly handle version-specific SQL syntax for replication commands. The Go code changes properly support this by passing the necessary version-aware commands to the templates. The module path update from github.com/datacharmer/dbdeployer to github.com/ProxySQL/dbdeployer has been applied consistently across all relevant files. I have one minor suggestion for improving the shell script syntax in one of the templates.

if [ -n "$is_slave" ]
then
./use -e "stop slave; reset slave;"
if [[ "v$sortable_version" > "v008000022" ]] || [[ "v$sortable_version" == "v008000022" ]]; then
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The conditional check for the version can be simplified. Instead of using two separate [[...]] blocks, you can use the >= operator within a single block for a more concise and readable expression.

        if [[ "v$sortable_version" >= "v008000022" ]]; then

…mplates

- group/init_nodes.gotxt: use version-aware CHANGE REPLICATION SOURCE TO
- replication/semi_sync_start.gotxt: use version-aware START/STOP REPLICA
- single/clear.gotxt: use version-aware stop/reset replica
- group_replication.go: pass replication command fields to template data
…dbdeployer

Updates go.mod and all 94 Go source files to use the new module path
github.com/ProxySQL/dbdeployer, reflecting the project's new home
under the ProxySQL organization.
@renecannao renecannao force-pushed the fix/group-repl-compat-and-module-path branch from c93bbf2 to 2b3d08f Compare March 24, 2026 00:40
@renecannao renecannao merged commit 7de31c8 into master Mar 24, 2026
5 checks passed
@renecannao renecannao deleted the fix/group-repl-compat-and-module-path branch March 24, 2026 00:41
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.

2 participants