Skip to content
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

[2/3] New firmware interfaces #362

Merged
merged 11 commits into from
Nov 10, 2023

Conversation

joelrebel
Copy link
Member

@joelrebel joelrebel commented Nov 7, 2023

What does this PR implement/change/remove?

Note: to be merged after #363

Defines new firmware interface methods - to enable individual firmware actions instead of a larger abstraction like the current FirmwareInstall, FirmwareInstallStatus - the abstraction in these current methods is getting to large to manage and work across vendors.

FirmwareUpload - Only upload firmware
FirmwareInstallUploaded - Install previously uploaded firmware
FirmwareTaskStatus - Retrieve task state along with status information, to deprecate FirmwareInstallStatus
FirmwareInstallSteps - Returns steps the caller has to follow to install firmware for a device, since each vendor device is a special snowflake.

Checklist

  • Tests added
  • Similar commits squashed

type FirmwareInstaller interface {
// FirmwareInstall uploads firmware update payload to the BMC returning the task ID
//
// parameters:
// component - the component slug for the component update being installed.
// applyAt - one of "Immediate", "OnReset".
// operationsApplyTime - one of the OperationApplyTime constants
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not make that a type instead of constants of string?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that is the intention going ahead in the newer interface, for now we don't want to break the current interface.

}

// firmwareInstallUploaded uploads and initiates firmware update for the component
func firmwareInstallUploaded(ctx context.Context, component, uploadTaskID string, generic []firmwareInstallerWithOptionsProvider) (installTaskID string, metadata Metadata, err error) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general I think named returns are a maintenance hazard.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kinda agree, although I have them there since they are indicative of what the returned string holds.

@joelrebel joelrebel force-pushed the new-firmware-interfaces branch from 4004cbc to 49efe08 Compare November 9, 2023 09:51
@joelrebel
Copy link
Member Author

rebase on parent branch

There has been no real use for having an io.Reader passed in
and this interface is to expect a file instead.
… x11, x12

based on feedback recieved this approach made more sense
[3/3] supermicro firmware install rewrite
Copy link

codecov bot commented Nov 10, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (redfishwrapper-changes@f1c1fa1). Click here to learn what that means.

Additional details and impacted files
@@                    Coverage Diff                    @@
##             redfishwrapper-changes     #362   +/-   ##
=========================================================
  Coverage                          ?   45.02%           
=========================================================
  Files                             ?       60           
  Lines                             ?     5017           
  Branches                          ?        0           
=========================================================
  Hits                              ?     2259           
  Misses                            ?     2501           
  Partials                          ?      257           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@joelrebel joelrebel merged commit d7662f2 into redfishwrapper-changes Nov 10, 2023
5 of 7 checks passed
@joelrebel joelrebel deleted the new-firmware-interfaces branch November 10, 2023 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants