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

Add new InstallBundle Method to D-Bus API #446

Merged
merged 12 commits into from
Apr 23, 2020

Conversation

ejoerns
Copy link
Member

@ejoerns ejoerns commented Jun 5, 2019

In the past, there were a lot of cases where we ran into the limitation of the Install method of the D-Bus Installer interface. These were all caused by the missing ability to pass additional arguments to the install call.

As we cannot break existing setups, we cannot simply change the method signature. Instead, we need to introduce an alternative method.

Here it is: InstallBundle sa{sv}

Where the new generic dict of string-variant (a{sv}) allows passing and handling all kind of current and future parameters without changing the interface again.

This initial series includes support for one argument that was already implemented for the non-D-Bus case: --ignore-compatible. It allows forcing the installation of a bundle on a per-installation-call base

Reference: #248

@ejoerns ejoerns added the enhancement Adds new functionality or enhanced handling to RAUC label Jun 5, 2019
@ejoerns ejoerns force-pushed the topic/new-install-api branch 2 times, most recently from ddc325c to 9a2374d Compare June 5, 2019 12:22
@jluebbe jluebbe added this to the Release v1.2 milestone Jun 14, 2019
@jluebbe jluebbe self-assigned this Jun 14, 2019
@jluebbe
Copy link
Member

jluebbe commented Jun 24, 2019

I've pushed a rebase onto master. The the conflicts were caused by the network mode removal.

@codecov
Copy link

codecov bot commented Jun 24, 2019

Codecov Report

Merging #446 into master will increase coverage by 0.20%.
The diff coverage is 70.96%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #446      +/-   ##
==========================================
+ Coverage   66.50%   66.71%   +0.20%     
==========================================
  Files          24       24              
  Lines        6553     6576      +23     
==========================================
+ Hits         4358     4387      +29     
+ Misses       2195     2189       -6     
Impacted Files Coverage Δ
src/main.c 67.96% <0.00%> (-0.19%) ⬇️
src/service.c 76.12% <81.81%> (+1.40%) ⬆️
src/install.c 81.02% <100.00%> (+0.99%) ⬆️
src/bundle.c 65.79% <0.00%> (+0.74%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 00cdb5e...75a087a. Read the comment docs.

@ejoerns ejoerns added the RFC Early preview of new feature for discussion label Aug 27, 2019
@ejoerns ejoerns removed the RFC Early preview of new feature for discussion label Oct 3, 2019
@ejoerns ejoerns changed the title RFC: Add new InstallBundle Method to D-Bus API Add new InstallBundle Method to D-Bus API Oct 3, 2019
@ejoerns
Copy link
Member Author

ejoerns commented Oct 3, 2019

We also have tests for this and it remained in RFC phase for some days. Thus we can remove the RFC label now and make it a normal PR ready for being reviewed and merged.

include/context.h Outdated Show resolved Hide resolved
src/service.c Outdated Show resolved Hide resolved
test/service.c Outdated Show resolved Hide resolved
@ejoerns ejoerns force-pushed the topic/new-install-api branch 3 times, most recently from 96f4407 to bd472f6 Compare February 12, 2020 06:28
src/main.c Outdated Show resolved Hide resolved
Copy link
Member

@jluebbe jluebbe left a comment

Choose a reason for hiding this comment

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

The are still some minor things to check, but otherwise this should be almost ready to go.

src/install.c Outdated Show resolved Hide resolved
@jluebbe jluebbe assigned ejoerns and unassigned jluebbe Apr 21, 2020
@ejoerns ejoerns force-pushed the topic/new-install-api branch 3 times, most recently from a0718fd to b2e55e9 Compare April 23, 2020 07:03
jluebbe and others added 12 commits April 23, 2020 09:26
Otherwise we may run out of space after several tests.

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
This method aims to replace the former 'Install' method used to
trigger bundle installations.

The old method lacked the capability of passing additional
arguments, which prevented from adding a lot of features in the past.

Compared to the existing one, the new method differs only in the
additional array-of-string-variant parameter 'args'.

This allows to pass all kind of future additional simple arguments.

To guarantee API stability, the old method will be kept as an
alternative.

Signed-off-by: Enrico Joerns <ejo@pengutronix.de>
Signed-off-by: Enrico Joerns <ejo@pengutronix.de>
Signed-off-by: Enrico Joerns <ejo@pengutronix.de>
…thod

Signed-off-by: Enrico Joerns <ejo@pengutronix.de>
Signed-off-by: Enrico Joerns <ejo@pengutronix.de>
While the new API method will be tested by the RAUC client
implementation, anyway, we need to have an explicit test ensuring
nothing of the deprecated API is broken accidentally.

Signed-off-by: Enrico Joerns <ejo@pengutronix.de>
Also mark it as failed when needed.

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
We should not accept unknown keys to prevent from performing actions
not actually intended by the client.

Signed-off-by: Enrico Joerns <ejo@pengutronix.de>
On the client side, this will ease identifying what went wrong

Signed-off-by: Enrico Joerns <ejo@pengutronix.de>
We test that unknown arguments are rejected,
we test that invalid keys are rejected,
we test that having both valid key and value is accepted.

Signed-off-by: Enrico Joerns <ejo@pengutronix.de>
Signed-off-by: Enrico Joerns <ejo@pengutronix.de>
@jluebbe jluebbe merged commit 0596c6d into rauc:master Apr 23, 2020
@ejoerns ejoerns deleted the topic/new-install-api branch April 24, 2020 06:21
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.

None yet

3 participants