Skip to content

Add trigger id owner to LiteralsToLaunchFormJsonRequest#7532

Open
katrogan wants to merge 2 commits into
mainfrom
katrina/eng26-691-literalstolaunchformjson-should-accept-trigger-id
Open

Add trigger id owner to LiteralsToLaunchFormJsonRequest#7532
katrogan wants to merge 2 commits into
mainfrom
katrina/eng26-691-literalstolaunchformjson-should-accept-trigger-id

Conversation

@katrogan

Copy link
Copy Markdown
Contributor

Tracking issue

Why are the changes needed?

What changes were proposed in this pull request?

How was this patch tested?

Labels

Please add one or more of the following labels to categorize your PR:

  • added: For new features.
  • changed: For changes in existing functionality.
  • deprecated: For soon-to-be-removed features.
  • removed: For features being removed.
  • fixed: For any bug fixed.
  • security: In case of vulnerabilities

This is important to improve the readability of release notes.

Setup process

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Stack

If you do use git town to manage PR Stacks, the stack relevant to this PR
will show below. Otherwise, you can ignore this section.

Docs link

Signed-off-by: Katrina Rogan <katroganGH@gmail.com>
Copilot AI review requested due to automatic review settings June 16, 2026 16:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the TranslatorService.LiteralsToLaunchFormJson API to support converting launch-form JSON directly from a trigger’s offloaded inputs, by introducing a new owner oneof on LiteralsToLaunchFormJsonRequest and adding dataproxy logic to fetch trigger details and read the referenced inputs from storage.

Changes:

  • Updated LiteralsToLaunchFormJsonRequest to use a oneof owner (either action_id or trigger_id) and regenerated Go bindings/validation.
  • Added dataproxy support for trigger_id by calling TriggerService.GetTriggerRevisionDetails and reading offloaded_input_data.uri from storage.
  • Updated dataproxy setup wiring and added unit tests covering trigger-based translation and missing offloaded data.

Reviewed changes

Copilot reviewed 4 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
gen/go/flyteidl2/workflow/translator_service.pb.validate.go Regenerated validation to handle the new owner oneof and validate embedded identifiers.
gen/go/flyteidl2/workflow/translator_service.pb.go Regenerated Go types/getters for the owner oneof (action_id / trigger_id).
flyteidl2/workflow/translator_service.proto Introduced oneof owner with action_id and trigger_id and clarified literals_uri semantics.
dataproxy/translator.go Added trigger-path logic and storage reads for trigger offloaded inputs.
dataproxy/translator_test.go Added tests for trigger-based translation and missing offloaded input data; updated action-owner construction.
dataproxy/setup.go Wired TriggerServiceClient into TranslatorService construction.
Files not reviewed (2)
  • gen/go/flyteidl2/workflow/translator_service.pb.go: Generated file
  • gen/go/flyteidl2/workflow/translator_service.pb.validate.go: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread dataproxy/translator.go
Comment on lines 44 to +48
literals := req.Msg.GetLiterals()
if req.Msg.GetLiteralsUri() != "" {
switch {
case req.Msg.GetTriggerId() != nil:
var err error
literals, err = s.readTriggerLiterals(ctx, req.Msg.GetTriggerId())
Comment thread dataproxy/translator.go
Comment on lines +103 to +125
func (s *TranslatorService) readTriggerLiterals(
ctx context.Context,
triggerID *common.TriggerIdentifier,
) ([]*task.NamedLiteral, error) {
resp, err := s.triggerClient.GetTriggerRevisionDetails(ctx, connect.NewRequest(&trigger.GetTriggerRevisionDetailsRequest{
Id: triggerID,
}))
if err != nil {
return nil, err
}

uri := resp.Msg.GetTrigger().GetSpec().GetOffloadedInputData().GetUri()
if uri == "" {
return nil, connect.NewError(connect.CodeInvalidArgument,
fmt.Errorf("trigger %s has no offloaded input data", triggerID.GetName().GetName()))
}

var inputs task.Inputs
if err := s.dataStore.ReadProtobuf(ctx, storage.DataReference(uri), &inputs); err != nil {
return nil, connect.NewError(connect.CodeInternal, fmt.Errorf("failed to read trigger literals from %s: %w", uri, err))
}
return inputs.GetLiterals(), nil
}
Signed-off-by: Katrina Rogan <katroganGH@gmail.com>
@pingsutw

Copy link
Copy Markdown
Member

Could we update the PR description

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants