github-workflows-kt icon indicating copy to clipboard operation
github-workflows-kt copied to clipboard

feat(abg)!: allow to wire typed outputs to matching typed inputs

Open Vampire opened this issue 1 year ago • 6 comments

Fixes #73

If types of input and output match, you can do

lookupOnlyExpression = cache.outputs.cacheHit

If types do not match for whatever reason, you can still do

lookupOnlyExpression = cache.outputs.cacheHit_Untyped

or

lookupOnlyExpression = Expression(cache.outputs.cacheHit.expression)

or (but deprecated)

lookupOnly_Untyped = cache.outputs.cacheHit.expressionString

If no type is declared for the output, you can still stuff the _Untyped one into any expression input like

lookupOnlyExpression = cache.outputs.cacheHit_Untyped

Ad-hoc outputs behave like untyped outputs in that you can stuff it into everywhere

lookupOnlyExpression = cache.outputs["cache-hit"]

Vampire avatar Aug 23 '24 16:08 Vampire

[!WARNING] This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite. Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Vampire avatar Aug 23 '24 16:08 Vampire

So far it indeed seems to work just great. I played a bit with the current state, merged with my other stack.

Vampire avatar Aug 23 '24 20:08 Vampire

Main remaining problem is probably the naming at https://github.com/typesafegithub/github-workflows-kt/pull/1624/files#diff-76c4a08acf57b6c491c34cc60e6ad7bbc219fbd45dc0dda74550941ecac51200 :-/

Vampire avatar Aug 23 '24 20:08 Vampire

Of course the typing catalog should be polished to have proper output types which it currently does not have. That's anyway a bit bad, as the typing catalog is supposed to be independent of consumers, so just using string everywhere just because this lib does not yet read it, ..., well, ... ;-)

Vampire avatar Aug 23 '24 20:08 Vampire

Forgot the job outputs, now they are also typed :-)

Vampire avatar Aug 25 '24 02:08 Vampire

And now AbstractResult also has a toExpression() function :-)

Vampire avatar Aug 31 '24 18:08 Vampire