( ctx context.Context, pinned pluginruntime.PinnedEndpoint, protocolRequest pluginruntime.ProtocolRequestContext, task *model.Task, machine *relay.PluginResponsesMachine, deps pluginProtocolBridgeDeps, )
| 829 | } |
| 830 | |
| 831 | func renderTaskPluginProtocolFinalResponse( |
| 832 | ctx context.Context, |
| 833 | pinned pluginruntime.PinnedEndpoint, |
| 834 | protocolRequest pluginruntime.ProtocolRequestContext, |
| 835 | task *model.Task, |
| 836 | machine *relay.PluginResponsesMachine, |
| 837 | deps pluginProtocolBridgeDeps, |
| 838 | ) (map[string]any, time.Duration, error) { |
| 839 | view, err := service.BuildTaskPluginView(task) |
| 840 | if err != nil { |
| 841 | return nil, 0, err |
| 842 | } |
| 843 | viewValue, err := taskPluginProtocolJSONValue(view) |
| 844 | if err != nil { |
| 845 | return nil, 0, err |
| 846 | } |
| 847 | rendererContext, err := taskPluginProtocolRendererContext( |
| 848 | protocolRequest, |
| 849 | pinned, |
| 850 | task, |
| 851 | deps.artifactContentURL, |
| 852 | ) |
| 853 | if err != nil { |
| 854 | return nil, 0, err |
| 855 | } |
| 856 | hookStarted := deps.now() |
| 857 | payload, err := pinned.Plugin.Engine.CallPathWithAdmissionTimeout( |
| 858 | ctx, |
| 859 | deps.admissionTimeout, |
| 860 | "protocols", |
| 861 | []string{pinned.Protocol, "renderFinal"}, |
| 862 | rendererContext, |
| 863 | viewValue, |
| 864 | ) |
| 865 | hookElapsed := deps.now().Sub(hookStarted) |
| 866 | if err != nil { |
| 867 | return nil, hookElapsed, err |
| 868 | } |
| 869 | response, err := machine.FinalResponse(payload, string(task.Status)) |
| 870 | if err != nil { |
| 871 | return nil, hookElapsed, err |
| 872 | } |
| 873 | return response, hookElapsed, nil |
| 874 | } |
| 875 | |
| 876 | func renderTaskPluginProtocolEventsResponse( |
| 877 | ctx context.Context, |
no test coverage detected