-
Notifications
You must be signed in to change notification settings - Fork 228
send headers for InspectBundle and add support for a system-version HTTP header #1654
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1654 +/- ##
==========================================
+ Coverage 84.31% 84.47% +0.15%
==========================================
Files 76 76
Lines 22135 22199 +64
==========================================
+ Hits 18663 18752 +89
+ Misses 3472 3447 -25
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 thought about the need to mention in the docs that these headers are sent on InspectBundle calls, too, now. But I'm unsure since we obviously did not describe exactly in which cases (installation only) they were sent so far.
@@ -1307,6 +1307,9 @@ static gboolean info_start(int argc, char **argv) | |||
if (no_check_time) | |||
check_bundle_params |= CHECK_BUNDLE_NO_CHECK_TIME; | |||
|
|||
g_assert(access_args.http_info_headers == NULL); | |||
access_args.http_info_headers = assemble_info_headers(NULL); |
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.
What's the scenario this would be useful for? When using the CLI, the context information will not be ready. When using RAUC without the service, this might not be relevant anymore (since e.g. polling will not work).
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.
For rauc install
, r_context_configure_target()
is called even without the service, as it uses R_CONTEXT_CONFIG_MODE_REQUIRED
. For rauc info
(which uses _AUTO
), the target information (mainly the system-info handler) is not loaded unless an explicit config file is given. So we probably only get the uptime.
We could change that by calling r_context_configure_target()
in more cases, but that can be left for later. For now, I've documented it.
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.
Documenting this clearly might be sufficient for now.
62df397
to
e20c430
Compare
@@ -1307,6 +1307,9 @@ static gboolean info_start(int argc, char **argv) | |||
if (no_check_time) | |||
check_bundle_params |= CHECK_BUNDLE_NO_CHECK_TIME; | |||
|
|||
g_assert(access_args.http_info_headers == NULL); | |||
access_args.http_info_headers = assemble_info_headers(NULL); |
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.
Documenting this clearly might be sufficient for now.
e20c430
to
c3958de
Compare
Fixes: 70415f6 ("test: improve http tests") Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Keeping it as a GPtrArray makes it it easy to modify after the initial creation and also avoids the need to keep a trailing NULL pointer. In a follow-up commit, we'll make assemble_info_headers usable for bundle inspection as well. Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
…l args We want to use this function for all streaming bundle accesses, not just installations. Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
The collected info comes mainly from the context and will be used for all streaming bundle accesses. Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Previously, they were sent only during installation. Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
…via D-Bus Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Even if the header is enabled in the config, the value might be missing at runtime. Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Use a System- prefix to distinguish it from RAUC or bundle versions. Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
c3958de
to
3ee6b89
Compare
Previously, they were sent only during installation. By moving the header setup to the bundle access level, we'll also be able to use them when polling.
Also, add support for a
RAUC-System-Version
header which uses the information collected from thesystem-info
handler (since #1621).