-
Notifications
You must be signed in to change notification settings - Fork 1
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
Adds Splunk interfaces #50
Conversation
cf026dc
to
461375d
Compare
d863cdc
to
292f7c5
Compare
@aviau I see you approved my draft. I was still working on the refactoring portion of it. Can you have a look now and give me your thoughts before I keep moving forward with the tests? Thanks.
Not done with testing yet. It's mostly there, but opening for review now. |
ad612cd
to
30902a0
Compare
Sure! My first comment would be that this PR is pretty big already. There are multiple refactors at the same time:
I think the simplicify of the previous design was nice. Now, the FlareEventIngestor will be hard to test atomically because it has a lot of dependencies. For example, testing Instead of creating this big class, you could create something like this: def get_storage_password_value(
storage: StoragePasswords,
...
):
... When you attach a method to a class, this makes the method impossible to test without the class. You should question: does it really need to be attached to the class? |
The problem I see with the function above is that every function that we have in this file has to be passed its dependency which is either I dunno what this boils down to. Is this just a matter of personal preference or best practice? I can trash the class and go back. Wanna/have time to pair up on it? |
So you can do this: class BigClass:
def do_something(arg: str) -> None:
# This just re-routes to the detached function, and is more "convenient" to use.
return do_something(dependency=self.dependency, arg=arg)
def do_something(dependency, arg) -> None:
# most of the implementation is here, and it has minimal dependencies
... This way, you can test |
55f89b6
to
7e2c18c
Compare
7e2c18c
to
f89fcab
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.
LGTM
No description provided.