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

Change Questions D-Bus API to fit new proposal #637

Merged
merged 44 commits into from
Jul 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
9b25a65
Change dbus API to fit new proposal
jreidinger Jun 21, 2023
7e56e5f
change API to use more mixin approach
jreidinger Jun 27, 2023
21c64d6
adapt ruby service to new questions API
jreidinger Jun 28, 2023
f889ae2
adapt UI and fix service
jreidinger Jul 11, 2023
41099ac
Merge remote-tracking branch 'origin/master' into adapt_quesstions_api
jreidinger Jul 11, 2023
a25b96e
fix file name
jreidinger Jul 11, 2023
7101ec9
fix merge errors
jreidinger Jul 11, 2023
c9ec48b
fix type of attempts
jreidinger Jul 11, 2023
cfc68a8
add more logging for easier debugging
jreidinger Jul 12, 2023
c6e63a3
more logging
jreidinger Jul 12, 2023
e907132
more logging
jreidinger Jul 12, 2023
fb7c2ab
fix passing number of attempts
jreidinger Jul 12, 2023
c38139a
more logging to reveal why password is not passed
jreidinger Jul 12, 2023
7f161da
more logging to debug answering
jreidinger Jul 12, 2023
f5cbfea
fix typo
jreidinger Jul 12, 2023
f2a22a8
even more logging
jreidinger Jul 12, 2023
defc0f3
now log also on ruby side
jreidinger Jul 12, 2023
521d726
fix log message
jreidinger Jul 12, 2023
4f8e82d
lets hope for final fix
jreidinger Jul 12, 2023
ede020c
fix rust formatting
jreidinger Jul 13, 2023
a893de2
remove additional logging
jreidinger Jul 13, 2023
e3ebfa8
adapt js tests
jreidinger Jul 13, 2023
ab510b4
remove test for luks as class is now almost empty
jreidinger Jul 13, 2023
65d2733
adapt another ruby test
jreidinger Jul 13, 2023
0a27a51
remove test for question which become dummy data holder
jreidinger Jul 13, 2023
eda57af
move adaptation for new iface
jreidinger Jul 13, 2023
36a7723
more test adaptation and rubocop fixes
jreidinger Jul 13, 2023
74462a0
more test adaptation and rubocop fixes
jreidinger Jul 13, 2023
5a1853b
Merge remote-tracking branch 'origin/master' into adapt_quesstions_api
jreidinger Jul 13, 2023
65d1547
document questions dbus interface
jreidinger Jul 14, 2023
31cd63a
doc/dbus: sort by interface when seeding
mvidner Jul 14, 2023
0438dbf
setup.sh: exit as soon as a step fails
mvidner Jul 14, 2023
594e21e
doc/dbus/bus: adjusted the introspected files after seed.sh/cleanup()
mvidner Jul 14, 2023
f95e44b
doc/dbus/bus: Storage1: adjusted the introspected files after seed.sh…
mvidner Jul 14, 2023
236f25b
Merge branch 'doc-sort-interfaces' into adapt_quesstions_api
mvidner Jul 14, 2023
721c5ee
doc/dbus/bus: update seeded Questions API
mvidner Jul 14, 2023
f6429d7
doc/dbus: Questions1.*.doc.xml now pass make check
mvidner Jul 14, 2023
960024d
improve documentation
jreidinger Jul 17, 2023
071ebd6
fix formatting
jreidinger Jul 17, 2023
cd79884
apply clippy fixes
jreidinger Jul 17, 2023
a0f1765
Fix typos
imobachgs Jul 17, 2023
54705ac
Update changes
jreidinger Jul 17, 2023
c337aac
Apply suggestions from code review
jreidinger Jul 17, 2023
765135d
fix clippy output
jreidinger Jul 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions doc/dbus/bus/cleanup-zbus.xslt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>

<!-- identity transformation -->
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>

<!-- but do sort /node/interface by @name -->
<xsl:template match="/node">
<xsl:copy>
<xsl:apply-templates select="node()|@*">
<xsl:sort select="@name"/>
</xsl:apply-templates>
</xsl:copy>
</xsl:template>

