8000 send headers for InspectBundle and add support for a system-version HTTP header by jluebbe · Pull Request #1654 · rauc/rauc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 10 commits into from
Apr 3, 2025

Conversation

jluebbe
Copy link
Member
@jluebbe jluebbe commented Mar 5, 2025

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 the system-info handler (since #1621).

@jluebbe jluebbe added the enhancement Adds new functionality or enhanced handling to RAUC label Mar 5, 2025
@jluebbe jluebbe added this to the Release v1.14 milestone Mar 5, 2025
@jluebbe jluebbe requested a review from ejoerns March 5, 2025 14:54
Copy link
codecov bot commented Mar 5, 2025

Codecov Report

Attention: Patch coverage is 83.60656% with 10 lines in your changes missing coverage. Please review.

Project coverage is 84.47%. Comparing base (1dd326a) to head (3ee6b89).
Report is 54 commits behind head on master.

Files with missing lines Patch % Lines
src/bundle.c 81.13% 10 Missing ⚠️
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     
Flag Coverage Δ
service=false 80.93% <80.32%> (+0.15%) ⬆️
service=true 84.42% <83.60%> (+0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jluebbe jluebbe mentioned this pull request Mar 21, 2025
3 tasks
Copy link
Member
@ejoerns ejoerns left a 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);
Copy link
Member

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).

Copy link
Member Author
@jluebbe jluebbe Mar 31, 2025

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.

Copy link
Member

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.

@ejoerns ejoerns assigned jluebbe and unassigned ejoerns Mar 29, 2025
@jluebbe jluebbe force-pushed the system-version-header branch from 62df397 to e20c430 Compare March 31, 2025 17:02
@jluebbe jluebbe assigned ejoerns and unassigned jluebbe Mar 31, 2025
@@ -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);
Copy link
Member

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.

@jluebbe jluebbe force-pushed the system-version-header branch from e20c430 to c3958de Compare April 1, 2025 16:59
jluebbe added 10 commits April 1, 2025 19:33
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>
@jluebbe jluebbe assigned jluebbe and unassigned ejoerns Apr 1, 2025
@jluebbe jluebbe force-pushed the system-version-header branch from c3958de to 3ee6b89 Compare April 1, 2025 17:50
@jluebbe jluebbe requested a review from ejoerns April 1, 2025 18:20
@jluebbe jluebbe modified the milestones: Release v1.14, Release v1.15 Apr 1, 2025
@ejoerns ejoerns merged commit 893b7e4 into rauc:master Apr 3, 2025
28 of 29 checks passed
@jluebbe jluebbe deleted the system-version-header branch April 4, 2025 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adds new functionality or enhanced handling to RAUC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0