fix: give mysqlsh a writable home dir#203
Merged
Merged
Conversation
Shadrack Nicholas (shadracnicholas)
approved these changes
May 28, 2026
This was referenced Jun 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
joinSnapshotErrorsininternal/snapshot/errors.goto aggregate errors, prioritizing non-canceled errors and only includingcontext.Canceledif it is the sole error.CreateBackupandRestoreBackupininternal/snapshot/s3.goto usejoinSnapshotErrors, improving error reporting consistency. [1] [2]internal/snapshot/errors_test.goto verify the new error joining behavior.MySQL Shell environment isolation:
MySQLShell.runininternal/util/mysql_shell.goto create a temporary home directory and.configfor each run, ensuring no interference with the user's environment.buildMySQLShellEnvto overrideHOMEandXDG_CONFIG_HOMEin the shell environment, and corresponding tests ininternal/util/mysql_shell_env_test.go. [1] [2]mysqlShellConfigHomeEnvKeyconstant for clarity and maintainability.