<!-- omit the detailed introspection of _child_ nodes,
just mention them with their @name -->
<xsl:template match="/node/node">
<xsl:copy>
<xsl:apply-templates select="@*"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
29 changes: 13 additions & 16 deletions doc/dbus/bus/org.opensuse.Agama.Locale1.bus.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@

<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<?xml version="1.0" encoding="UTF-8"?>
<node>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping">
</method>
<method name="GetMachineId">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface_name" type="s" direction="in"/>
Expand Down Expand Up @@ -48,17 +58,4 @@
<property name="Timezone" type="s" access="readwrite"/>
<property name="VConsoleKeyboard" type="s" access="readwrite"/>
</interface>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping">
</method>
<method name="GetMachineId">
<arg type="s" direction="out"/>
</method>
</interface>
</node>

31 changes: 15 additions & 16 deletions doc/dbus/bus/org.opensuse.Agama.Questions1.Generic.bus.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@

<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<?xml version="1.0" encoding="UTF-8"?>
<node>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping">
</method>
<method name="GetMachineId">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface_name" type="s" direction="in"/>
Expand All @@ -26,24 +36,13 @@
<arg name="invalidated_properties" type="as"/>
</signal>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping">
</method>
<method name="GetMachineId">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.opensuse.Agama.Questions1.Generic">
<property name="Answer" type="s" access="readwrite"/>
<property name="Class" type="s" access="read"/>
<property name="Data" type="a{ss}" access="read"/>
<property name="DefaultOption" type="s" access="read"/>
<property name="Id" type="u" access="read"/>
<property name="Options" type="as" access="read"/>
<property name="Text" type="s" access="read"/>
</interface>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" direction="out"/>
</method>
</interface>
</node>

Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<?xml version="1.0" encoding="UTF-8"?>
<node>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
Expand All @@ -14,13 +12,6 @@
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.opensuse.Agama.Questions1.Generic">
<property name="Answer" type="s" access="readwrite"/>
<property name="DefaultOption" type="s" access="read"/>
<property name="Id" type="u" access="read"/>
<property name="Options" type="as" access="read"/>
<property name="Text" type="s" access="read"/>
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface_name" type="s" direction="in"/>
Expand All @@ -45,9 +36,16 @@
<arg name="invalidated_properties" type="as"/>
</signal>
</interface>
<interface name="org.opensuse.Agama.Questions1.LuksActivation">
<property name="Attempt" type="y" access="read"/>
<interface name="org.opensuse.Agama.Questions1.Generic">
<property name="Answer" type="s" access="readwrite"/>
<property name="Class" type="s" access="read"/>
<property name="Data" type="a{ss}" access="read"/>
<property name="DefaultOption" type="s" access="read"/>
<property name="Id" type="u" access="read"/>
<property name="Options" type="as" access="read"/>
<property name="Text" type="s" access="read"/>
</interface>
<interface name="org.opensuse.Agama.Questions1.WithPassword">
<property name="Password" type="s" access="readwrite"/>
</interface>
</node>

81 changes: 43 additions & 38 deletions doc/dbus/bus/org.opensuse.Agama.Questions1.bus.xml
Original file line number Diff line number Diff line change
@@ -1,41 +1,10 @@

