Skip to content

Commit e03a15c

Browse files
committed
ci: verify that all non-gate tiered builds have notify_emails or notify_groups.
1 parent fc0bf2c commit e03a15c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ci/ci_common/ci-check.libsonnet

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1+
local ci = import '../../ci.jsonnet';
12
local std_get = (import 'common-utils.libsonnet').std_get;
23

34
{
5+
local effective_targets(build) = std.map(function(target) if std.startsWith(target, "tier") then ci.tierConfig[target] else target, build.targets),
6+
local periodic_targets = ["daily", "weekly", "monthly", "post-merge", "opt-post-merge"],
7+
local has_periodic_target(build) = std.length(std.setInter(std.set(effective_targets(build)), std.set(periodic_targets))) != 0,
8+
49
# check that all non [gate, ondemand] entries have notify_emails or notify_groups defined
510
local missing_notify(builds) = {
6-
[x.name]: std_get(x, "defined_in") for x in builds if !std.objectHas(x, "notify_emails") && !std.objectHasAll(x, "notify_groups") && std.length(std.setInter(std.set(x.targets), std.set(["daily", "weekly", "monthly", "post-merge", "opt-post-merge"]))) != 0
11+
[x.name]: {defined_in: std_get(x, "defined_in"), targets: std_get(x, "targets")}
12+
for x in builds if !std.objectHas(x, "notify_emails") && !std.objectHasAll(x, "notify_groups") && has_periodic_target(x)
713
},
814

9-
# check that all non entries have defined_in set
15+
# check that all entries have defined_in set
1016
local missing_defined_in(builds) = {
1117
[x.name]: std_get(x, "defined_in") for x in builds if !std.objectHas(x, "defined_in")
1218
},

0 commit comments

Comments
 (0)