Skip to content

Commit

Permalink
Merge a2b9324 into a27ded1
Browse files Browse the repository at this point in the history
  • Loading branch information
mvidner committed Jun 15, 2023
2 parents a27ded1 + a2b9324 commit 8bf0c21
Show file tree
Hide file tree
Showing 19 changed files with 295 additions and 147 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,19 @@ jobs:
# disable unused repositories to have faster refresh
run: zypper modifyrepo -d repo-non-oss repo-openh264 repo-update && ( zypper ref || zypper ref || zypper ref )

- name: Install Ruby development files
run: zypper --non-interactive install gcc gcc-c++ make openssl-devel ruby-devel npm augeas-devel
- name: Install Ruby development files and XML tooling
run: zypper --non-interactive install gcc gcc-c++ make openssl-devel ruby-devel npm augeas-devel xmlstarlet

- name: Install RubyGems dependencies
run: bundle config set --local with 'development' && bundle install

- name: Generate doc
run: bundle exec yardoc --fail-on-warning

- name: Check that introspected API and its docs have not diverged
run: make -C ../doc check


integration-tests:
timeout-minutes: 60
runs-on: ubuntu-latest
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ jobs:
sudo apt-get update
sudo apt-get --assume-yes --no-install-recommends install xmlto docbook-xsl xmlstarlet
- name: Check that introspected API and its docs have not diverged
run: make -C doc check

- name: Build HTML via DocBook
run: make -C doc

Expand Down
2 changes: 1 addition & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ all:
cp index.html dist

check:
$(MAKE) -C dbus diff
$(MAKE) -C dbus check
3 changes: 2 additions & 1 deletion doc/dbus/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ SHELL=/bin/bash

# check that the implementation and documentation haven't diverged
# TODO: factor out a script to decouple Make syntax from the rest
diff: ${tmpdir}
diff: check
check: ${tmpdir}
ALL_GOOD=true; \
for doc_xml in org.opensuse.Agama*.doc.xml; do \
IFACE=$${doc_xml%.doc.xml}; \
Expand Down
23 changes: 22 additions & 1 deletion doc/dbus/bus/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,22 @@
FIXME: describe how to maintain these (semi)automatically
The `*.bus.xml` files here are produced by introspecting actual objects
exported by the Agama services.

The files are produced by `seed.sh`.
- FIXME: run it in CI.
- FIXME: make it easy to run it *and* commit the result to git.

Each file name represents a D-Bus **interface** that we want to document.
That is why some files have symlinks pointing to them (and why you see no
`org.freedesktop.DBus.*` filenames, we don't need to document those interfaces)

The interfaces implemented in Rust already have documentation in them
(courtesy of Rust macro magic) but it is not in the exact format that
`gdbus-codegen` understands :sob:.

You are expected to copy a new `foo.bus.xml` to `../foo.doc.xml`, remove the
`<interface>` elements other than `foo`, and add meaningful documentation.
Run `make check`.

FIXME: Storage1.ZFCP and Storage1.DASD needs an s390 machine to run,
we should expose them on x86 too (returning errors), perhaps guarded by an
`AGAMA_IGNORE_ARCH` flag?
37 changes: 34 additions & 3 deletions doc/dbus/bus/org.opensuse.Agama.Locale1.bus.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,29 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" direction="out"/>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg type="v" direction="out"/>
</method>
<method name="Set">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg name="value" type="v" direction="in"/>
</method>
<method name="GetAll">
<arg name="interface_name" type="s" direction="in"/>
<arg type="a{sv}" direction="out"/>
</method>
<!--
Emits the `org.freedesktop.DBus.Properties.PropertiesChanged` signal.
-->
<signal name="PropertiesChanged">
<arg name="interface_name" type="s"/>
<arg name="changed_properties" type="a{sv}"/>
<arg name="invalidated_properties" type="as"/>
</signal>
</interface>
<interface name="org.opensuse.Agama.Locale1">
<!--
Expand All @@ -29,5 +48,17 @@
<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>

50 changes: 31 additions & 19 deletions doc/dbus/bus/org.opensuse.Agama.Questions1.Generic.bus.xml
Original file line number Diff line number Diff line change
@@ -1,37 +1,49 @@

<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node name="/org/opensuse/Agama/Questions1/1">
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface_name" direction="in" type="s"/>
<arg name="property_name" direction="in" type="s"/>
<arg name="value" direction="out" type="v"/>
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg type="v" direction="out"/>
</method>
<method name="Set">
<arg name="interface_name" direction="in" type="s"/>
<arg name="property_name" direction="in" type="s"/>
<arg name="val" direction="in" type="v"/>
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg name="value" type="v" direction="in"/>
</method>
<method name="GetAll">
<arg name="interface_name" direction="in" type="s"/>
<arg name="value" direction="out" type="a{sv}"/>
<arg name="interface_name" type="s" direction="in"/>
<arg type="a{sv}" direction="out"/>
</method>
<!--
Emits the `org.freedesktop.DBus.Properties.PropertiesChanged` signal.
-->
<signal name="PropertiesChanged">
<arg name="interface" type="s"/>
<arg name="interface_name" type="s"/>
<arg name="changed_properties" type="a{sv}"/>
<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="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 name="xml_data" direction="out" type="s"/>
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.opensuse.Agama.Questions1">
<property type="u" name="Id" access="read"/>
<property type="s" name="Text" access="read"/>
<property type="as" name="Options" access="read"/>
<property type="s" name="DefaultOption" access="read"/>
<property type="s" name="Answer" access="readwrite"/>
</interface>
</node>

62 changes: 37 additions & 25 deletions doc/dbus/bus/org.opensuse.Agama.Questions1.LuksActivation.bus.xml
Original file line number Diff line number Diff line change
@@ -1,41 +1,53 @@

<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node name="/org/opensuse/Agama/Questions1/2">
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<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.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" direction="in" type="s"/>
<arg name="property_name" direction="in" type="s"/>
<arg name="value" direction="out" type="v"/>
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg type="v" direction="out"/>
</method>
<method name="Set">
<arg name="interface_name" direction="in" type="s"/>
<arg name="property_name" direction="in" type="s"/>
<arg name="val" direction="in" type="v"/>
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg name="value" type="v" direction="in"/>
</method>
<method name="GetAll">
<arg name="interface_name" direction="in" type="s"/>
<arg name="value" direction="out" type="a{sv}"/>
<arg name="interface_name" type="s" direction="in"/>
<arg type="a{sv}" direction="out"/>
</method>
<!--
Emits the `org.freedesktop.DBus.Properties.PropertiesChanged` signal.
-->
<signal name="PropertiesChanged">
<arg name="interface" type="s"/>
<arg name="interface_name" type="s"/>
<arg name="changed_properties" type="a{sv}"/>
<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.Questions1">
<property type="u" name="Id" access="read"/>
<property type="s" name="Text" access="read"/>
<property type="as" name="Options" access="read"/>
<property type="s" name="DefaultOption" access="read"/>
<property type="s" name="Answer" access="readwrite"/>
</interface>
<interface name="org.opensuse.Agama.Questions1.LuksActivation">
<property type="s" name="Password" access="readwrite"/>
<property type="u" name="Attempt" access="read"/>
<property name="Attempt" type="y" access="read"/>
<property name="Password" type="s" access="readwrite"/>
</interface>
</node>

0 comments on commit 8bf0c21

Please sign in to comment.