-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Improved management of context caching #19797
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
Labels
@aws-cdk/core
Related to core CDK functionality
@aws-cdk/custom-resources
Related to AWS CDK Custom Resources
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
p2
Comments
Interesting ideas, will keep them in mind, thanks. In the mean time, the |
4 tasks
mergify bot
pushed a commit
that referenced
this issue
Apr 11, 2022
Implementation of one of the solutions I proposed in #19797 using glob-style expressions to match keys. Uses minimatch which already existed as a dependency to match stack names in the synth and deploy commands. Makes the --reset command throw on no-ops i.e when trying to reset context defined in cdk.json or ~/.cdk.json Adds tests and prints messages to clarify previously undocumented behavior. ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
otaviomacedo
pushed a commit
that referenced
this issue
Apr 11, 2022
Implementation of one of the solutions I proposed in #19797 using glob-style expressions to match keys. Uses minimatch which already existed as a dependency to match stack names in the synth and deploy commands. Makes the --reset command throw on no-ops i.e when trying to reset context defined in cdk.json or ~/.cdk.json Adds tests and prints messages to clarify previously undocumented behavior. ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
StevePotter
pushed a commit
to StevePotter/aws-cdk
that referenced
this issue
Apr 27, 2022
Implementation of one of the solutions I proposed in aws#19797 using glob-style expressions to match keys. Uses minimatch which already existed as a dependency to match stack names in the synth and deploy commands. Makes the --reset command throw on no-ops i.e when trying to reset context defined in cdk.json or ~/.cdk.json Adds tests and prints messages to clarify previously undocumented behavior. ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
Bump. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
@aws-cdk/core
Related to core CDK functionality
@aws-cdk/custom-resources
Related to AWS CDK Custom Resources
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
p2
Describe the feature
Users need better tooling for managing context caching behaviors and for maintaining
cdk.context.json
cached values.Use Case
Users regularly open issues regarding stale values being returned by ContextProvider-enabled features (e.g.
Parameter.valueFromLookup
). As AWS itself recommends commitingcdk.context.json
to source control to ensure reproducible builds, additional tooling should support maintaining it as well as control caching behaviors of lookups in general.Proposed Solution
cdk context --reset <key or number>
cli command. Allow wildcard key matching and environment-based filtering so unused values can be removed without impacting determinism of the synthesis.If plugin-registered context-providers do eventually leave alpha, consider calling a staleness check with the cached values on context providers to support more complex cache-busting behaviors.
Other Information
No response
Acknowledgements
CDK version used
2.19.0
Environment details (OS name and version, etc.)
Windows 11 (WSL2 Ubuntu 20.04)
The text was updated successfully, but these errors were encountered: