-
Notifications
You must be signed in to change notification settings - Fork 157
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
fix(context): Removing unneeded global context #649
base: master
Are you sure you want to change the base?
Conversation
Hello @dark0dave we would like to find the best way to collaborate together. Can you please explain in more detail what you're trying to do with this PR? Happy to discuss this with you in person and with the rest of the team. |
857643e
to
4fb7e1f
Compare
This pr is to remove the context varrible which was placed in without "collaborating" with me.... |
Standards in this project have been either ignored or just gone unnoticed. |
4fb7e1f
to
1c64418
Compare
I'll state it for brevity again. Do not introduce unneeded global dependancies... These packages are supposed to only lightly depend on one annother. |
This still isn't ready please don't merge, I need to correct the tests. |
3668865
to
816f04d
Compare
@dark0dave please let us know when this is ready to review, thanks! |
816f04d
to
19730a2
Compare
@femrtnz @migueldelucasdoit this pr is now ready, thank you for your patience. In future if we could avoid introducing global context varriables without discussing it that would be great. |
Maintianing this repo is not a race. |
19730a2
to
f0fd886
Compare
The repeated code is required for tests. We can clean that up later. Can I get a review from @migueldelucasdoit @femrtnz. The intent here is as I have said in line with removing global context. In an ideal situtation we do not share a global context. So instead I have introduced cusomizable printer options as I am sure many more printing requests will arise. This leaves room for the future, rather than placing in a global context, which created a tight binding accross the sub packages. I know this is the natural inclination of golang to add a context, but we want to keep these packages seperate. Your welcome to introduce a context for indivual packages, see We try to use the config package to hold configuration for the whole of kubent, so by introducing a context you effectively stored configuration in two places which is not desirable. Futher that change added context everywhere throughout the application limiting refactoring. Main take aways:
Please try to keep this in mind when adding changes. |
Signed-off-by: dark0dave <[email protected]>
f0fd886
to
379e9a8
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.
Hey @dark0dave thanks for detailed explanation. I agree it is a better approach removing the global context.
Whats is your plan to fix the tests? Looking the duplications I can see benefits on having those duplicated there to improve readability. Maybe we could ignore duplications on test files in Sonar? Or create a some helper functions?
Please do not merge this until its ready.