-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
(core): Questioning the Assets visiting order #30161
Labels
Comments
This was referenced May 13, 2024
Thank you for bringing it to our attention. I am not sure what's the logic behind that but this doesn't seem to be a bug to me. I am leaving this for the core team for more inputs. |
I think this has been fixed by #21341 :D I'm closing it! |
Nice stuff!! |
Comments on closed issues and PRs are hard for our team to see. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the bug
Hi, I've been using Aspects for a while for various purposes, and I've had a specific issue multiple times. My flow is:
Now, because of the visiting order forced in https://github.com/aws/aws-cdk/blob/dd912daf2b91a4a32064341e92863afbd9eeebdd/packages/aws-cdk-lib/core/lib/private/synthesis.ts#L226C5-L226C72, outer aspects are invoked BEFORE the ones in their children nodes.
This means that if I add tags on a stack level, they'll be added before my validation Aspect is invoked, but if I declare them in children constructs, they will be added AFTER my validation Aspect is invoked, causing it to fail.
I'm now wondering whether this visiting order is a strong requirement, or if it can be improved by causing Aspects in children nodes to be visited BEFORE the ones in the parents'.
P.S. I know I can apply tags for specific resource types at the Stack level. This post is about the logic behind the order of the visiting. I'm not trying to solve the issue in the example in another way.
Expected Behavior
Aspects in children nodes are visited before the ones in their parent nodes.
Current Behavior
Aspects in children nodes are visited AFTER the ones in their parent nodes.
Reproduction Steps
Possible Solution
Turn
https://github.com/aws/aws-cdk/blob/dd912daf2b91a4a32064341e92863afbd9eeebdd/packages/aws-cdk-lib/core/lib/private/synthesis.ts#L226C5-L226C72
from
to
Additional Information/Context
No response
CDK CLI Version
2.140.0 (build 46168aa)
Framework Version
No response
Node.js Version
v20.10.0
OS
Windows
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: