integ-runner: update workflow fails when deploying an existing snapshot

Đang mở
#2,150 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@gibkim đang làm issue này rồi.

Từ ngày 14/11/2026.

  • #2151 của @gibkim — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
32/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
aws, node.js, typescript
Lĩnh vực
cli, testing

Hướng nghiên cứu

Start in packages/@aws-cdk/integ-runner at the CdkTestApp class exported from lib/runner: follow getContext('deployment') and the configureLegacyEnableLookups/_legacyEnableLookups guard to see why deployment context demands snapshot-synthesis state. Reproduce with the inline Node script from the issue (fixture test/test-data/xxxxx.test-with-snapshot.js) to confirm the throw happens before the mocked deploy. Done means deployment context resolves without prior synthesis, the snapshot path still enforces the guard, and regression tests cover both. Note a scoped fix and tests are already proposed in PR #2151, so coordinate before starting.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Describe the bug

The integration-test update workflow fails before deploying an existing golden snapshot with Must call configureLegacyEnableLookups before synthing.

runIntegTestCase({ updateWorkflow: true }) creates the previous app with CdkTestApp.forGoldenSnapshot(), loads its suite, then calls previousVersion.deploy(). That instance has not synthesized, so _legacyEnableLookups is unset. deploy() requests deployment context, but getContext() requires the snapshot-synthesis setting even for deployment.

Regression Issue

Not confirmed against an earlier released version. Reproduced on current main f970341e439efc4ba6c40515b975b011b4e9eab3.

Expected Behavior

With the update workflow enabled and an existing golden snapshot, deploy the previous snapshot and then update it. Obtaining deployment context should not require a prior snapshot synthesis.

Current Behavior

CdkTestApp.getContext('deployment') throws before the mock CDK deployment is reached:

Error: Must call configureLegacyEnableLookups before synthing

The full runner also fails when the snapshot exists at the merge-base and Git checkout succeeds without warnings.

Reproduction Steps

Build the repository normally, then run the following from packages/@aws-cdk/integ-runner. It uses the existing repository fixture and a mock CDK provider; no AWS credentials or service calls are needed. This isolates the same factory/load/deploy sequence as the update workflow.

node <<'NODE'
const { CdkTestApp, IntegTest } = require(process.cwd() + '/lib/runner');

(async () => {
  const app = await CdkTestApp.forGoldenSnapshot({
    test: new IntegTest({
      fileName: 'test/test-data/xxxxx.test-with-snapshot.js',
      discoveryRoot: 'test/test-data',
    }),
    region: 'eu-west-1',
    cdk: {
      deploy: async () => {
        console.log('mock deploy reached');
        return { deleteFailures: [] };
      },
    },
  });
  const suite = await app.loadExistingSuite();
  if (!suite) throw new Error('Expected the repository fixture to exist');
  await app.deploy({ stacks: ['test-stack'] });
})().catch(error => {
  console.error(error.stack);
  process.exitCode = 1;
});
NODE

For the full runner, both RunOptions.updateWorkflow and the manifest test case's stackUpdateWorkflow must be true.

Possible Solution

Keep the initialization requirement for snapshot synthesis, while allowing deployment context to be obtained without that snapshot-only state. I am preparing a scoped fix and regression tests.

Additional Information/Context

This differs from #1443 / #2149: the existing snapshot is present here, so skipping a missing baseline does not address the failure.

CDK CLI Version

Source checkout at f970341e439efc4ba6c40515b975b011b4e9eab3 (development version 0.0.0).

Framework Version

No deployed app; repository test fixture.

Node.js Version

v22.23.2

OS

macOS arm64

Language

TypeScript

Other information

AI tools assisted debugging and drafting. Verification was local with mocked CDK calls; an AWS deployment was not performed.

Ngôn ngữ chính
TypeScript
Star
110
Fork
138
Merge trung bình
1 ngày 9 giờ
Pull request đã merge (30 ngày)
55

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của aws/aws-cdk-cli

Tất cả issue của aws/aws-cdk-cli

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.