applyWorkflowRunFilters applies filters to the WorkflowRun query based on the provided options
(baseQuery *ent.WorkflowQuery, opts *biz.WorkflowListOpts)
| 320 | |
| 321 | // applyWorkflowRunFilters applies filters to the WorkflowRun query based on the provided options |
| 322 | func applyWorkflowRunFilters(baseQuery *ent.WorkflowQuery, opts *biz.WorkflowListOpts) *ent.WorkflowQuery { |
| 323 | if opts == nil || opts.WorkflowRunRunnerType == "" && opts.WorkflowRunLastStatus == "" { |
| 324 | return baseQuery |
| 325 | } |
| 326 | |
| 327 | query := baseQuery.QueryLatestWorkflowRun() |
| 328 | |
| 329 | if opts.WorkflowRunRunnerType != "" { |
| 330 | query = query.Where( |
| 331 | workflowrun.RunnerType(opts.WorkflowRunRunnerType), |
| 332 | ) |
| 333 | } |
| 334 | |
| 335 | if opts.WorkflowRunLastStatus != "" { |
| 336 | query = query.Where( |
| 337 | workflowrun.StateEQ(opts.WorkflowRunLastStatus), |
| 338 | ) |
| 339 | } |
| 340 | |
| 341 | return query.QueryWorkflow() |
| 342 | } |
| 343 | |
| 344 | // applyWorkflowFilters applies filters to the Workflow query based on the provided options |
| 345 | func applyWorkflowFilters(wfQuery *ent.WorkflowQuery, opts *biz.WorkflowListOpts) (*ent.WorkflowQuery, error) { |
no test coverage detected