chore(cli): improve gen2-migration logging and error handling#14889
Open
iliapolo wants to merge 1 commit into
Open
chore(cli): improve gen2-migration logging and error handling#14889iliapolo wants to merge 1 commit into
iliapolo wants to merge 1 commit into
Conversation
Contributor
Author
|
Running E2E |
- Write debug logs to a temp file so users can share them without re-running with --debug - Surface log file path in error messages - Wrap rollback in try/catch so a failed rollback doesn't mask the original error - Add debug statements in the lock step for easier troubleshooting - Minor spinner text cleanup (remove redundant arrows, use check/cross marks in debug mode) - Log backend download progress in gen1-app - Fix lint suppression placement in e2e package --- Prompt: commit my changes with "chore"
4ad459d to
b98fb50
Compare
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.
Description of changes
Improves the gen2-migration command's debuggability and error resilience.
Debug logging to file
In non-debug mode,
SpinningLogger.debug()calls now write to a temp file at$TMPDIR/amplify-gen2-migration/logs/gen2-migration-<timestamp>.log. When amigration step fails, the error message includes the log file path so users can
share it for troubleshooting without needing to re-run with
--debug.The top-level
run()function catches errors and appends the stacktrace to thedebug log before re-throwing, ensuring the log file always contains the full
failure context.
Rollback error isolation
The auto-rollback path now wraps
implementation.rollback()in its owntry/catch. Previously, a rollback failure would replace the original error,
making it impossible to diagnose the root cause. Now both errors are surfaced.
Lock step debug statements
Added
logger.debug()calls in the lock step for template fetching, retentionpolicy modifications, changeset creation, and changeset validation. These appear
in the log file (or terminal in
--debugmode) and help trace exactly whichstack/resource was being processed when a failure occurs.
Spinner UX cleanup
→prefix from planning/validation success/failure messages✔/✘bullets in debug mode instead of generic•[INFO]/[DEBUG]/[WARN]labels in debug mode for grep-abilitypush()output in debug mode (the hierarchical context is noisywithout the spinner visual)
Issue #, if available
N/A
Description of how you validated changes
tsc --noEmit)--debugmodesChecklist
yarn testpassesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.