• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

xapi-project / xen-api / 18132744895
80%

Build:
DEFAULT BRANCH: master
Ran 30 Sep 2025 02:09PM UTC
Jobs 1
Files 34
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

30 Sep 2025 01:59PM UTC coverage: 80.368%. Remained the same
18132744895

push

github

web-flow
`idl/gen_client`: Don't specify argument values when they're equal to defaults (#6693)

https://github.com/xapi-project/xen-api/pull/6652 added a new parameter
to `Host.disable`. Since the method is used during an RPU, when a new
client calls an older server unaware of the parameter, this broke it.
Add a test reproducing what happens during an RPU and fix the issue in
`client.ml`.

---

Adds an older `server.ml` and `client.ml` from xapi 25.30.0 (with
`server.ml`
modified to compile after the XSA-474 interface changes), before
`Host.disable`
gained the `auto_enable` parameter.

Adds compatibility tests verifying that an older client can talk to a
newer
server and the other way around.

Before the fix, both `test_compatibility_with_old_server_*` fail,
showing that
`auto_enable` in `Host.disable` is an unexpected parameter. This failure
is
triggered on RPUs, when a newer xapi talks to an older one:

[exception] Server_error(MESSAGE_PARAMETER_COUNT_MISMATCH, [
host.disable; 1; 2 ])

So allow `client.ml` to skip specifying an arbitrary number of rightmost
arguments if they're all equal to their default values (since arguments
are
positional, once an argument is not skipped, no arguments to its left
can be
skipped).

Generated code for `host.disable` looks like the following:

```
let session_id = rpc_of_ref_session session_id in
let host = rpc_of_ref_host host in
let auto_enable = rpc_of_bool auto_enable in

let needed_args, _ = List.fold_right2
 (fun param default (acc, skipped)->
   (* Since arguments are positional, we can only skip specifying an
      argument that's equal to its default value if all the arguments to
      its right were also not specified *)
   if skipped then
     (match default with
     | Some default_value when param = default_value -> (acc, true)
     | _ -> (param::acc, false))
   else
     (param :: acc, false)
 ) [ session_id; host; auto_enable ] [ None; None; Some (Rpc.Bool true) ] ([], true)
in

rpc_wrapper rpc "host.disabl... (continued)

3496 of 4350 relevant lines covered (80.37%)

0.8 hits per line

Jobs
ID Job ID Ran Files Coverage
1 python3.11 - 18132744895.1 30 Sep 2025 02:09PM UTC 34
80.37
GitHub Action Run
Source Files on build 18132744895
  • Tree
  • List 34
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #18132744895
  • bc0ba4e9 on github
  • Prev Build on gh-readonly-queue/master/pr-6690-0f0775bd8deac3f78cb070c4927e2ab60ae354a7 (#18131727439)
  • Next Build on master (#18150168488)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc