Skip to content

Commit 135f191

Browse files
authored
Merge pull request #38 from rust-lang/try_name
Add support for try_name in checks
2 parents df43bc0 + 1757850 commit 135f191

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

cfg.sample.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,10 @@ name = "Travis CI - Branch"
158158
#
159159
# String name of the Checks run.
160160
#name = ""
161+
#
162+
# String name of the Checks run used for try runs.
163+
# If the field is omitted the same name as the auto build will be used.
164+
#try_name = ""
161165

162166
# Use buildbot for running tests
163167
#[repo.NAME.buildbot]

homu/main.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1230,7 +1230,11 @@ def start_build(state, repo_cfgs, buildbot_slots, logger, db, git_cfg):
12301230
if found_travis_context and len(builders) == 1:
12311231
can_try_travis_exemption = True
12321232
if 'checks' in repo_cfg:
1233-
builders += ['checks-' + key for key, value in repo_cfg['checks'].items() if 'name' in value] # noqa
1233+
builders += [
1234+
'checks-' + key
1235+
for key, value in repo_cfg['checks'].items()
1236+
if 'name' in value or (state.try_ and 'try_name' in value)
1237+
]
12341238
only_status_builders = False
12351239

12361240
if len(builders) == 0:

homu/server.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,10 @@ def fail(err):
604604
checks_name = None
605605
if 'checks' in repo_cfg:
606606
for name, value in repo_cfg['checks'].items():
607-
if 'name' in value and value['name'] == current_run_name:
607+
if state.try_ and 'try_name' in value:
608+
if value['try_name'] == current_run_name:
609+
checks_name = name
610+
elif 'name' in value and value['name'] == current_run_name:
608611
checks_name = name
609612
if checks_name is None:
610613
return 'OK'

0 commit comments

Comments
 (0)