Skip to content

Add --with-proxysql flag to single sandbox deployment#47

Merged
renecannao merged 1 commit intomasterfrom
phase2b/task6-single-with-proxysql
Mar 24, 2026
Merged

Add --with-proxysql flag to single sandbox deployment#47
renecannao merged 1 commit intomasterfrom
phase2b/task6-single-with-proxysql

Conversation

@renecannao
Copy link
Copy Markdown

Summary

  • Adds --with-proxysql flag to dbdeployer deploy single command
  • When set, deploys a ProxySQL instance alongside the single MySQL sandbox with one backend in hostgroup 0 (no readers)
  • Follows the same pattern used in cmd/replication.go, calling sandbox.DeployProxySQLForTopology with nil for slavePorts

Test plan

  • dbdeployer deploy single --help shows --with-proxysql flag
  • dbdeployer deploy single <version> --with-proxysql deploys ProxySQL in proxysql/ subdirectory
  • ProxySQL is configured with single backend on hostgroup 0
  • Regular dbdeployer deploy single <version> (without flag) still works as before

Closes #41

Copilot AI review requested due to automatic review settings March 24, 2026 01:49
@gemini-code-assist
Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 24, 2026

Warning

Rate limit exceeded

@renecannao has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 0 minutes and 49 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: 4e6233a6-70e8-4b5c-8eca-dc9793cdf0a3

📥 Commits

Reviewing files that changed from the base of the PR and between 5402472 and 2d2a495.

📒 Files selected for processing (1)
  • cmd/single.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch phase2b/task6-single-with-proxysql

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.

@renecannao renecannao merged commit d6ee418 into master Mar 24, 2026
8 of 18 checks passed
@renecannao renecannao deleted the phase2b/task6-single-with-proxysql branch March 24, 2026 01:50
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

Adds an opt-in --with-proxysql flag to the dbdeployer deploy single command so that a ProxySQL instance is deployed alongside a newly created single sandbox, using the existing sandbox.DeployProxySQLForTopology helper (single backend in hostgroup 0).

Changes:

  • Add --with-proxysql persistent flag to deploy single.
  • After creating the standalone sandbox, optionally deploy ProxySQL into a proxysql/ subdirectory using the single sandbox’s port from its sandbox description.

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

Comment thread cmd/single.go
Comment on lines +469 to +475
origin := args[0]
if args[0] != sd.BasedirName {
origin = sd.BasedirName
}
sandboxDir := path.Join(sd.SandboxDir, defaults.Defaults().SandboxPrefix+common.VersionToName(origin))
if sd.DirName != "" {
sandboxDir = path.Join(sd.SandboxDir, sd.DirName)
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

The sandbox directory calculation doesn’t match the logic used in sandbox.createSingleSandbox when sd.DirName is empty. In particular, if the user supplies --binary-version and the basedir directory name differs from sd.Version (e.g. basedir name contains dots or other characters), createSingleSandbox uses defaults.Defaults().SandboxPrefix + sd.BasedirName (no VersionToName conversion), but this code applies common.VersionToName(origin) and can point to a non-existent directory. Consider mirroring the exact directory naming logic from createSingleSandbox: if sd.DirName is empty, build the dir name based on whether sd.Version != sd.BasedirName and only apply VersionToName to sd.Version in the sd.Version == sd.BasedirName case.

Suggested change
origin := args[0]
if args[0] != sd.BasedirName {
origin = sd.BasedirName
}
sandboxDir := path.Join(sd.SandboxDir, defaults.Defaults().SandboxPrefix+common.VersionToName(origin))
if sd.DirName != "" {
sandboxDir = path.Join(sd.SandboxDir, sd.DirName)
var sandboxDir string
if sd.DirName != "" {
// If a custom directory name was specified, use it directly.
sandboxDir = path.Join(sd.SandboxDir, sd.DirName)
} else {
// Mirror the naming logic from createSingleSandbox when DirName is empty.
prefix := defaults.Defaults().SandboxPrefix
if sd.BasedirName != "" && sd.Version != sd.BasedirName {
// When the basedir name differs from the version (e.g. provided via --binary-version),
// use the basedir name as-is without applying VersionToName.
sandboxDir = path.Join(sd.SandboxDir, prefix+sd.BasedirName)
} else {
// When the basedir name matches the version (or is empty), apply VersionToName to the version.
sandboxDir = path.Join(sd.SandboxDir, prefix+common.VersionToName(sd.Version))
}

Copilot uses AI. Check for mistakes.
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.

Add --with-proxysql flag to single deployment

2 participants