Skip to content
This repository was archived by the owner on Mar 19, 2021. It is now read-only.

Commit fbd91b7

Browse files
authored
Revert "Don't use HEAD or FETCH_HEAD to checkout specific revisions. (#16066)" (#16101)
This reverts commit 856a95f.
1 parent 65f12c6 commit fbd91b7

File tree

4 files changed

+33
-31
lines changed

4 files changed

+33
-31
lines changed

.taskcluster.yml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ tasks:
6464
owner: ${event.pusher.email}
6565
source: ${event.repository.url}
6666
payload:
67-
image: harjgam/web-platform-tests:0.32
67+
image: harjgam/web-platform-tests:0.30
6868
maxRunTime: 7200
6969
artifacts:
7070
public/results:
@@ -80,7 +80,8 @@ tasks:
8080
echo "wpt-${browser.name}-${browser.channel}-${chunk[0]}-${chunk[1]}";
8181
~/start.sh
8282
${event.repository.url}
83-
${event.ref};
83+
${event.ref}
84+
${event.after};
8485
cd ~/web-platform-tests;
8586
./tools/ci/run_tc.py
8687
--oom-killer
@@ -92,7 +93,6 @@ tasks:
9293
./tools/ci/taskcluster-run.py
9394
${browser.name}
9495
--
95-
--checkout=${event.after}
9696
--channel=${browser.channel}
9797
--log-wptreport=../artifacts/wpt_report.json
9898
--log-wptscreenshot=../artifacts/wpt_screenshot.txt
@@ -112,15 +112,15 @@ tasks:
112112
$map:
113113
# This is the main place to define new stability checks
114114
- name: wpt-${browser.name}-${browser.channel}-stability
115-
checkout: task_head
116-
diff_base: base_head
115+
checkout: FETCH_HEAD
116+
diff_range: HEAD^
117117
description: >-
118118
Verify that all tests affected by a pull request are stable
119119
when executed in ${browser.name}.
120120
extra_args: '--verify'
121121
- name: wpt-${browser.name}-${browser.channel}-results
122-
checkout: task_head
123-
diff_base: base_head
122+
checkout: FETCH_HEAD
123+
diff_range: HEAD^
124124
description: >-
125125
Collect results for all tests affected by a pull request in
126126
${browser.name}.
@@ -129,8 +129,8 @@ tasks:
129129
--log-wptreport=../artifacts/wpt_report.json
130130
--log-wptscreenshot=../artifacts/wpt_screenshot.txt
131131
- name: wpt-${browser.name}-${browser.channel}-results-without-changes
132-
checkout: base_head
133-
diff_base: task_head
132+
checkout: FETCH_HEAD^
133+
diff_range: FETCH_HEAD
134134
description: >-
135135
Collect results for all tests affected by a pull request in
136136
${browser.name} but without the changes in the PR.
@@ -156,7 +156,7 @@ tasks:
156156
owner: ${event.pull_request.user.login}@users.noreply.github.com
157157
source: ${event.repository.url}
158158
payload:
159-
image: harjgam/web-platform-tests:0.32
159+
image: harjgam/web-platform-tests:0.30
160160
maxRunTime: 7200
161161
artifacts:
162162
public/results:
@@ -178,7 +178,8 @@ tasks:
178178
echo "${operation.name}";
179179
~/start.sh
180180
${event.repository.clone_url}
181-
refs/pull/${event.number}/merge;
181+
refs/pull/${event.number}/merge
182+
FETCH_HEAD;
182183
cd web-platform-tests;
183184
./tools/ci/run_tc.py
184185
--checkout=${operation.checkout}
@@ -188,7 +189,7 @@ tasks:
188189
--xvfb
189190
stability
190191
./tools/ci/taskcluster-run.py
191-
--commit-range ${operation.diff_base}
192+
--commit-range ${operation.diff_range}
192193
${browser.name}
193194
--
194195
--channel=${browser.channel}
@@ -309,7 +310,7 @@ tasks:
309310
owner: ${event.sender.login}@users.noreply.github.com
310311
source: ${event.repository.url}
311312
payload:
312-
image: harjgam/web-platform-tests:0.32
313+
image: harjgam/web-platform-tests:0.30
313314
maxRunTime: 7200
314315
artifacts:
315316
public/results:
@@ -325,6 +326,7 @@ tasks:
325326
echo "${operation.name}";
326327
~/start.sh
327328
${event.repository.clone_url}
328-
${checkout_ref};
329+
${checkout_ref}
330+
FETCH_HEAD;
329331
cd ~/web-platform-tests;
330332
${operation.script};

tools/ci/run_tc.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def make_hosts_file():
117117

118118

119119
def checkout_revision(rev):
120-
subprocess.check_call(["git", "--quiet", "checkout", rev])
120+
subprocess.check_call(["git", "checkout", "-q", rev])
121121

122122

123123
def install_chrome(channel):
@@ -233,19 +233,6 @@ def main():
233233
if event:
234234
set_variables(event)
235235

236-
if os.environ.get("GITHUB_PULL_REQUEST", "false") != "false":
237-
parents = run(["git", "show", "--format=%P", "task_head"], return_stdout=True).strip().split()
238-
if len(parents) == 2:
239-
base_head = parents[0]
240-
pr_head = parents[1]
241-
242-
run(["git", "branch", "base_head", base_head])
243-
run(["git", "branch", "pr_head", pr_head])
244-
else:
245-
print("ERROR: Pull request HEAD wasn't a 2-parent merge commit; "
246-
"expected to test the merge of PR into the base")
247-
sys.exit(1)
248-
249236
if os.environ.get("GITHUB_BRANCH"):
250237
# Ensure that the remote base branch exists
251238
# TODO: move this somewhere earlier in the task

tools/ci/start.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Contents of this script superceeded by tools/ci/run_tc.py

tools/docker/start.sh

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ set -ex
1414

1515
REMOTE=${1:-https://github.com/web-platform-tests/wpt}
1616
REF=${2:-master}
17+
REVISION=${3:-FETCH_HEAD}
18+
BROWSER=${4:-all}
19+
CHANNEL=${5:-nightly}
1720

1821
cd ~
1922

@@ -24,6 +27,15 @@ git init
2427
git remote add origin ${REMOTE}
2528

2629
# Initially we just fetch 50 commits in order to save several minutes of fetching
27-
retry git fetch --quiet --depth=50 --tags origin ${REF}:task_head
28-
29-
git checkout --quiet task_head
30+
retry git fetch --quiet --depth=50 --tags origin ${REF}
31+
32+
if [[ ! `git rev-parse --verify -q ${REVISION}` ]];
33+
then
34+
# But if for some reason the commit under test isn't in that range, we give in and
35+
# fetch everything
36+
retry git fetch -q --unshallow ${REMOTE}
37+
git rev-parse --verify ${REVISION}
38+
fi
39+
git checkout -b build ${REVISION}
40+
41+
source tools/ci/start.sh

0 commit comments

Comments
 (0)