Fix remaining 8.4+ templates and change module path to ProxySQL/dbdeployer#24
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (98)
✨ Finishing Touches🧪 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 |
Summary of ChangesHello, 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 Highlights
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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 TOandSTART/STOP/RESET REPLICAvsSLAVE. - 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.
| {{ 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}}' |
There was a problem hiding this comment.
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}}).
| 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
…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.
c93bbf2 to
2b3d08f
Compare
Summary
Two changes in this PR:
1. MySQL 8.4+ compatibility for remaining templates
group/init_nodes.gotxt: version-awareCHANGE REPLICATION SOURCE TOreplication/semi_sync_start.gotxt: version-awareSTART/STOP REPLICAsingle/clear.gotxt: version-awarestop/reset replicagroup_replication.go: pass replication command fields to template data2. Module path change
Updates
go.modand all 94 Go source files fromgithub.com/datacharmer/dbdeployertogithub.com/ProxySQL/dbdeployer.Test results