<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<?xml version="1.0" encoding="UTF-8"?>
<node>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping">
</method>
<method name="GetMachineId">
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.opensuse.Agama.Questions1">
<!--
creates new generic question without answer
-->
<method name="New">
<arg name="text" type="s" direction="in"/>
<arg name="options" type="as" direction="in"/>
<arg name="default_option" type="as" direction="in"/>
<arg type="o" direction="out"/>
</method>
<!--
creates new specialized luks activation question without answer and password
-->
<method name="NewLuksActivation">
<arg name="device" type="s" direction="in"/>
<arg name="label" type="s" direction="in"/>
<arg name="size" type="s" direction="in"/>
<arg name="attempt" type="y" direction="in"/>
<arg type="o" direction="out"/>
</method>
<!--
Removes question at given object path
-->
<method name="Delete">
<arg name="question" type="o" direction="in"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.ObjectManager">
<method name="GetManagedObjects">
<arg type="a{oa{sa{sv}}}" direction="out"/>
Expand All @@ -58,6 +27,13 @@
<arg name="interfaces" type="as"/>
</signal>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping">
</method>
<method name="GetMachineId">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface_name" type="s" direction="in"/>
Expand All @@ -82,10 +58,39 @@
<arg name="invalidated_properties" type="as"/>
</signal>
</interface>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" direction="out"/>
<interface name="org.opensuse.Agama.Questions1">
<!--
creates new generic question without answer
-->
<method name="New">
<arg name="class" type="s" direction="in"/>
<arg name="text" type="s" direction="in"/>
<arg name="options" type="as" direction="in"/>
<arg name="default_option" type="s" direction="in"/>
<arg name="data" type="a{ss}" direction="in"/>
<arg type="o" direction="out"/>
</method>
<!--
creates new specialized luks activation question without answer and password
-->
<method name="NewWithPassword">
<arg name="class" type="s" direction="in"/>
<arg name="text" type="s" direction="in"/>
<arg name="options" type="as" direction="in"/>
<arg name="default_option" type="s" direction="in"/>
<arg name="data" type="a{ss}" direction="in"/>
<arg type="o" direction="out"/>
</method>
<!--
Removes question at given object path
-->
<method name="Delete">
<arg name="question" type="o" direction="in"/>
</method>
<!--
sets questions to be answered by default answer instead of asking user
-->
<method name="UseDefaultAnswer">
</method>
</interface>
</node>

13 changes: 6 additions & 7 deletions doc/dbus/bus/org.opensuse.Agama.Software1.Proposal.bus.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<?xml version="1.0" encoding="UTF-8"?>
<node name="/org/opensuse/Agama/Software1/Proposal">
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg name="xml_data" direction="out" type="s"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface_name" direction="in" type="s"/>
Expand All @@ -22,11 +26,6 @@
<arg name="invalidated_properties" type="as"/>
</signal>
</interface>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg name="xml_data" direction="out" type="s"/>
</method>
</interface>
<interface name="org.opensuse.Agama.Software1.Proposal">
<method name="AddResolvables">
<arg name="Id" direction="in" type="s"/>
Expand Down
41 changes: 20 additions & 21 deletions doc/dbus/bus/org.opensuse.Agama.Software1.bus.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<?xml version="1.0" encoding="UTF-8"?>
<node name="/org/opensuse/Agama/Software1">
<node name="Proposal" />
<node name="Proposal"/>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg name="xml_data" direction="out" type="s"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface_name" direction="in" type="s"/>
Expand All @@ -23,24 +27,6 @@
<arg name="invalidated_properties" type="as"/>
</signal>
</interface>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg name="xml_data" direction="out" type="s"/>
</method>
</interface>
<interface name="org.opensuse.Agama1.Progress">
<property type="u" name="TotalSteps" access="read"/>
<property type="(us)" name="CurrentStep" access="read"/>
<property type="b" name="Finished" access="read"/>
</interface>
<interface name="org.opensuse.Agama1.ServiceStatus">
<property type="aa{sv}" name="All" access="read"/>
<property type="u" name="Current" access="read"/>
</interface>
<interface name="org.opensuse.Agama1.Validation">
<property type="as" name="Errors" access="read"/>
<property type="b" name="Valid" access="read"/>
</interface>
<interface name="org.opensuse.Agama.Software1">
<method name="SelectProduct">
<arg name="ProductID" direction="in" type="s"/>
Expand Down Expand Up @@ -71,4 +57,17 @@
<property type="a(ssa{sv})" name="AvailableBaseProducts" access="read"/>
<property type="s" name="SelectedBaseProduct" access="read"/>
</interface>
<interface name="org.opensuse.Agama1.Progress">
<property type="u" name="TotalSteps" access="read"/>
<property type="(us)" name="CurrentStep" access="read"/>
<property type="b" name="Finished" access="read"/>
</interface>
<interface name="org.opensuse.Agama1.ServiceStatus">
<property type="aa{sv}" name="All" access="read"/>
<property type="u" name="Current" access="read"/>
</interface>
<interface name="org.opensuse.Agama1.Validation">
<property type="as" name="Errors" access="read"/>
<property type="b" name="Valid" access="read"/>
</interface>
</node>
Loading
Loading