littlehorse-enterprises / littlehorse

This repository contains the code for the LittleHorse Server, Dashboard, CLI, and Java/Go/Python SDK's. Brought to you by LittleHorse Enterprises LLC
https://littlehorse.dev/
Other
118 stars 11 forks source link

Mark Variable as `.internal()` #582

Open coltmcnealy-lh opened 10 months ago

coltmcnealy-lh commented 10 months ago

Context

I recently implemented a major overhaul to WfSpec versioning in which we added the majorVersion and revision fields. A new majorVersion happened when there was a breaking change, defined as a change in the set of searchable() or required() variables.

Description

What if there is a Variable that is not searchable (for performance reasons), and not an input variable, but it is an important part of the Contract of the WfSpec (for example when using WfRun's to store business entitites, this variable might be a useful "column" but not indexed or required)?

I think we should make any changes to the sets of Variables in a WfRun result in a new majorVersion, unless the variable is marked as internal().

All three SDK's should have a WfRunVariable#internal() method

Technical Context

Certain variables are automatically created by the SDK, and should also be marked as internal(). For example:

coltmcnealy-lh commented 9 months ago

@eduwercamacaro agrees; also we should should update our documentation. This should be done before 1.0.0 as it does break our contract a little bit (but not a huge amount)

coltmcnealy-lh commented 9 months ago

Well, it looks like this requires some discussion to get the correct API semantics, but no one wants to do the implementation 😂