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

オープン
#2,150 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@gibkim がすでに取り組んでいます。

2026年11月14日 から。

  • #2151 @gibkim による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
32/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
aws, node.js, typescript
領域
cli, testing

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
TypeScript
スター
110
フォーク
138
平均マージ
1日 9時間
マージ済み PR(30日)
56

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

aws/aws-cdk-cli のほかの issue

aws/aws-cdk-cli の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。