(cli): cdk flags --set always reports no template differences before applying flags
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- aws, typescript
- Ambito
- cli, infrastructure
Direzione di ricerca
Read packages/aws-cdk/lib/commands/flags/operations.ts, especially FlagOperations.prototypeChanges(), and trace when the app is synthesized and the context store is updated. Reproduce with the TypeScript CDK app and cdk flags --unstable=flags --set --unconfigured --recommended. Done when the preview diff includes the template changes made by the new flag values.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
cdk flags --unstable=flags --set ... (for example --unconfigured --recommended) is supposed to synthesize the app with the current flag values and with the new flag values, show the template diff between the two, and then ask for confirmation.
The diff it shows is always empty (There were no differences / Number of stacks with differences: 0), even for flags that change the template. After accepting, cdk synth shows that the template did change.
Reproduction
Confirmed with CLI 2.1145.0 / aws-cdk-lib 2.272.0.
- Create a project with
cdk init app --language typescript - Remove
@aws-cdk/aws-lambda:useCdkManagedLogGroupfrom thecontextincdk.json, and define onelambda.Functionin the stack - Run
npx cdk flags --unstable=flags --set --unconfigured --recommended
-> the diff says there are no differences - Accept the changes and run
npx cdk synth
-> anAWS::Logs::LogGrouphas been added (it is not in the synth before the change)
Expected behavior
The diff shown before the confirmation prompt includes the template changes caused by the new flag values (here, [+] AWS::Logs::LogGroup).
Root cause
FlagOperations.prototypeChanges() in packages/aws-cdk/lib/commands/flags/operations.ts:
const memoryContext = new MemoryContext(baseContextValues);
...
const source = await this.toolkit.fromCdkApp(app, {
contextStore: memoryContext,
outdir: this.originalTempDir,
});
...
await memoryContext.update(updateObj);
const cx = await this.toolkit.synth(source);
...
const modifiedSource = await this.toolkit.fromCdkApp(app, {
contextStore: memoryContext,
outdir: this.modifiedTempDir,
});
- One
MemoryContextis passed to both the "original" and the "modified"fromCdkApp()sources. fromCdkApp()is lazy: the app is only synthesized, and the context store only read, attoolkit.synth(source).memoryContext.update(updateObj)is called before the firstsynth.
So the "original" assembly is also synthesized with the new flag values, both assemblies are identical, and the diff is always empty.
- Lingua principale
- TypeScript
- Stelle
- 110
- Fork
- 138
- Merge medio
- 1g 9h
- PR unite (30g)
- 56
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di aws/aws-cdk-cli
-
aws-cdk bug needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
aws/aws-cdk-cli#2179 ·
I maintainer di solito rispondono entro 1 giorno
-
(cli): deploy waits forever when an AWS API call gets no response, because requestTimeout only logs a warningForse già presa @abhiramshaji-cyber l’ha presa 27 giorni fa. Apertaaws-cdk bug p2
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
aws/aws-cdk-cli#2097 ·
I maintainer di solito rispondono entro 1 giorno
-
(bootstrap) FilePublishingRoleDefaultPolicy permission incorrect when FileAssetsBucketKmsKeyId is an ARN valueForse già presa @lemon0333 l’ha presa 95 giorni fa. Apertabug p2
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
aws/aws-cdk-cli#921 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
(garbage-collection): cdk gc takes hours on a large bootstrap bucketForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
aws/aws-cdk-cli#2165 ·
I maintainer di solito rispondono entro 1 giorno
-
integ-runner: update workflow fails when deploying an existing snapshotForse già presa @gibkim l’ha presa 11 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 32/100
aws/aws-cdk-cli#2150 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di aws/aws-cdk-cli
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
volcengine/OpenViking#8432 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
jupyterlab/eslint-plugin#178 · 2 commenti ·
-
bug from-app needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
nightly-labs/openbot#16303 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100