• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

welovemedia / ffmate / 18359182991

08 Oct 2025 10:00PM UTC coverage: 63.08% (+4.1%) from 58.948%
18359182991

push

github

YoSev
fix: add missing task status filter to listing

24 of 31 new or added lines in 5 files covered. (77.42%)

2380 of 3773 relevant lines covered (63.08%)

16.66 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

60.0
/internal/controller/task/validation.go
1
package task
2

3
import (
4
        "github.com/welovemedia/ffmate/v2/internal/validate"
5
        "goyave.dev/goyave/v5"
6
        v "goyave.dev/goyave/v5/validation"
7
)
8

9
func NewTaskRequest(_ *goyave.Request) v.RuleSet {
14✔
10
        return v.RuleSet{
14✔
11
                {Path: v.CurrentElement, Rules: v.List{v.Object()}},
14✔
12
                {Path: "name", Rules: v.List{v.String(), v.Required()}},
14✔
13

14✔
14
                {Path: "command", Rules: v.List{
14✔
15
                        v.String(),
14✔
16
                        v.WithMessage(v.RequiredIf(func(ctx *v.Context) bool {
28✔
17
                                data, ok := ctx.Data.(map[string]any)
14✔
18
                                if !ok {
14✔
19
                                        return false
×
20
                                }
×
21
                                if val, exists := data["preset"]; !exists || val == nil || val == "" {
28✔
22
                                        return true
14✔
23
                                }
14✔
24
                                return false
×
25
                        }), "Either command or preset must be set"),
26
                }},
27

28
                {Path: "preset", Rules: v.List{
29
                        v.String(),
30
                        v.WithMessage(v.RequiredIf(func(ctx *v.Context) bool {
14✔
31
                                data, ok := ctx.Data.(map[string]any)
14✔
32
                                if !ok {
14✔
33
                                        return false
×
34
                                }
×
35
                                if val, exists := data["command"]; !exists || val == nil || val == "" {
14✔
36
                                        return true
×
37
                                }
×
38
                                return false
14✔
39
                        }), "Either command or preset must be set"),
40
                }},
41

42
                {Path: "priority", Rules: v.List{v.Uint()}},
43
                {Path: "retries", Rules: v.List{v.Uint()}},
44

45
                {Path: "inputFile", Rules: v.List{v.String()}},
46
                {Path: "outputFile", Rules: v.List{v.String()}},
47

48
                {Path: "metadata", Rules: v.List{v.Object()}},
49

50
                {Path: "webhooks", Rules: v.List{v.Array()}},
51
                {Path: "webhooks[].url", Rules: v.List{validate.PreserveValue(v.URL()), v.Required()}},
52
                {Path: "webhooks[].event", Rules: v.List{v.String(), v.Required()}},
53

54
                {Path: "preProcessing", Rules: v.List{v.Object()}},
55
                {Path: "preProcessing.scriptPath", Rules: v.List{v.String()}},
56
                {Path: "preProcessing.sidecarPath", Rules: v.List{v.String()}},
57
                {Path: "preProcessing.importSidecar", Rules: v.List{v.Bool()}},
58

59
                {Path: "postProcessing", Rules: v.List{v.Object()}},
60
                {Path: "postProcessing.scriptPath", Rules: v.List{v.String()}},
61
                {Path: "postProcessing.sidecarPath", Rules: v.List{v.String()}},
62
        }
63
}
64

NEW
65
func NewFilterRequest(_ *goyave.Request) v.RuleSet {
×
NEW
66
        return v.RuleSet{
×
NEW
67
                {Path: "status", Rules: v.List{v.String()}},
×
NEW
68
        }
×
NEW
69
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc