-
Notifications
You must be signed in to change notification settings - Fork 138
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
Initial refactor to prepare to move some packages to ocm-common #630
Initial refactor to prepare to move some packages to ocm-common #630
Conversation
Gave this a first pass, and compared to what we have in ROSA CLI, I think this is a good starting point to lift both Thanks for putting this together |
I didn't get a chance today to write any unit tests like I had hoped, so I am removing this from Draft status and will freely allow you to merge this if you want in order to potentially migrate to ocm-common to be used by other repos before I get back from PTO and don't want to keep this all blocked up for no real good reason. |
91f7872
to
2f1b0c6
Compare
… packages to ocm-common
2f1b0c6
to
1ea2e05
Compare
Looking at the connection-builder package here I'm not sure if it's worth writing tests for, since the logic is relatively basic of just setting and getting values. Let me know if you think otherwise and I'll add them, though. With that said, I think this is ready for review whenever y'all get a chance :) |
Overall LGTM - one remaining comment |
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
Some initial refactors in order to prepare to move the
pkg/ocm/connection-builder
(formerlypkg/ocm
) andpkg/config
to ocm-common to be reusable between multiple projects.Key Features
Connection
method frompkg/config
- this just felt completely out of place in the config loader logic and felt like it overloaded the config package and was out of scopecmd/login
function - we explicitly want to override the URL with the same value as the config in the case that the env var is set and the order in which the newpkg/ocm/connection.go
will check for these thingspkg/ocm/connection.go
- this file is intended to set the defaults for all of this CLI while not changing the flow that's already implemented in most of thecmd/*
files.cmd/*
files that were still modifying the config directly - some are new from when we merged the PR but the login command also needed to be changed to work with the new model.I'd very much like to add some unit tests to this, and will be going on PTO for the next few weeks, so I will be horribly unresponsive, but I just wanted to get a sneak preview of this in now so that any feedback could be collected.I didn't get a chance today to write any unit tests like I had hoped, so I am removing this from Draft status and will freely allow you to merge this if you want in order to potentially migrate to ocm-common to be used by other repos before I get back from PTO and don't want to keep this all blocked up for no real good reason.