fix(gen2-migration): sandbox deployments fail in migration e2e due to missing dependencies#14741
Merged
sanjanaravikumar-az merged 3 commits intogen2-migrationfrom Apr 2, 2026
Merged
Conversation
Remove interfaces/ barrel and LogContext type, replacing interface-based dependency injection with direct class references. Simplify logging by dropping context objects and using stdio: 'inherit' for subprocess output instead of manual stdout/stderr parsing. Remove unused types (HostingConfiguration, DependencyConfiguration). Move app selection/validation earlier in the CLI flow. Add set -euxo pipefail to configure scripts, git commit guards before branch checkouts, and a copy filter to skip _snapshot/node_modules directories. Make appName required in generateTimeBasedE2EAmplifyAppName and use prefix-based naming. --- Prompt: commit what I did
…ss debug Only inherit stdio for amplify push when the logger is in debug mode. Otherwise pipe stdout/stderr to keep non-verbose runs quieter. Adds Logger.isDebug() helper. --- Prompt: I made another code change, commit and update the pr file.
sanjanaravikumar-az
approved these changes
Apr 2, 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.
Description of changes
The migration tool no longer installs dependencies automatically during
gen2-migration generate. The e2e system now needs to runnpm installexplicitly at each point where dependencies may have changed: after
generate, beforeampx sandbox, and after checking outmainforrefactor. Because
npm installcan modify the lock file, every branchcheckout is now preceded by a
git add . && git committo avoiddirty-tree errors.
Other changes
Subprocess output: use
stdio: 'inherit'Subprocess calls (test scripts,
ampx sandbox,configure.sh,gen2-migration steps) were capturing stdout/stderr and selectively
re-logging interesting lines. This hid useful output during failures.
These calls now use
stdio: 'inherit'so output streams directly tothe terminal.
amplify pushconditionally inherits only when thelogger is in debug mode (via a new
Logger.isDebug()helper) since its esepecially noisy.Remove interface-based DI layer
The
interfaces/index.tsbarrel defined interfaces (ILogger,IFileManager,IAppSelector, etc.) that each had exactly oneimplementation. Every class now references the concrete type directly.
The
InitializeAppOptionsinterface moved toamplify-initializer.tswhere it belongs, and
AWSCredentials/AWSProfileDatamoved toaws-profile-manager.ts.Simplify logger
Removed
LogContexttype and all context-passing from logger calls.The logger now tracks the current app name via
setAppName()andincludes it in every log line automatically, replacing the manual
{ appName, operation }threading.Remove unused types
Deleted
HostingConfiguration,DependencyConfiguration, andLogContextfromtypes/index.ts. Removed thehostinganddependenciesfields fromAppConfigurationandCategoryConfiguration. Updated the configuration-loader testaccordingly.
Move app validation earlier in CLI flow
App selection and validation now happens before environment detection
and credential resolution. This fails fast on a bad
--appargumentbefore doing any expensive Atmosphere allocation work.
Tweak
generateTimeBasedE2EAmplifyAppNameappNameis now required (was optional). The function uses the first10 characters as a prefix (was last 8) and drops seconds from the
timestamp to stay within the 20-char limit.
Shell script hardening and copy filter
Added
set -euxo pipefailtoconfigure.shscripts. Added a copyfilter in
DirectoryManager.copyDirectoryto skip_snapshotandnode_modulesdirectories when copying app sources.Issue #, if available
N/A
Description of how you validated changes
npx tsx src/cli.ts --app project-boards --profile defaultcompletes successfully.Checklist
yarn testpassesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.