-
Notifications
You must be signed in to change notification settings - Fork 16
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
[v2] [refactor] Update meadow firmware download command to use Meadow Cloud #447
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stevenkuhn
commented
Feb 6, 2024
stevenkuhn
commented
Feb 6, 2024
stevenkuhn
commented
Feb 6, 2024
stevenkuhn
commented
Feb 6, 2024
stevenkuhn
commented
Feb 6, 2024
# Conflicts: # Source/v2/Meadow.Cli/Program.cs
# Conflicts: # Source/v2/Meadow.SoftwareManager/Meadow.SoftwareManager.csproj
stevenkuhn
commented
Feb 8, 2024
adrianstevens
approved these changes
Feb 8, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This updates the v2 version of
meadow firmware download
to retrieve the Meadow firmware from Meadow.Cloud. From the user's perspective the only change is that it will require a user to have a Meadow.Cloud account and for that user to login withmeadow cloud login
. The only additional command-line option is the--host
argument:Example
An example of this command would be:
An example if the user is not logged in:
Meadow.Cloud.Client Refactoring
Details
This introduces a new
IMeadowCloudClient
interface that provides the starting point when working with operations that involve Meadow.Cloud. The current properties and methods on this interface look like below.Each individual client on
IMeadowCloudClient
represents a operations that are specific to that client. For this pull request, the only client implemented isIFirmwareClient
which is described below:The implementation for these clients abstracts out the specific details of the underlying
HttpClient
calls providing a cleaner approach for users ofIMeadowCloudClient
. For example, getting a specific firmware version from Meadow.Cloud inF7FirmwareDownloadManager.GetReleaseMetadata()
is now this:And the usage of the client in
FirmwareDownloadCommand
is reduced to:Instantiation and Usage
The creation of
IMeadowCloudClient
in the CLI is done through the DI container. Without a DI container, it would look something like this (not putting inCancellationToken
for brevity):