Skip to content

Commit

Permalink
fix(api): init plugin list before workflow template check (#7263)
Browse files Browse the repository at this point in the history
  • Loading branch information
sguiheux authored Jan 3, 2025
1 parent 95af431 commit 56655f0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
15 changes: 7 additions & 8 deletions engine/api/v2_workflow_run_craft.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,13 @@ func (api *API) craftWorkflowRunV2(ctx context.Context, id string) error {
}
run.Contexts = *runContext
wref := NewWorkflowRunEntityFinder(*p, *run, *repo, *vcsServer, *u, run.AdminMFA, api.Config.WorkflowV2.LibraryProjectKey)
plugins, err := plugin.LoadAllByType(ctx, api.mustDB(), sdk.GRPCPluginAction)
if err != nil {
return err
}
for _, p := range plugins {
wref.ef.plugins[p.Name] = p
}

// Resolve workflow template if applicable
if run.WorkflowData.Workflow.From != "" {
Expand Down Expand Up @@ -254,14 +261,6 @@ func (api *API) craftWorkflowRunV2(ctx context.Context, id string) error {
wref.run = *run
}

plugins, err := plugin.LoadAllByType(ctx, api.mustDB(), sdk.GRPCPluginAction)
if err != nil {
return err
}
for _, p := range plugins {
wref.ef.plugins[p.Name] = p
}

allVariableSets, err := project.LoadVariableSetsByProject(ctx, api.mustDB(), p.Key)
if err != nil {
return err
Expand Down
1 change: 1 addition & 0 deletions tests/08_v2_workflow_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ testcases:
model: "{{.worker_model}}"
memory: "512"
steps:
- uses: actions/checkout
- run: |-
#!/bin/bash
env
Expand Down

0 comments on commit 56655f0

Please sign in to comment.