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
add output for running policy packs #14493
Conversation
Changelog[uncommitted] (2023-11-15)Features
|
I don't think we want to show the policy packs in the table/tree of resources because a policy pack isn't a resource. It doesn't feel quite right having it nested under the stack resource, since it isn't a child resource of the stack, which is what this tree view is meant to show. Maybe we keep it really simple for now, and simply emit a If there's a good reason not to do that... here are some other ideas/considerations: Should we show something for this above the table or perhaps below it? And maybe not even break it out into each individual policy pack, but instead have a single line that doesn't display by default, but does become visible if collectively the policy packs are taking longer than N seconds to load. For example "Loading policy packs..." becomes visible if policy packs collectively is taking longer than a few seconds (bonus points for animating the dots and pluralizing "pack" vs "packs" depending on the count). This is sort of similar in some ways to how we display progress bars for downloading/installing required missing plugins at the start of the One thing we don't currently do is show any loading indicators when loading other types of plugins like resource plugins (i.e. providers, e.g. aws, azure-native, gcp, kubernetes, etc.). Those are generally relatively fast to load, so there hasn't been a need to do that. It is interesting that we're saying policy packs are different enough to warrant displaying some kind of loading indicator. I suppose this is because it's much more likely for policy packs to have slower startup times, as they're typically written in TS or Python, aren't precompiled, can be using our giant SDKs like azure-native (which themselves have perf issues which lead to slow compile/startup types) and likely aren't optimized for startup time. I suppose with MLCs and convenience APIs for writing resource plugins in other languages, it's possible this could become more of a problem for resource plugins. Should we consider designing this with an eye for how we'd show a similar indicator for any other type of plugin that's taking longer than N seconds to load? Whatever we do, I'm hoping we won't spend much time on it. If there's something quick we can do here that's just for policy packs, that's preferable. |
+1 |
30791dd
to
99ca3a2
Compare
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.
Looks good to me
Description
🚧
This is a work in progress attempting to add some output for when policy packs are being loaded/compiled (which I realized was the actual reason for the slowdown, not that they were being run already). There's still some pretty obvious code quality issues as I've been throwing this together, and the URN's are not constructed properly yet either, so some of the output is less helpful than it could be. I'm mainly opening this to get some early feedback on whether this is the appropriate place to add the output, or if there are better alternatives.
Also including a gif here of what this looks like. In particular the Name here needs to be improved, and the "Plan" might want to say "loading/compiling" or something similar instead?
Fixes #14453
Checklist
make tidy
to update any new dependenciesmake lint
to verify my code passes the lint checkgofumpt
make changelog
and committed thechangelog/pending/<file>
documenting my change