Skip to content

rapid-cdn: support json-in-xml-encoded slave parameters

Summary

Proper fix for SR-67143 (rapid-cdn rejecting json-in-xml-serialised slaves).

Reverts the per-slave-type serialisation: xml overrides introduced by Łukas in 5b05605833. With this MR, both custom-personal-slave and default-slave inherit the top-level serialisation: json-in-xml, matching the master.

Legacy slaves whose parameters were saved as flat XML before MR !1983 (merged) keep working unchanged: slapos.cookbook:slapconfiguration.jsonschema transparently decodes each slave-instance-list entry (see the dependency below) so the rapid-cdn Jinja2 templates see uniform decoded dicts regardless of the per-slave serialisation.

Depends on

Commits

  1. 4b4603f2d rapid-cdn: support json-in-xml-encoded slave parameters
  2. 7e9082ae0 stack/slapos: pin slapos.cookbook 1.0.478.dev3 + find-links [TO BE REMOVED BEFORE MERGE]

The TEMP commit must be dropped and replaced with a clean pin bump once MR !2094 ships in a proper slapos.cookbook release.

What changes

  • software/rapid-cdn/software.cfg.json: drop the "serialisation": "xml" line from custom-personal-slave and default-slave. The file is bit-for-bit identical to the pre-Łukas state, so buildout.hash.cfg MD5 (4024c9884f45c3f1572cb40434effca5) is unchanged.
  • software/rapid-cdn/test/test.py: new TestSlaveJsonInXmlSerialisation class — submits a slave whose partition_parameter_kw is wrapped as {'_': json.dumps({'url': cls.backend_url})} (the json-in-xml convention) and asserts via assertSlaveBase + master test_master_partition_state that the slave is accepted (accepted-slave-amount: '1', rejected-slave-dict: {}).
  • stack/slapos.cfg: TEMP commit — pin slapos.cookbook = 1.0.478.dev3 and add find-links for the public host serving the dev sdist.

Out of scope

  • Migrating software/rapid-cdn/software_slave_only.cfg.json to json-in-xml.
  • The panel.rapid.space JSON-Schema editor gadget update (gadget_erp5_page_slap_parameter_form.js) to render the typed form for legacy XML-encoded slaves — separate work item.

Test plan

  • CI on cookbook MR !2094 green.
  • CI on rapid-cdn integration suite green, including TestSlaveJsonInXmlSerialisation.
  • Manual end-to-end via panel.rapid.space: request one slave with the typed form (json-in-xml) and one via the raw XML editor (legacy XML), verify both are accepted by the master.
  • Pre-merge: drop TEMP commit 7e9082ae0, replace with a clean pin bump to the released slapos.cookbook version.

🤖 Generated with Claude Code

Edited by Cédric Le Ninivin

Merge request reports