( ctx context.Context, pinned pluginruntime.PinnedEndpoint, protocolRequest pluginruntime.ProtocolRequestContext, task *model.Task, machine *relay.PluginResponsesMachine, deps pluginProtocolBridgeDeps, )
| 850 | } |
| 851 | |
| 852 | func renderTaskPluginProtocolFinalResponse( |
| 853 | ctx context.Context, |
| 854 | pinned pluginruntime.PinnedEndpoint, |
| 855 | protocolRequest pluginruntime.ProtocolRequestContext, |
| 856 | task *model.Task, |
| 857 | machine *relay.PluginResponsesMachine, |
| 858 | deps pluginProtocolBridgeDeps, |
| 859 | ) (map[string]any, time.Duration, error) { |
| 860 | view, err := service.BuildTaskPluginView(task) |
| 861 | if err != nil { |
| 862 | return nil, 0, err |
| 863 | } |
| 864 | viewValue, err := taskPluginProtocolJSONValue(view) |
| 865 | if err != nil { |
| 866 | return nil, 0, err |
| 867 | } |
| 868 | rendererContext, err := taskPluginProtocolRendererContext( |
| 869 | protocolRequest, |
| 870 | pinned, |
| 871 | task, |
| 872 | deps.artifactContentURL, |
| 873 | ) |
| 874 | if err != nil { |
| 875 | return nil, 0, err |
| 876 | } |
| 877 | hookStarted := deps.now() |
| 878 | payload, err := pinned.Plugin.Engine.CallPathWithAdmissionTimeout( |
| 879 | ctx, |
| 880 | deps.admissionTimeout, |
| 881 | "protocols", |
| 882 | []string{pinned.Protocol, "renderFinal"}, |
| 883 | rendererContext, |
| 884 | viewValue, |
| 885 | ) |
| 886 | hookElapsed := deps.now().Sub(hookStarted) |
| 887 | if err != nil { |
| 888 | return nil, hookElapsed, err |
| 889 | } |
| 890 | response, err := machine.FinalResponse(payload, string(task.Status)) |
| 891 | if err != nil { |
| 892 | return nil, hookElapsed, err |
| 893 | } |
| 894 | return response, hookElapsed, nil |
| 895 | } |
| 896 | |
| 897 | func renderTaskPluginProtocolEventsResponse( |
| 898 | ctx context.Context, |
no test coverage detected