Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14864729
D8472.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Subscribers
None
D8472.diff
View Options
diff --git a/contrib/buildbot/server.py b/contrib/buildbot/server.py
--- a/contrib/buildbot/server.py
+++ b/contrib/buildbot/server.py
@@ -268,15 +268,20 @@
# Get a list of the builds that should run on diffs
builds = []
for build_name, v in config.get('builds', {}).items():
- diffRegex = v.get('runOnDiffRegex', None)
- if v.get('runOnDiff', False) or diffRegex is not None:
- if diffRegex:
+ diffRegexes = v.get('runOnDiffRegex', None)
+ if v.get('runOnDiff', False) or diffRegexes is not None:
+ if diffRegexes:
# If the regex matches at least one changed file, add this
# build to the list.
- for changedFile in changedFiles:
- if re.match(diffRegex, changedFile):
- builds.append(build_name)
- break
+ def regexesMatchAnyFile(regexes, files):
+ for regex in regexes:
+ for filename in files:
+ if re.match(regex, filename):
+ return True
+ return False
+
+ if regexesMatchAnyFile(diffRegexes, changedFiles):
+ builds.append(build_name)
else:
builds.append(build_name)
diff --git a/contrib/buildbot/test/test_endpoint_buildDiff.py b/contrib/buildbot/test/test_endpoint_buildDiff.py
--- a/contrib/buildbot/test/test_endpoint_buildDiff.py
+++ b/contrib/buildbot/test/test_endpoint_buildDiff.py
@@ -120,7 +120,7 @@
# With matching file regex
set_build_configuration({
"build-1": {
- "runOnDiffRegex": "dir/subdir/.*",
+ "runOnDiffRegex": ["dir/subdir/.*"],
},
})
call_buildDiff(builds)
@@ -128,7 +128,7 @@
# With non-matching file regex
set_build_configuration({
"build-1": {
- "runOnDiffRegex": "dir/nonmatching/.*",
+ "runOnDiffRegex": ["dir/nonmatching/.*"],
},
})
call_buildDiff([])
@@ -137,10 +137,10 @@
builds.append(Build(1, BuildStatus.Queued, "build-2"))
set_build_configuration({
"build-1": {
- "runOnDiffRegex": "dir/nonmatching/.*",
+ "runOnDiffRegex": ["dir/nonmatching/.*"],
},
"build-2": {
- "runOnDiffRegex": "someotherdir/file2.txt",
+ "runOnDiffRegex": ["someotherdir/file2.txt"],
},
})
call_buildDiff([builds[1]])
diff --git a/contrib/teamcity/build-configurations.yml b/contrib/teamcity/build-configurations.yml
--- a/contrib/teamcity/build-configurations.yml
+++ b/contrib/teamcity/build-configurations.yml
@@ -403,7 +403,8 @@
timeout: 1800
check-buildbot:
- runOnDiffRegex: contrib/buildbot/
+ runOnDiffRegex:
+ - contrib/buildbot/
targets:
- - check-buildbot
timeout: 600
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, May 20, 21:58 (20 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5866011
Default Alt Text
D8472.diff (3 KB)
Attached To
D8472: [buildbot] Support a list of regex when matching builds to changed files
Event Timeline
Log In to Comment