Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): cdk synth too eager with validation in Pipelines #15147

Merged
merged 2 commits into from
Jun 16, 2021

Conversation

rix0rrr
Copy link
Contributor

@rix0rrr rix0rrr commented Jun 16, 2021

In #14613, we introduced validation so that cdk synth would guard
against incomplete context lookups. In the past, stacks with missing
context would have successfully completed synthesis, propagated down
the pipeline and caused confusing error messages during deployment.
The new behavior was to error out early in case there was missing
context.

This broke people who had resorted to resolving context in the pipeline
using multiple synth commands in for-loop: this used to work because
the synths would be incomplete but silently succeed, but with the new
validation the very first cdk synth would start failing and the for
loop would never complete.

This PR adds a --no-validation flag to cdk synth to stop the
additional validation, so the for loop can complete successfully.

The same behavior can be controlled with an environment variable,
by setting CDK_VALIDATION=false.

Fixes #15130.


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

In #14613, we introduced validation so that `cdk synth` would guard
against incomplete context lookups. In the past, stacks with missing
context would have successfully completed synthesis, propagated down
the pipeline and caused confusing error messages during deployment.
The new behavior was to error out early in case there was missing
context.

This broke people who had resorted to resolving context in the pipeline
using multiple `synth` commands in `for`-loop: this used to work because
the `synths` would be incomplete but silently succeed, but with the new
validation the very first `cdk synth` would start failing and the `for`
loop would never complete.

This PR adds a `--no-validation` flag to `cdk synth` to stop the
additional validation, so the `for` loop can complete successfully.

The same behavior can be controlled with an environment variable,
by setting `CDK_VALIDATION=false`.

Fixes #15130.
@rix0rrr rix0rrr requested a review from otaviomacedo June 16, 2021 12:12
@rix0rrr rix0rrr self-assigned this Jun 16, 2021
@gitpod-io
Copy link

gitpod-io bot commented Jun 16, 2021

@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Jun 16, 2021
@rix0rrr rix0rrr enabled auto-merge (squash) June 16, 2021 12:49
@mergify
Copy link
Contributor

mergify bot commented Jun 16, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@rix0rrr rix0rrr merged commit ae98e88 into master Jun 16, 2021
@rix0rrr rix0rrr deleted the huijbers/suppress-validation branch June 16, 2021 15:32
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: 7888bf6
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

matthewsvu pushed a commit to matthewsvu/aws-cdk that referenced this pull request Jun 22, 2021
In aws#14613, we introduced validation so that `cdk synth` would guard
against incomplete context lookups. In the past, stacks with missing
context would have successfully completed synthesis, propagated down
the pipeline and caused confusing error messages during deployment.
The new behavior was to error out early in case there was missing
context.

This broke people who had resorted to resolving context in the pipeline
using multiple `synth` commands in `for`-loop: this used to work because
the `synths` would be incomplete but silently succeed, but with the new
validation the very first `cdk synth` would start failing and the `for`
loop would never complete.

This PR adds a `--no-validation` flag to `cdk synth` to stop the
additional validation, so the `for` loop can complete successfully.

The same behavior can be controlled with an environment variable,
by setting `CDK_VALIDATION=false`.

Fixes aws#15130.
hollanddd pushed a commit to hollanddd/aws-cdk that referenced this pull request Aug 26, 2021
In aws#14613, we introduced validation so that `cdk synth` would guard
against incomplete context lookups. In the past, stacks with missing
context would have successfully completed synthesis, propagated down
the pipeline and caused confusing error messages during deployment.
The new behavior was to error out early in case there was missing
context.

This broke people who had resorted to resolving context in the pipeline
using multiple `synth` commands in `for`-loop: this used to work because
the `synths` would be incomplete but silently succeed, but with the new
validation the very first `cdk synth` would start failing and the `for`
loop would never complete.

This PR adds a `--no-validation` flag to `cdk synth` to stop the
additional validation, so the `for` loop can complete successfully.

The same behavior can be controlled with an environment variable,
by setting `CDK_VALIDATION=false`.

Fixes aws#15130.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pipelines: multiple synths in a 'for' loop with a custom lookup role stopped working in 1.103
3 participants