Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fixes 4035] Add the hook.Code to the ModuleInvocationContext. #4036

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions hooks/hookexecution/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions hooks/hookstage/invocation.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading