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(pipelines): self-mutate always adds analytics #19010

Merged
merged 2 commits into from
Feb 17, 2022
Merged

Conversation

rix0rrr
Copy link
Contributor

@rix0rrr rix0rrr commented Feb 17, 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 #18933.


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

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.
@rix0rrr rix0rrr requested a review from a team February 17, 2022 10:28
@rix0rrr rix0rrr self-assigned this Feb 17, 2022
@gitpod-io
Copy link

gitpod-io bot commented Feb 17, 2022

@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Feb 17, 2022
@mergify
Copy link
Contributor

mergify bot commented Feb 17, 2022

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).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

@mergify mergify bot merged commit bc47b29 into master Feb 17, 2022
@mergify mergify bot deleted the huijbers/analytics branch February 17, 2022 15:26
@mergify
Copy link
Contributor

mergify bot commented Feb 17, 2022

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*
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*
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): versionReporting and --no-version-reporting not respected for support stacks
3 participants