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
-
!2094 —
slapconfiguration: unwrap shared instances when serialisation is json-in-xml(cookbook fix). - New cookbook sdist
slapos.cookbook-1.0.478.dev3.tar.gzpublished at https://softinst281703.host.vifib.net/public/.
Commits
-
4b4603f2drapid-cdn: support json-in-xml-encoded slave parameters -
7e9082ae0stack/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 fromcustom-personal-slaveanddefault-slave. The file is bit-for-bit identical to the pre-Łukas state, sobuildout.hash.cfgMD5 (4024c9884f45c3f1572cb40434effca5) is unchanged. -
software/rapid-cdn/test/test.py: newTestSlaveJsonInXmlSerialisationclass — submits a slave whosepartition_parameter_kwis wrapped as{'_': json.dumps({'url': cls.backend_url})}(the json-in-xml convention) and asserts viaassertSlaveBase+ mastertest_master_partition_statethat the slave is accepted (accepted-slave-amount: '1',rejected-slave-dict: {}). -
stack/slapos.cfg: TEMP commit — pinslapos.cookbook = 1.0.478.dev3and add find-links for the public host serving the dev sdist.
Out of scope
- Migrating
software/rapid-cdn/software_slave_only.cfg.jsontojson-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 releasedslapos.cookbookversion.