-
Notifications
You must be signed in to change notification settings - Fork 38
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
[1.0] Refactor config migrations and remove config parameters #272
Conversation
Coverage Report
|
@legrego one of the things im thinking about doing in this PR is to stop using build_full_config and to start using build_data and build_options instead to make it explicit where these are coming from as options are currently duplicated between data and options. This will probably mean I have to touch a lot of tests so I want to check in with you before I do that. |
@strawgate That makes sense to me, I'd be happy for you to do this. Thanks! |
@legrego and maybe drop yaml config? :) |
I'm not prepared to drop yml config just yet 🙂. I believe that's still being used in the wild |
that should be fine though right? doesn't the yml config get imported into data/options on each run? So the only thing that would break would be users adding new key/values to their yml config? |
As I'm getting started on this I'm also realizing that we could probably stop accepting a |
I think the component will fail to start if there is unexpected yml config in the file. That's how it behaved in the past anyway. |
Yes! That's been on my mental todo list for awhile. |
This commit shows my rough plan for removing It looks like In the case of the gateway I've added some static methods to es_gateway to allow testing connections without "mocking" a config object. |
Add a mock for entity state so we don't need to initialize the entire integration to mess with state objects. Also allow all tests to run if there is a failure (Might break CI?)
The general approach LGTM. Is the plan to remove the |
I could go either way on ESPrivilegeCheck. I do think it makes sense for the gateway to have something (generic) where you can pass in a set of permissions and see if the gateway's connection is capable of those permissions. And then just leveraging that functionality when initializing the gateway? The legacy datastreams needed some fancy variable substitution for dynamic privilege checking, the new datastreams method is a static permission set. A static permission set makes the whole class a bit less exciting I think. |
apologies in advance... |
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 looks fantastic, thanks for the refactor! The parameterized tests and snapshots are much easier to reason about as well 👏
Added PR feedback and comments |
Addressed / incorporated all feedback |
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.
LGTM once merge conflict is addressed
!!!! |
Fixes: #271
Fixes: #287
Fixes: #273
Removes
config
, removes reading config values from anything other than init (and maybe async_init), and moves all components to explicitly referencing either data or options. Also removes the configuration that stops all tests from running after the first failure. Also fixes ES setup on Linux