Skip to content

fix: give mysqlsh a writable home dir#203

Merged
Christos Vontas (cv711) merged 3 commits into
mainfrom
fix/mysqlsh
May 28, 2026
Merged

fix: give mysqlsh a writable home dir#203
Christos Vontas (cv711) merged 3 commits into
mainfrom
fix/mysqlsh

Conversation

@cv711

Copy link
Copy Markdown
Contributor

This pull request introduces improvements to error handling in snapshot operations and enhances the reliability and isolation of the MySQL Shell environment setup. The main changes are the introduction of a utility for joining snapshot errors with special handling for context cancellation, and the creation of a temporary and isolated environment for MySQL Shell executions. Comprehensive tests have been added to ensure the correctness of these changes.

Snapshot error handling improvements:

  • Added joinSnapshotErrors in internal/snapshot/errors.go to aggregate errors, prioritizing non-canceled errors and only including context.Canceled if it is the sole error.
  • Updated CreateBackup and RestoreBackup in internal/snapshot/s3.go to use joinSnapshotErrors, improving error reporting consistency. [1] [2]
  • Added tests in internal/snapshot/errors_test.go to verify the new error joining behavior.

MySQL Shell environment isolation:

  • Modified MySQLShell.run in internal/util/mysql_shell.go to create a temporary home directory and .config for each run, ensuring no interference with the user's environment.
  • Added buildMySQLShellEnv to override HOME and XDG_CONFIG_HOME in the shell environment, and corresponding tests in internal/util/mysql_shell_env_test.go. [1] [2]
  • Defined mysqlShellConfigHomeEnvKey constant for clarity and maintainability.

@cv711
Christos Vontas (cv711) merged commit c80e29d into main May 28, 2026
4 checks passed
@cv711
Christos Vontas (cv711) deleted the fix/mysqlsh branch May 28, 2026 09:55
This was referenced Jun 9, 2026
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