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

fix(api): compute workflow v3 preview #6346

Merged
merged 1 commit into from
Oct 21, 2022
Merged
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
3 changes: 3 additions & 0 deletions engine/api/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ func (api *API) getWorkflowHandler() service.Handler {
vars := mux.Vars(r)
key := vars["key"]
name := vars["permWorkflowNameAdvanced"]
if name == "" {
name = vars["permWorkflowName"] // Useful for workflowv3 routes
}
withUsage := service.FormBool(r, "withUsage")
withAudits := service.FormBool(r, "withAudits")
withLabels := service.FormBool(r, "withLabels")
Expand Down
4 changes: 4 additions & 0 deletions engine/api/workflow/dao.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ func Load(ctx context.Context, db gorp.SqlExecutor, _ cache.Store, proj sdk.Proj
ctx, end := telemetry.Span(ctx, "workflow.Load")
defer end()

if name == "" {
return nil, sdk.NewErrorFrom(sdk.ErrInvalidData, "invalid given workflow name")
}

dao := opts.GetWorkflowDAO()
dao.Filters.ProjectKey = proj.Key
dao.Filters.WorkflowName = name
Expand Down
3 changes: 3 additions & 0 deletions engine/api/workflow_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@ func (api *API) getWorkflowRunHandler() service.Handler {
vars := mux.Vars(r)
key := vars["key"]
name := vars["permWorkflowNameAdvanced"]
if name == "" {
name = vars["permWorkflowName"] // Useful for workflowv3 routes
}
number, err := requestVarInt(r, "number")
if err != nil {
return err
Expand Down