713: support offline entities spec v2024.1.0 via opt-in setting #719
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #713
Why is this the best possible solution? Were any other approaches considered?
Implements #713: opt-in via a new entities setting
offline
with a valueyes
. If not opted-in, retain all current behaviour. If opted-in, for the create case, use the new spec version. If opted-in, for the update case, use the new spec version and emit trunkVersion/branchId properties and bindings.Deviations to the requirements:
entity_declaration.py
,EntityDeclaration._get_bind_node()
, which sets the attributereadonly="true()"
, which presumably is correct since this function is used for the existingbaseVersion
property with a similar structure.yes
is accepted, or it's aliases e.g.Yes
,true
, etc.offline
column, or by providing a value other than an alias foryes
(such asno
,bananas
, or anything else). This seemed more consistent with the requirements than raising an error if the column is present but the value is not an alias foryes
, although an error may make sense too.What are the regression risks?
Low risk, should be backwards compatible as per the tests suite.
In future when the new spec version is the default, presumably the
offline
setting will be removed, meaning that from then on forms will have to remove that setting or else get an error about an unexpected column. This would be a minor point of friction but beneficial in that the setting would do nothing (all forms would use spec2024.1.0
) which may be confusing it were kept/allowed.Does this change require updates to documentation? If so, please file an issue here and include the link below.
Updates to the entities spec and ODK docs are already in progress. The new
offline
setting is intended to be kept for only a few months, so I'm not sure if that's worth an update to the XLSForm template, especially if the intended audience during that period is insiders/advanced users. The xlsform.org page doesn't mention entities at all.Before submitting this PR, please make sure you have:
tests
python -m unittest
and verified all tests passruff format pyxform tests
andruff check pyxform tests
to lint code