You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
5.1.2: generated code for a parent link to a fieldset fails Column validation #279
In 5.1.2, generate-files writes a column that its own Column validation rejects when a schema
has a parent link to a fieldset. Importing the generated entity_schemas package then fails, so diff and revision can't run at all. This appeared in 5.1.2; 5.1.0 generated the same field
without parent_link.
Steps to reproduce
Create a fieldset F and a schema A that implements it.
On schema B, add a link field to fieldset F and mark it as a parent link.
Run liminal generate-files <tenant> -p out, then import out.entity_schemas.
ValueError: Column Parent F: Parent link cannot be set without an entity link.
Cause
mappers.py maps FieldsetLinkFieldDefinition to ENTITY_LINK.
In entity_schemas/utils.py, links_to_entity_schema is false for fieldset links, because BenchlingLinkDefinitionType.FIELDSET isn't in is_entity_schema_type(). So entity_link is None.
Removing parent_link=True from the generated line makes the import work, but diff then reports parent_link drift on that field on every run, so hand-editing isn't a real workaround.
Expected
Generated models always import, and a fieldset parent link round-trips through diff without drift.
Suggested fix
Short term, either allow parent_link without entity_link when the link targets a fieldset, or have
the remote conversion and the generator treat fieldset links consistently (e.g. drop parent_link on
both sides when the target can't be named). Longer term, this is part of fieldset coverage (#30): the
link could carry the fieldset's identifier as its target.
The same path may also apply to a parent link whose target schema the App can't see (it would also
have no entity_link). We haven't confirmed that case.
Activity
(closes dynotx#279) Fix parent_link Fieldset bug (dynotx#282)