-
Notifications
You must be signed in to change notification settings - Fork 36
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
bmclib version 2 #280
bmclib version 2 #280
Conversation
This version is where are features and fixes are to be implemented going ahead. The only difference as of now with the previous bmclib release is that the Device object type returned by the Inventory() methods are of the github.com/bmc-toolbox/common.Device type.
Codecov Report
@@ Coverage Diff @@
## master #280 +/- ##
===========================================
+ Coverage 23.88% 42.37% +18.49%
===========================================
Files 70 26 -44
Lines 11457 2329 -9128
===========================================
- Hits 2736 987 -1749
+ Misses 8126 1221 -6905
+ Partials 595 121 -474
Continue to review full report at Codecov.
|
Hey @joelrebel , curious if there are some specific challenges with the current code structure this is seeking to solve? I don't believe versioning changes with this new code structure, right? |
Hey @jacobweinstock, thanks for taking a look, theres a few reasons for the suggested The thought process behind the
At the moment, theres one breaking change to the newer client Apart from the this, a. I'd like bmclib to have one client interface that clients can use (instead of two) b. The older interface methods get pretty much zero new hardware support and have limited maintenance being done. Its hardware compatibility with older interface methods is questionable, from what I see, a lot of the older interface methods do not work with newer Dells and Supermicros, and so I'd like to get rid of code that is not in use. d. I'd like to also add support for newer hardware without wading through all the cruft of the older unmaintained codebase and working around conflicts in the method and variable names - which shows up when I'm adding new hardware support for the newer client. c. In The choice of bmclib should have been tagged a |
This is great! Thanks for sharing this reasoning. What makes you say a v2 branch is preferred over a v2 directory? From this post, I believe the v2 directory is preferred, no? |
Based on what I understood from https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher The other reason was that a |
FWIW, I advocate branches over sub-directories as I've found it much easier to maintain over a sub-directory with respect to how Go modules work and git workflows like cherry-picking fixes. |
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.
I only made it about 1/3 of the way so far but now I'm off for a while so might as well add what I've got.
v2/bmc/firmware.go
Outdated
} | ||
|
||
// FirmwareInstallStatusFromInterfaces pass through to library function | ||
func FirmwareInstallStatusFromInterfaces(ctx context.Context, installVersion, component, taskID string, generic []interface{}) (status string, metadata Metadata, err error) { |
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.
Why take genereic []interface{}
instead of []FirmwareInstallVerified
?
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.
The method is invoked with GetDriverInterfaces
which returns various interfaces that may or may not implement the FirmwareInstallVerfier
interface.
v2/bmc/inventory.go
Outdated
|
||
"github.com/hashicorp/go-multierror" | ||
"github.com/pkg/errors" | ||
|
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.
remove the empty line?
v2/bmc/power.go
Outdated
// "reset": soft down and then power on. simulates a reboot from the host OS. | ||
// "cycle": hard power down followed by a power on. simulates pressing a power button |
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.
it would be nice to specify what happens if the machine is already powered off when these come in
…olbox/common package
Thanks for all the comments and suggestions here, they have been incorporated into the latest set of commits. Since all of this code is currently functional and running in production, I'm going to leave the remaining suggestions as is, with issues added for some. I'll now close this PR since the base branch is |
This version is where all features and fixes for the newer client interface methods are to be implemented going ahead.
Clients are to import this version as
github.com/bmc-toolbox/bmclib/v2
.I'm looking for suggestions on if this should be a separate
v2
branch instead of a directory.The older interface methods will continue to be maintained as is.
The only difference as of now with the previous bmclib release
is that the Device object type returned by the
Inventory()
methods areof the
github.com/bmc-toolbox/common.Device
type.