[MAGNOLIA-6664] Inheritance of registry definitions from YAML Created: 12/May/16  Updated: 31/Jan/18  Resolved: 20/Jul/17

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: None
Fix Version/s: 5.5.6, 5.6

Type: Story Priority: Major
Reporter: Christopher Zimmermann Assignee: Aleksandr Pchelintcev
Resolution: Fixed Votes: 3
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to MAGNOLIA-6729 Stale session on accessing JCR resources Closed
relates to MGNLUI-4256 App launcher layout update should be ... Accepted
relates to MAGNOLIA-7065 Inheritance of registry definitions f... Open
relates to MAGNOLIA-7060 Override properties in YAML include Closed
dependency
depends upon MGNLUI-3882 Reference fields by name as well as b... Closed
relation
is related to MAGNOLIA-7115 Parsing of yaml fragment attempts to ... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Release notes required:
Yes
Date of First Response:
Epic Link: LD: Fundamental features
Sprint: Basel 103, Basel 104, Basel 105
Story Points: 2

 Description   

Introduce "inherits" for inheriting a definition from a registry.

  • Ability to override values by supplying them under the !inherits statement. (As proposed in the light-yaml forge module with the "extends-def" keyword.)
  • Supports override keyword to stop the extending.
  • Do not allow inheriting from a sub definition. (ie don't support the ":/form" at the end of !inherits:dialogs:mtk:components/image:/form)
  • Referencing syntax starts with the type name. In the referencing syntax, types do have an s at the end - ie "dialogs".
  • Implement for YAML - (it will also be implemented for JCR and code (think blossom) in other tickets
  • Log error message in case someone puts the typename after the module-name or makes some other anticipated mistake.


 Comments   
Comment by Christopher Zimmermann [ 22/Nov/16 ]

TODO:

Note: ticket is blocked because of above linked ticket.

Comment by Antti Hietala [ 02/Feb/17 ]

Next step:

  • Re-enable the POC
  • Rebase
  • Make sure the POC does what we spec'd in the arch meeting and only that.
    • Be totally in sync with JCR
    • Only extend stuff from the registry.
  • Make sure the bug related to module loading order is resolved.
Comment by Mikaël Geljić [ 17/Mar/17 ]

Hey jsimak, please take a look at MAGNOLIA-6729, it was reported against early usage of light-yaml.
We must make sure concurrent rendering is not an issue with YAML template-defs in JCR resources workspace.

Please reopen if you can reproduce it. Unless you made major changes, there's little chance to escape
We can have a call to elaborate as well, if you need more information.

Comment by Roman Kovařík [ 27/Mar/17 ]

Reopened:

  1. !extends:mtk:components/textAndImage missing dialog registry specification doesn't report an error
  2. !extends:dialog:mtk:components/textAndImage the path is not correctly resolved
Comment by Michael Mühlebach [ 20/Apr/17 ]

Should not be decided just by PM. Please have a consent between PM, Dev and Services.

Comment by Christopher Zimmermann [ 08/Jun/17 ]

Conclusions after meetings with PM & PD:

Continue to support "extends" for JCR without any change.

Introduce "inherits" for inheriting a definition from a registry.

  • Ability to override values by supplying them under the !inherits statement. (As proposed in the light-yaml forge module with the "extends-def" keyword.)
  • Supports override keyword to stop the extending.
  • Do not allow inheriting from a sub definition. (ie don't support the ":/form" at the end of !inherits:dialogs:mtk:components/image:/form)
  • Referencing syntax starts with the type name. In the referencing syntax, types do have an s at the end - ie "dialogs".
  • Implement for JCR, YAML and code (think blossom), but should not be a problem as resolving happens in/by registry
  • Log error message in case someone puts the typename after the module-name or makes some other anticipated mistake.

Related - but to implement in another ticket: MAGNOLIA-7060

Enhance "include" for YAML.

  • Add ability to override values by supplying them under the !include statement. (As proposed in the light-yaml forge module.)
  • Supports override keyword to stop the extending.
  • Introduce the no-space syntax to be valid YAML: !include:/light-yaml-sample/samples/sampleTab.yaml
  • Deprecate (but still support) old include and print warning (if possible) when detected (but override is not supported on old version: !include light-yaml-sample/samples/sampleTab.yaml

We do not introduce any ability to cross "extend" between jcr, yaml, and code sources besides the new "inherits" feature.

Comment by Christopher Zimmermann [ 12/Jun/17 ]

After discussion with Philip, decided to split ticket.
This ticket is now just about implementing "inherits" for YAML.

Implementation for JCR: https://jira.magnolia-cms.com/browse/MAGNOLIA-7065
Implementation for Code: https://jira.magnolia-cms.com/browse/MAGNOLIA-7066

Comment by Christopher Zimmermann [ 12/Jun/17 ]

Unassigning so that the work is not blocked.

Generated at Mon Feb 12 04:16:40 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.