fix(pipelines): self-mutate always adds analytics#19010
Merged
mergify[bot] merged 2 commits intomasterfrom Feb 17, 2022
Merged
Conversation
When we moved analytics generation from the CLI to the framework, we kept a fallback in the CLI for backwards compatibility: if there were no analytics in the templates but analytics were requested, they would still be added in the CLI. This breaks in the case of CDK Pipelines self-mutate step, if analytics have been disabled: there are no analytics in the template, and the default setting for analytics is `true`, since there is no `cdk.json` to opt out, so they will always be added back in. A better solution to check whether the CLI needs to do the fallback is to go off of the cx schema version number: the CLI can know that it never needs to do anything for cloud assemblies generated starting at a certain version. Fixes #18933.
corymhall
approved these changes
Feb 17, 2022
Contributor
|
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). |
Collaborator
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Contributor
|
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). |
TikiTDO
pushed a commit
to TikiTDO/aws-cdk
that referenced
this pull request
Feb 21, 2022
When we moved analytics generation from the CLI to the framework, we kept a fallback in the CLI for backwards compatibility: if there were no analytics in the templates but analytics were requested, they would still be added in the CLI. This breaks in the case of CDK Pipelines self-mutate step, if analytics have been disabled: there are no analytics in the template, and the default setting for analytics is `true`, since there is no `cdk.json` to opt out, so they will always be added back in. A better solution to check whether the CLI needs to do the fallback is to go off of the cx schema version number: the CLI can know that it never needs to do anything for cloud assemblies generated starting at a certain version. Fixes aws#18933. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 task
mergify bot
pushed a commit
that referenced
this pull request
Jan 7, 2025
… v1 apps (#32710) ### Reason for this change In the first versions of AWS CDK v1 and older, version metadata was injected by the CLI not by the framework. This changed with the introduction of Cloud Assembly Schema v6.0.0 in AWS CDK v1.65.0 (see [changelog](https://github.com/aws/aws-cdk/releases/tag/v1.65.0)). The CLI kept compatibility code around to ensure the metadata is injected. This code was introduced via #19010 on Feb 17, 2022. However this code was intended for v1 and kept around because v1 and v2 were initially developed on the same code base. In the meantime, AWS CDK v1 is EOS and we do not need to support v1 features from v2 anymore. This change will mean that we will stop reporting metadata for users that use the CLI v2 `>= 2.174.0` (the release removing the compat code) to deploy a Cloud Assembly developed with framework v1 `< 1.65.0`. Otherwise these users are not functionally effected by the change. We therefore decide to now remove the unused compat code. ### Description of changes Remove the unused legacy code and adjusted test cases. ### Describe any new or updated permissions being added n/a ### Description of how you validated changes Run unit test and CLI integ tests. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
iankhou
pushed a commit
that referenced
this pull request
Jan 13, 2025
… v1 apps (#32710) ### Reason for this change In the first versions of AWS CDK v1 and older, version metadata was injected by the CLI not by the framework. This changed with the introduction of Cloud Assembly Schema v6.0.0 in AWS CDK v1.65.0 (see [changelog](https://github.com/aws/aws-cdk/releases/tag/v1.65.0)). The CLI kept compatibility code around to ensure the metadata is injected. This code was introduced via #19010 on Feb 17, 2022. However this code was intended for v1 and kept around because v1 and v2 were initially developed on the same code base. In the meantime, AWS CDK v1 is EOS and we do not need to support v1 features from v2 anymore. This change will mean that we will stop reporting metadata for users that use the CLI v2 `>= 2.174.0` (the release removing the compat code) to deploy a Cloud Assembly developed with framework v1 `< 1.65.0`. Otherwise these users are not functionally effected by the change. We therefore decide to now remove the unused compat code. ### Description of changes Remove the unused legacy code and adjusted test cases. ### Describe any new or updated permissions being added n/a ### Description of how you validated changes Run unit test and CLI integ tests. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When we moved analytics generation from the CLI to the framework, we
kept a fallback in the CLI for backwards compatibility: if there were no
analytics in the templates but analytics were requested, they would
still be added in the CLI.
This breaks in the case of CDK Pipelines self-mutate step, if analytics
have been disabled: there are no analytics in the template, and the
default setting for analytics is
true, since there is nocdk.jsonto opt out, so they will always be added back in.
A better solution to check whether the CLI needs to do the fallback
is to go off of the cx schema version number: the CLI can know that
it never needs to do anything for cloud assemblies generated starting
at a certain version.
Fixes #18933.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license