Skip to content

fix(gen2-migration): sandbox deployments fail in migration e2e due to missing dependencies#14741

Merged
sanjanaravikumar-az merged 3 commits intogen2-migrationfrom
epolon/e2e-install-deps
Apr 2, 2026
Merged

fix(gen2-migration): sandbox deployments fail in migration e2e due to missing dependencies#14741
sanjanaravikumar-az merged 3 commits intogen2-migrationfrom
epolon/e2e-install-deps

Conversation

@iliapolo
Copy link
Copy Markdown
Contributor

@iliapolo iliapolo commented Apr 2, 2026

Description of changes

The migration tool no longer installs dependencies automatically during
gen2-migration generate. The e2e system now needs to run npm install
explicitly at each point where dependencies may have changed: after
generate, before ampx sandbox, and after checking out main for
refactor. Because npm install can modify the lock file, every branch
checkout is now preceded by a git add . && git commit to avoid
dirty-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 to
the terminal. amplify push conditionally inherits only when the
logger is in debug mode (via a new Logger.isDebug() helper) since its esepecially noisy.

Remove interface-based DI layer

The interfaces/index.ts barrel defined interfaces (ILogger,
IFileManager, IAppSelector, etc.) that each had exactly one
implementation. Every class now references the concrete type directly.
The InitializeAppOptions interface moved to amplify-initializer.ts
where it belongs, and AWSCredentials/AWSProfileData moved to
aws-profile-manager.ts.

Simplify logger

Removed LogContext type and all context-passing from logger calls.
The logger now tracks the current app name via setAppName() and
includes it in every log line automatically, replacing the manual
{ appName, operation } threading.

Remove unused types

Deleted HostingConfiguration, DependencyConfiguration, and
LogContext from types/index.ts. Removed the hosting and
dependencies fields from AppConfiguration and
CategoryConfiguration. Updated the configuration-loader test
accordingly.

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 --app argument
before doing any expensive Atmosphere allocation work.

Tweak generateTimeBasedE2EAmplifyAppName

appName is now required (was optional). The function uses the first
10 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 pipefail to configure.sh scripts. Added a copy
filter in DirectoryManager.copyDirectory to skip _snapshot and
node_modules directories when copying app sources.

Issue #, if available

N/A

Description of how you validated changes

  • npx tsx src/cli.ts --app project-boards --profile default completes successfully.

Checklist

  • PR description included
  • yarn test passes
  • Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)
  • New AWS SDK calls or CloudFormation actions have been added to relevant test and service IAM policies
  • Pull request labels are added

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

iliapolo added 2 commits April 2, 2026 13:05
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.
@iliapolo iliapolo requested a review from a team as a code owner April 2, 2026 17:19
@sanjanaravikumar-az sanjanaravikumar-az enabled auto-merge (squash) April 2, 2026 17:34
@sanjanaravikumar-az sanjanaravikumar-az merged commit 960b782 into gen2-migration Apr 2, 2026
4 checks passed
@sanjanaravikumar-az sanjanaravikumar-az deleted the epolon/e2e-install-deps branch April 2, 2026 17:35
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