|
| 1 | +# See: https://getbootstrap.com/docs/5.3/customize/color/#all-colors |
| 2 | + |
| 3 | +label: |
| 4 | + - name: lang/go |
| 5 | + color: "$indigo" |
| 6 | + script: merge_request.modified_files("*.go") |
| 7 | + |
| 8 | + - name: lang/markdown |
| 9 | + color: "$indigo" |
| 10 | + description: "Modified MarkDown files" |
| 11 | + script: merge_request.modified_files("*.md") |
| 12 | + |
| 13 | + - name: dependencies/go |
| 14 | + color: "$orange" |
| 15 | + description: "Updated Go dependency files like go.mod and go.sum" |
| 16 | + script: merge_request.modified_files("go.mod", "go.sum") |
| 17 | + |
| 18 | + - name: type/ci |
| 19 | + color: "$green" |
| 20 | + description: "Modified CI files" |
| 21 | + script: merge_request.modified_files(".gitlab-ci.yml") || merge_request.modified_files("build/") |
| 22 | + |
| 23 | + - name: type/deployment |
| 24 | + color: "$green" |
| 25 | + description: "Modified Deployment files" |
| 26 | + script: merge_request.modified_files("_infrastructure/", "scripts/", "configs/") |
| 27 | + |
| 28 | + - name: type/documentation |
| 29 | + color: "$green" |
| 30 | + description: "Modified Documentation files" |
| 31 | + script: merge_request.modified_files("docs/") |
| 32 | + |
| 33 | + - name: type/services |
| 34 | + color: "$green" |
| 35 | + description: "Modified pkg/services files" |
| 36 | + script: merge_request.modified_files("internal/pkg/services") |
| 37 | + |
| 38 | + - name: go::tests::missing |
| 39 | + color: "$red" |
| 40 | + description: "The Merge Request did NOT modify Go test files" |
| 41 | + priority: 999 |
| 42 | + script: not merge_request.modified_files("*_test.go") |
| 43 | + |
| 44 | + - name: go::tests::OK |
| 45 | + color: "$green" |
| 46 | + description: "The Merge Request modified Go test files" |
| 47 | + priority: 999 |
| 48 | + script: merge_request.modified_files("*_test.go") |
| 49 | + |
| 50 | + - name: status::age::abandoned |
| 51 | + color: "$red" |
| 52 | + description: "The most recent commit is older than 45 days" |
| 53 | + priority: 999 |
| 54 | + script: merge_request.time_since_last_commit > duration("45d") |
| 55 | + skip_if: merge_request.state in ["merged", "closed", "locked"] |
| 56 | + |
| 57 | + - name: status::age::stale |
| 58 | + color: "$red" |
| 59 | + description: "The most recent commit is older than 30 days" |
| 60 | + priority: 999 |
| 61 | + script: duration("30d") < merge_request.time_since_last_commit < duration("45d") |
| 62 | + skip_if: merge_request.state in ["merged", "closed", "locked"] |
| 63 | + |
| 64 | + - name: status::age::old |
| 65 | + color: "$red" |
| 66 | + description: "The most recent commit is older than 14 days" |
| 67 | + priority: 999 |
| 68 | + script: duration("14d") < merge_request.time_since_last_commit < duration("30d") |
| 69 | + skip_if: merge_request.state in ["merged", "closed", "locked"] |
| 70 | + |
| 71 | + # generate labels for services |
| 72 | + # |
| 73 | + # internal/service/vault/client.go |
| 74 | + # => |
| 75 | + # service/vault |
| 76 | + - strategy: generate |
| 77 | + description: "Modified this letsgo service directory" |
| 78 | + color: "$pink" |
| 79 | + script: > |
| 80 | + map(merge_request.diff_stats, { .path }) |
| 81 | + | filter({ hasPrefix(#, "internal/service/") }) |
| 82 | + | map({ filepath_dir(#) }) |
| 83 | + | map({ trimPrefix(#, "internal/") }) |
| 84 | + | uniq() |
| 85 | +
|
| 86 | + # generate labels for commands |
| 87 | + # |
| 88 | + # internal/app/letsgo/subcommands/aws/login/login.go |
| 89 | + # => |
| 90 | + # command/aws/login |
| 91 | + - strategy: generate |
| 92 | + description: "Modified this letsgo command" |
| 93 | + color: "$purple" |
| 94 | + script: > |
| 95 | + map(merge_request.diff_stats, { .path }) |
| 96 | + | filter({ hasPrefix(#, "internal/app/letsgo/subcommands/") }) |
| 97 | + | map({ filepath_dir(#) }) |
| 98 | + | map({ trimPrefix(#, "internal/app/letsgo/subcommands/") }) |
| 99 | + | map({ string("command/" + #) }) |
| 100 | + | uniq() |
0 commit comments