Closed buck06191 closed 3 years ago
Looks good +1
This textbook rejection of a PR like this is "putting domain logic like this in a language specific API client is bad".
But this PR has been extensively reviewed by the submitting teams and their motive is deduplication of code which is already in CAPI consumers. This PR does the hard work of getting the different consumers to agree what their domain model should look like. We should encourage this and offer to upstream these new domain model from the client into CAPI.
CAPI should approve this and we can roll forward to get it into the ideal place.
Furthermore.... This will be a versioned release so if the teams submitting this PR can consume it immediately they will be doing the regression testing. Other consumers can stay on or revert back last good release if this causes issues.
We should encourage this and offer to upstream these new domain model from the client into CAPI.
temporary measure prior to relocating into tools and CAPI
Does this mean moving it into the Thrift definitions?
We should encourage this and offer to upstream these new domain model from the client into CAPI.
temporary measure prior to relocating into tools and CAPI
Does this mean moving it into the Thrift definitions?
It should do, yes. I guess we (platforms) all need to have a discussion as to how we do this, then standardise on it and move forwards
What does this change?
Rendering platforms have moved to use the
Format
type to describe the format that rendered data should take. This includes three specific fields:Display
Design
Theme (Pillar/Special)
Currently the platforms handle the decision logic around how to construct this object on platform but ideally this will be done upstream in order to standardise across platforms and to simplify the parsing of data.
Here I upstream the
Format
type to the CAPI Scala client.Changes:
Display
,Theme
andDesign
traits and their associatedcase object
s.CAPIModelEnrichment
to move code shared byRichContent
andFormat
to the upper scope.Format
object.How to test
I've added unit tests for this and they can be run using whatever testing process you prefer e.g.
sbt test
How can we measure success?
Improved DevX for anyone working with the
Format
type, and ideally tidy refactors of the platform code to use this instead of multiple checks and flags.Have we considered potential risks?
I don't think there are any risks. This doesn't affect the raw data and shouldn't remove backwards compatibility.