Skip to content

Commit 1ec3310

Browse files
authored
fix(integ-runner): disable update workflow by default (#951)
I've lost 2 hours debugging why my deployment was failing trying to deploy to nonexistent and non-requested accounts and regions, and the answer was: the checked-in snapshot was nonsensical, and the update workflow will first deploy the checked-in snapshot and only then deploy the current snapshot. Good idea, bad execution: if existing snapshots are not region-agnostic they are guaranteed to fail. We should probably resynthesize them from the previous git commit instead. Whatever it is, what we do right now doesn't work so I'm disabling the default. Turn `--disable-update-workflow` into `--[no-]update-workflow`, with the default being `false`. --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
1 parent f1db8df commit 1ec3310

File tree

1 file changed

+13
-6
lines changed
  • packages/@aws-cdk/integ-runner/lib

1 file changed

+13
-6
lines changed

packages/@aws-cdk/integ-runner/lib/cli.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ export function parseCliArgs(args: string[] = []) {
4040
.option('strict', { type: 'boolean', default: false, desc: 'Fail if any specified tests are not found' })
4141
.options('from-file', { type: 'string', desc: 'Read TEST names from a file (one TEST per line)' })
4242
.option('inspect-failures', { type: 'boolean', desc: 'Keep the integ test cloud assembly if a failure occurs for inspection', default: false })
43-
.option('disable-update-workflow', { type: 'boolean', default: false, desc: 'If this is "true" then the stack update workflow will be disabled' })
43+
.option('disable-update-workflow', { type: 'boolean', default: undefined, desc: 'DEPRECATED, use --[no]-update-workflow instead' })
44+
.option('update-workflow', { type: 'boolean', default: undefined, desc: 'Deploys the committed snapshot before the updated application. Only works if snapshots are region-agnostic.' })
4445
.option('language', {
4546
alias: 'l',
4647
default: ['javascript', 'typescript', 'python', 'go'],
@@ -81,6 +82,12 @@ export function parseCliArgs(args: string[] = []) {
8182
? (fs.readFileSync(fromFile, { encoding: 'utf8' })).split('\n').filter(x => x)
8283
: (tests.length > 0 ? tests : undefined); // 'undefined' means no request
8384

85+
if (argv['disable-update-workflow'] !== undefined && argv['update-workflow'] !== undefined) {
86+
throw new Error('--disable-update-workflow and --[no-]update-workflow cannot be used together');
87+
}
88+
89+
let updateWorkflow = argv['update-workflow'] !== undefined ? !!argv['update-workflow'] : !argv['disable-update-workflow'];
90+
8491
return {
8592
tests: requestedTests,
8693
app: argv.app as (string | undefined),
@@ -100,7 +107,7 @@ export function parseCliArgs(args: string[] = []) {
100107
clean: argv.clean as boolean,
101108
force: argv.force as boolean,
102109
dryRun: argv['dry-run'] as boolean,
103-
disableUpdateWorkflow: argv['disable-update-workflow'] as boolean,
110+
updateWorkflow,
104111
language: arrayFromYargs(argv.language),
105112
watch: argv.watch as boolean,
106113
strict: argv.strict as boolean,
@@ -186,7 +193,7 @@ async function run(options: ReturnType<typeof parseCliArgs>, { engine }: EngineO
186193
clean: options.clean,
187194
dryRun: options.dryRun,
188195
verbosity: options.verbosity,
189-
updateWorkflow: !options.disableUpdateWorkflow,
196+
updateWorkflow: options.updateWorkflow,
190197
watch: options.watch,
191198
});
192199
testsSucceeded = success;
@@ -237,7 +244,7 @@ function validateWatchArgs(args: {
237244
maxWorkers: number;
238245
force: boolean;
239246
dryRun: boolean;
240-
disableUpdateWorkflow: boolean;
247+
updateWorkflow: boolean;
241248
runUpdateOnFailed: boolean;
242249
watch: boolean;
243250
}) {
@@ -250,8 +257,8 @@ function validateWatchArgs(args: {
250257
'to `--profiles` `--parallel-regions` `--max-workers');
251258
}
252259

253-
if (args.runUpdateOnFailed || args.disableUpdateWorkflow || args.force || args.dryRun) {
254-
logger.warning('args `--update-on-failed`, `--disable-update-workflow`, `--force`, `--dry-run` have no effect when running with `--watch`');
260+
if (args.runUpdateOnFailed || args.updateWorkflow || args.force || args.dryRun) {
261+
logger.warning('args `--update-on-failed`, `--update-workflow`, `--force`, `--dry-run` have no effect when running with `--watch`');
255262
}
256263
}
257264
}

0 commit comments

Comments
 (0)