hypar-io/BuildingBlocks

Envelope By Sketch has a null profile and new unexpected types.

Closed this issue · 4 comments

Two recent changes to "Envelope By Level" should be discussed as they paint a picture of how Hypar will break in the future when function authors change the interface of their function.

  1. The Envelope schema has a Profile property which has recently started returning null. This breaks all functions which currently use that profile (ex: Facade).
  2. The "Envelope By Sketch" function now generates elements of type Elements.LevelPerimeter. Functions which consume "Levels" don't know anything about this type so they ignore it during deserialization.

Neither of these changes were obvious to consumers of "Levels". The code generator correctly generated updated class files for the updated schemas, and the compiler identified locations where API calls needed to be adjusted. In the first case, nothing in the tooling can identify when a function author decides to stop using a property. This may be an oversight, or an attempt at deprecation, but the consuming function needs to know. In the second case, a new type was introduced into the system but we do not currently track type dependencies so the "Facade" function could not know that the "Envelope by Sketch" function had begun generating a type that it did not understand.

The easiest short term solution is to update the documentation to the "Envelope By Sketch" function to say something like: "This function generates Envelope and LevelPerimeter objects. To get the perimeter of an envelope, use the LevelPerimeter object at the corresponding level." For properties which are deprecated, the property should not be removed and a deprecation message should be included in the property's description.

@anthonyhauck @mattc

"LevelsByEnvelope" generates both Levels and LevelPerimeters.
"EnvelopeBySketch" never generated Levels or LevelPerimeters, and still doesn't.
I didn't make any changes to "EnvelopeBySketch" later than 6 days ago:
image

The issue in Facade seems to be that it makes a Level, and the creation call changed -- since in another context you'd asserted...
image
...I thought you were just reading Levels, not creating them. I should have checked.

Happy to update documentation, but where should that happen?
It can appear in the relevant GitHub repo, but there's no guarantee a repo will be public.

Updated description and repo README.