-
Notifications
You must be signed in to change notification settings - Fork 4.3k
feat(core): IEnvironmentAware interface to retrieve a construct's environment
#35817
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
Conversation
Previously, `construct.env` was declared in the `IResource` interface. Downside is that `IResource` also: - requires providing `stack: Stack` (which is a bit pointless to begin with since we can always call `Stack.of(x)`); and - `applyRemovalPolicy()` which doesn't belong on this interface but now is required to implement. Therefore, we extract `IResource#env` out to its own interface, `IEnvironmentable`, make `IXxxRef` extend that interface.
IEnvironmentAware interface to retrieve a construct's environment
IEnvironmentAware interface to retrieve a construct's environmentIEnvironmentAware interface to retrieve a construct's environment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(This review is outdated)
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
IEnvironmentAware interface to retrieve a construct's environmentIEnvironmentAware interface to retrieve a construct's environment
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
This pull request has been removed from the queue for the following reason: The merge conditions cannot be satisfied due to failing checks:You may have to fix your CI before adding the pull request to the queue again. |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Comments on closed issues and PRs are hard for our team to see. |
Previously,
construct.envwas declared in theIResourceinterface.Downside is that
IResourcealso:stack: Stack(which is a bit pointless to begin with since we can always callStack.of(x)); andapplyRemovalPolicy()which doesn't belong on this interface but now is required to implement.Therefore, we extract
IResource#envout to its own interface,IEnvironmentAware; makeIXxxRefextend that interface, simplifyIResourceWithPolicyto only beIEnvironmentAwareand not an entireIResource.Lessening the requirements on
IResourceWithPolicyalso lessens its guarantees, which makes that a breaking change. In order to make this code change, we do the following:IResourceWithPolicyV2to be the version ofIResourceWithPolicywe should have had.IResourceWithPolicyV2everywhereIResourceWithPolicyextendIResourcWithPolicyV2By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license