-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
Prevent data sources from being aplied early #10670
Conversation
If a data source has explicit dependencies in `depends_on`, we can assume the user has added those because of a dependency not tracked directly in the config. If there are any entries in `depends_on`, don't apply the data source early during Refresh.
Having the This doesn't feel 100% right but I'm honestly having some trouble deciding if the problems I'm thinking about are truly issues or just hypotheticals. Curious as to what you think:
The main reason this feels a little "off", I guess, is that were we to have a managed resource depending on another managed resource we would still refresh both of them during With all of that said (mainly just thinking aloud; sorry!) it seems like what you did here should be fine but might be too conservative? But maybe we just start here and work backwards to being less conservative as real use-cases emerge... |
Thanks @apparentlymart! I see where you're going, and I think those are valid points in a world where we want to resolve all data resources as early as possible. However, I think when a field is added to I guess this does sort of turn the data resource back into a managed resource that is "applied", but I don't think there's a way around that if we don't know why the |
I think this hammer is probably okay for now, but I can think of some heuristics we can introduce in the future to make this better. Namely: we can add helpers around DependsOn to give us rich type information around WHAT is being depended (whether it exists or not not our problem since that'll crop up in validation). Then, we can do this behavior only if we depend on a managed resource. Yeah? Regardless, I think this issue makes something work that didn't work before and doesn't break anything that was already working [probably, or maybe in a very specific edge case above]. So, it is probably worthwhile. |
Yeah, if we could introspect into the |
FWIW, fine by me to push ahead with this for now and await real-world use-cases for making it more clever. As I say, I was mainly just thinking aloud trying to figure out why this felt "weird". |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
If a data source has explicit dependencies in
depends_on
, we canassume the user has added those because of a dependency not tracked
directly in the config. If there are any entries in
depends_on
, don'tapply the data source early during Refresh.
Fixes #10603