server: Add resilience to realm reference migration script#4084
server: Add resilience to realm reference migration script#4084
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0804102de0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # patch -R -p0 < <name>.patch | ||
|
|
||
| set -euo pipefail | ||
| set -uo pipefail |
There was a problem hiding this comment.
Restore fail-fast for unhandled command failures
Dropping -e from the shell options means failures outside the two explicit sed/mv checks are now silently ignored, so the script can keep mutating realm files even when prerequisite steps fail. A concrete case is inability to create or append the rollback patch file (e.g., unwritable CWD): > "$PATCH_FILE"/>> "$PATCH_FILE" can fail, but the run still reports updates and proceeds without a valid rollback artifact, which is a data-safety regression compared with the previous fail-fast behavior.
Useful? React with 👍 / 👎.
When I ran the script in production it choked and aborted on a file in a realm with a space in the name. This adds more thorough handling for special characters in paths and also notes errors for listing at the end instead of aborting.