Skip to content

Commit 05767db

Browse files
committed
only run compiler gates if there's a non-doc change in a compiler-defining suite (GR-40652)
1 parent 10bf45a commit 05767db

File tree

4 files changed

+36
-3
lines changed

4 files changed

+36
-3
lines changed

Diff for: common-utils.libsonnet

+14-1
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,18 @@
7373

7474
# generate a string of hyphen-separated items from the given list, skipping null values
7575
hyphenize(a_list)::
76-
std.join("-", std.filterMap(function(el) el != null, function(el) std.toString(el), a_list))
76+
std.join("-", std.filterMap(function(el) el != null, function(el) std.toString(el), a_list)),
77+
78+
# Adds a CI build predicate to `build` if it is a gate such that it is only
79+
# run if a non-documentation file in any of `suites` has been updated.
80+
add_gate_predicate(build, suites, extra_includes=[], extra_excludes=[])::
81+
if std.member(build.targets, "gate") then
82+
build + {
83+
guard+: {
84+
includes+: [ suite + "/**" for suite in suites ] + extra_includes,
85+
excludes+: [ suite + "/docs/**" for suite in suites ] + [ "**.md" ] + extra_excludes
86+
}
87+
}
88+
else
89+
build,
7790
}

Diff for: compiler/ci.jsonnet

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
{
2+
local utils = (import '../common-utils.libsonnet'),
23
local graal = (import 'ci_includes/gate.jsonnet'),
34
local graal_common = (import 'ci_common/gate.jsonnet'),
45
local graal_benchmarks = (import 'ci_common/benchmark-builders.jsonnet'),
56
local baseline_benchmarks = (import 'ci_includes/baseline-benchmarks.jsonnet'),
6-
builds:
7+
8+
builds: [utils.add_gate_predicate(b, ["sdk", "truffle", "compiler"]) for b in
79
graal.builds +
810
graal_common.builds +
911
graal_benchmarks.builds +
1012
baseline_benchmarks.builds
13+
]
1114
}

Diff for: repo-configuration.libsonnet

+15
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,21 @@
2323
suite_dir:: "vm",
2424
mx_env:: {
2525
libgraal:: "libgraal"
26+
},
27+
28+
libgraal_predicate_conf:: {
29+
suites:: [
30+
"sdk",
31+
"truffle",
32+
"compiler",
33+
"substratevm",
34+
"vm"
35+
],
36+
37+
# Updating language imports should not run libgraal gates
38+
extra_excludes:: [
39+
"vm/mx.vm/suite.py"
40+
]
2641
}
2742
},
2843

Diff for: vm/ci_common/libgraal.jsonnet

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ local common_json = composable(import '../../common.json');
66
local devkits = common_json.devkits;
77
local c = import 'common.jsonnet';
88
local g = vm.compiler_gate;
9+
local utils = import '../../common-utils.libsonnet';
910

1011
{
1112
local underscore(s) = std.strReplace(s, "-", "_"),
@@ -107,5 +108,6 @@ local g = vm.compiler_gate;
107108
builds: if
108109
g.check_manifest(gates, all_builds, std.thisFile, "gates").result
109110
then
110-
all_builds
111+
local conf = repo_config.vm.libgraal_predicate_conf;
112+
[utils.add_gate_predicate(b, suites=conf.suites, extra_excludes=conf.extra_excludes) for b in all_builds]
111113
}

0 commit comments

Comments
 (0)