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

welovemedia / ffmate / 18359200713

08 Oct 2025 10:01PM UTC coverage: 63.062% (+0.03%) from 63.033%
18359200713

push

github

YoSev
fix: add missing task status filter to listing

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

2397 of 3801 relevant lines covered (63.06%)

16.54 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: "labels", Rules: v.List{v.Array(), v.Max(5)}},
51
                {Path: "labels[]", Rules: v.List{v.String(), v.Min(1), v.Max(32)}},
52

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

57
                {Path: "preProcessing", Rules: v.List{v.Object()}},
58
                {Path: "preProcessing.scriptPath", Rules: v.List{v.String()}},
59
                {Path: "preProcessing.sidecarPath", Rules: v.List{v.String()}},
60
                {Path: "preProcessing.importSidecar", Rules: v.List{v.Bool()}},
61

62
                {Path: "postProcessing", Rules: v.List{v.Object()}},
63
                {Path: "postProcessing.scriptPath", Rules: v.List{v.String()}},
64
                {Path: "postProcessing.sidecarPath", Rules: v.List{v.String()}},
65
        }
66
}
67

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

© 2026 Coveralls, Inc