-
Notifications
You must be signed in to change notification settings - Fork 83
Use proto file name to infer message type #436
Conversation
3312ac8
to
83546ca
Compare
} | ||
|
||
var reordered []unMarshalFunc | ||
for i, f := range unMarshalFuncs { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This loop basically bubbles up the matched function to the first place.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #436 +/- ##
==========================================
+ Coverage 67.38% 68.12% +0.74%
==========================================
Files 148 148
Lines 6585 5494 -1091
==========================================
- Hits 4437 3743 -694
+ Misses 1858 1460 -398
- Partials 290 291 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
Signed-off-by: Hongxin Liang <[email protected]>
83546ca
to
70346c3
Compare
@@ -92,37 +92,72 @@ var projectColumns = []printer.Column{ | |||
{Header: "Additional Info", JSONPath: "$.Info"}, | |||
} | |||
|
|||
var fnameRegex = regexp.MustCompile(`^.*_(?P<index>[1-3])\.pb$`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: could we add some comments here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in a latter commit.
Signed-off-by: Hongxin Liang <[email protected]>
Thank you for approving. Could you please help merge it when ready? Thanks. |
TL;DR
Use proto file name to infer message type to have more precise unmarshalling.
Type
Are all requirements met?
Complete description
flytekit generated proto file name has a pattern to precisely indicate the message type:
.*_1.pb
is task,.*_2.pb
is workflow and.*_3.pb
is launch plan. We can rely on this pattern to do more precise unmarshalling. Note that we still try other types if the unmarshalling based on the precisely matched type does not work.This PR keeps backward compatibility so if the pattern is not seen, it goes through all possible types and tries one by one.
Tracking Issue
fixes flyteorg/flyte#3042
Follow-up issue
NA