-
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
hawkbit-client: various simplifications #68
Merged
ejoerns
merged 7 commits into
rauc:master
from
Bastian-Krause:bst/hawkbit-client-simplifications
Feb 11, 2021
Merged
hawkbit-client: various simplifications #68
ejoerns
merged 7 commits into
rauc:master
from
Bastian-Krause:bst/hawkbit-client-simplifications
Feb 11, 2021
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
ejoerns
reviewed
Jan 5, 2021
Bastian-Krause
force-pushed
the
bst/hawkbit-client-simplifications
branch
from
January 5, 2021 11:42
55000a3
to
f3ea575
Compare
Rebased on current master. |
Bastian-Krause
force-pushed
the
bst/hawkbit-client-simplifications
branch
from
January 5, 2021 12:35
f3ea575
to
2a1dfd2
Compare
ejoerns
requested changes
Jan 20, 2021
Closed
Bastian-Krause
force-pushed
the
bst/hawkbit-client-simplifications
branch
from
January 27, 2021 13:47
2a1dfd2
to
62f7152
Compare
Force-pushed integration of @ejoerns' feedback:
|
Note: Failed CI testing requires the fix in #74 to be merged. |
When asked about "status.result.progress" and its "of"/"cnt" fields, the hawkBit maintainers answered: Back in the days the client API was designed first and hawkBit implemented the API. The idea of these fields was indeed to be able to report some kind of progress. However fields never made their way into server implementation. So long story short, client can send them as part of the feedback but hawkBit ignore them. https://gitter.im/eclipse/hawkbit?at=5ddce9be55066245981a259e So drop the construction of these JSON members as well as the corresponding progress argument of json_build_status(). Signed-off-by: Bastian Krause <bst@pengutronix.de>
It is not necessary to pass the HTTP code obtained in get_binary() along to calling functions. It is not used for anything other than log messages outside of this function. So better log meaningful error messages in get_binary() directly. Signed-off-by: Bastian Krause <bst@pengutronix.de>
The struct consists of the actual checksum result and the checksum type. As the checksum type is hardcoded to sha1, there is no benefit from passing this along in a struct. For the RAUC usecase we do not rely on a checksum anyway as the bundle signature is checked by RAUC. The only reason to check it that we can determine if the transferred data is corrupt early, prior to triggering the RAUC installation. If the checksum type should be changed in the future, we could either change the hardcoded style or even make it configurable via the config. We do not need get_binary_checksum struct for neither case, so replace it with the calculated checksum string directly. Signed-off-by: Bastian Krause <bst@pengutronix.de>
The md5 checksum is used nowhere. For the RAUC usecase we do not rely on a checksum anyway as the bundle signature is checked by RAUC. The only reason to check it that we can determine if the transferred data is corrupt early, prior to triggering the RAUC installation. Currently the sha1 checksum is used, we can change that in the future (see the previous commit removing the get_binary_checksum struct). Until then we should not carry dead code. Signed-off-by: Bastian Krause <bst@pengutronix.de>
The base part of the URL is always the same. Thus construct the base URL in build_api_url() and pass only relative paths extending the URL to it. This simplifies build_api_url() calls in the whole module. Signed-off-by: Bastian Krause <bst@pengutronix.de>
…nt() It is neither required nor a good idea to get the action ID from an URL. It is also a bad idea to rely on the "c" GET parameter in deployment base links. This is an implementation detail which can change any time in hawkBit. It is not part of the DDI API, rather an artifact from an example in the API's documentation. So simply use the action ID from the deployment JSON response and drop all corresponding regex matching code. Signed-off-by: Bastian Krause <bst@pengutronix.de>
…to download_thread() Instead of calculating the speed ourselves, let's use curl's speed calculation instead. Signed-off-by: Bastian Krause <bst@pengutronix.de>
Bastian-Krause
force-pushed
the
bst/hawkbit-client-simplifications
branch
from
February 2, 2021 16:49
62f7152
to
61c2ba8
Compare
Rebased on current master. |
ejoerns
approved these changes
Feb 2, 2021
Bastian-Krause
added a commit
to Bastian-Krause/rauc-hawkbit-updater
that referenced
this pull request
Mar 30, 2021
Bastian-Krause
added a commit
to Bastian-Krause/rauc-hawkbit-updater
that referenced
this pull request
Mar 30, 2021
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 is a collection of simplifications in the
hawkbit-client
module. Conflicts with the already open PRs should be minimal.Note that this PR blocks the (to be created)
hawkbit-client
refactoring PR.