From 7d25cdb842096d072b1ce27946ebde6fb385f5e3 Mon Sep 17 00:00:00 2001 From: Sheridan C Rawlins Date: Mon, 4 Nov 2024 11:04:33 -0800 Subject: [PATCH] [Fixes 4035] Add the code to the ModuleInvocationContext. --- hooks/hookexecution/execution.go | 1 + hooks/hookstage/invocation.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/hooks/hookexecution/execution.go b/hooks/hookexecution/execution.go index caaba59c3b..e03feaf842 100644 --- a/hooks/hookexecution/execution.go +++ b/hooks/hookexecution/execution.go @@ -71,6 +71,7 @@ func executeGroup[H any, P any]( for _, hook := range group.Hooks { mCtx := executionCtx.getModuleContext(hook.Module) + mCtx.HookImplCode = hook.Code newPayload := handleModuleActivities(hook.Code, executionCtx.activityControl, payload, executionCtx.account) wg.Add(1) go func(hw hooks.HookWrapper[H], moduleCtx hookstage.ModuleInvocationContext) { diff --git a/hooks/hookstage/invocation.go b/hooks/hookstage/invocation.go index 6408e8667d..5d94473c5a 100644 --- a/hooks/hookstage/invocation.go +++ b/hooks/hookstage/invocation.go @@ -27,6 +27,8 @@ type ModuleInvocationContext struct { Endpoint string // ModuleContext holds values that the module passes to itself from the previous stages. ModuleContext ModuleContext + // HookImplCode is the hook_impl_code for a module instance to differentiate between multiple hooks + HookImplCode string } // ModuleContext holds arbitrary data passed between module hooks at different stages.