Skip to content

Commit c3f4e65

Browse files
committed
Updated with latest changes
1 parent 2132c85 commit c3f4e65

File tree

252 files changed

+7758
-2355
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

252 files changed

+7758
-2355
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
autoinstalled/
2+
__pycache__/
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Copyright (C) 2024 Apple Inc. All rights reserved.
2+
#
3+
Redistribution and use in source and binary forms, with or without
4+
modification, are permitted provided that the following conditions
5+
are met:
6+
1. Redistributions of source code must retain the above copyright
7+
notice, this list of conditions and the following disclaimer.
8+
2. Redistributions in binary form must reproduce the above copyright
9+
notice, this list of conditions and the following disclaimer in the
10+
documentation and/or other materials provided with the distribution.
11+
#
12+
THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
13+
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
15+
DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
16+
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
17+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
18+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
21+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# reporelay
2+
3+
Library implementing https://commits.webkit.org for the WebKit project.

WebKit/Tools/Scripts/libraries/reporelaypy/reporelaypy/__init__.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,13 @@
2020
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2121
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2222

23-
import os
2423
import sys
2524

25+
if sys.version_info < (3, 9): # noqa: UP036
26+
raise ImportError("reporelaypy requires Python 3.9 or above")
27+
28+
import os
29+
2630

2731
def _maybe_add_webkit_python_library_paths():
2832
# Hopefully we're beside webkit*py libraries, otherwise webkit*py will need to be installed.
@@ -40,8 +44,8 @@ def _maybe_add_webkit_python_library_paths():
4044
except ImportError:
4145
raise ImportError(
4246
"'webkitcorepy' could not be found on your Python path.\n" +
43-
"You are not running from a WebKit checkout.\n" +
44-
"Please install webkitcorepy with `pip install webkitcorepy --extra-index-url <package index URL>`"
47+
"You are not running from a complete WebKit checkout.\n" +
48+
"See https://github.com/WebKit/WebKit/tree/main/Tools/Scripts/libraries/webkitcorepy"
4549
)
4650

4751
version = Version(0, 8, 5)

WebKit/Tools/Scripts/libraries/reporelaypy/run

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import argparse
2626
import json
2727
import math
2828
import os
29+
import shutil
2930
import subprocess
3031
import sys
3132
import time
@@ -41,7 +42,6 @@ if os.path.isdir(os.path.join(scripts, 'webkitpy')):
4142
from reporelaypy import Checkout, HookProcessor, HookReceiver, Redirector
4243
from webkitflaskpy import Database
4344
from webkitcorepy import arguments, AutoInstall
44-
from whichcraft import which
4545

4646

4747
def main(args=None):
@@ -189,7 +189,7 @@ def main(args=None):
189189
processor = HookProcessor(checkout=checkout, database=database) if args.hooks else None
190190

191191
with subprocess.Popen(
192-
[which('gunicorn'), 'reporelaypy.webserver:app'],
192+
[shutil.which('gunicorn'), 'reporelaypy.webserver:app'],
193193
cwd=os.path.dirname(os.path.dirname(reporelaypy.__file__)),
194194
env=passenv,
195195
) as webserver:

WebKit/Tools/Scripts/libraries/reporelaypy/setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def readme():
3333
version='0.8.5',
3434
description='Library for visualizing, processing and storing test results.',
3535
long_description=readme(),
36+
long_description_content_type='text/markdown',
3637
classifiers=[
3738
'Development Status :: 4 - Beta',
3839
'Framework :: Flask',
@@ -51,7 +52,7 @@ def readme():
5152
license='Modified BSD',
5253
packages=[
5354
'reporelaypy',
54-
'reporelaypy.test',
55+
'reporelaypy.tests',
5556
],
5657
install_requires=[
5758
'xmltodict',
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Copyright (C) 2024 Apple Inc. All rights reserved.
2+
#
3+
Redistribution and use in source and binary forms, with or without
4+
modification, are permitted provided that the following conditions
5+
are met:
6+
1. Redistributions of source code must retain the above copyright
7+
notice, this list of conditions and the following disclaimer.
8+
2. Redistributions in binary form must reproduce the above copyright
9+
notice, this list of conditions and the following disclaimer in the
10+
documentation and/or other materials provided with the distribution.
11+
#
12+
THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
13+
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
15+
DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
16+
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
17+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
18+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
21+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

WebKit/Tools/Scripts/libraries/resultsdbpy/resultsdbpy/__init__.py

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,13 @@
2020
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2121
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2222

23+
import sys
24+
25+
if sys.version_info < (3, 9): # noqa: UP036
26+
raise ImportError("resultsdbpy requires Python 3.9 or above")
27+
2328
import os
2429
import platform
25-
import sys
2630

2731

2832
def _maybe_add_webkit_python_library_paths():
@@ -41,8 +45,8 @@ def _maybe_add_webkit_python_library_paths():
4145
except ImportError:
4246
raise ImportError(
4347
"'webkitcorepy' could not be found on your Python path.\n" +
44-
"You are not running from a WebKit checkout.\n" +
45-
"Please install webkitcorepy with `pip install webkitcorepy --extra-index-url <package index URL>`"
48+
"You are not running from a complete WebKit checkout.\n" +
49+
"See https://github.com/WebKit/WebKit/tree/main/Tools/Scripts/libraries/webkitcorepy"
4650
)
4751

4852
version = Version(3, 1, 9)
@@ -53,34 +57,29 @@ def _maybe_add_webkit_python_library_paths():
5357
AutoInstall.register(Package('attrs', Version(21, 3, 0)))
5458
AutoInstall.register(Package('aioredis', Version(1, 3, 1)))
5559
AutoInstall.register(Package('async-timeout', Version(3, 0, 1)))
56-
57-
if sys.version_info >= (3, 9):
58-
AutoInstall.register(Package('boto3', Version(1, 33, 10), wheel=True))
59-
AutoInstall.register(Package('botocore', Version(1, 34, 5), wheel=True))
60-
AutoInstall.register(Package('jmespath', Version(1, 0, 1), wheel=True))
61-
else:
62-
AutoInstall.register(Package('boto3', Version(1, 16, 63), wheel=True))
63-
AutoInstall.register(Package('botocore', Version(1, 19, 63), wheel=True))
64-
AutoInstall.register(Package('jmespath', Version(0, 10, 0), wheel=True))
60+
AutoInstall.register(Package('boto3', Version(1, 33, 10), wheel=True))
61+
AutoInstall.register(Package('botocore', Version(1, 34, 5), wheel=True))
62+
AutoInstall.register(Package('jmespath', Version(1, 0, 1), wheel=True))
6563

6664
if platform.machine() == 'arm64':
6765
AutoInstall.register(Package('cassandra', Version(3, 25, 0), pypi_name='cassandra-driver', slow_install=True))
6866
else:
6967
AutoInstall.register(Package('cassandra', Version(3, 25, 0), pypi_name='cassandra-driver', wheel=True))
70-
AutoInstall.register(Package('click', Version(7, 1, 2)))
68+
7169
AutoInstall.register(Package('Crypto', Version(3, 10, 1), pypi_name='pycryptodome'))
7270
AutoInstall.register(Package('fakeredis', Version(1, 5, 2)))
7371
AutoInstall.register(Package('geomet', Version(0, 2, 1)))
7472
AutoInstall.register(Package('gremlinpython', Version(3, 4, 6)))
75-
AutoInstall.register(Package('hiredis', Version(1, 1, 0)))
7673
AutoInstall.register(Package('isodate', Version(0, 6, 0)))
77-
AutoInstall.register(Package('lupa', Version(1, 13)))
7874
AutoInstall.register(Package('pyasn1_modules', Version(0, 2, 8), pypi_name='pyasn1-modules'))
7975
AutoInstall.register(Package('redis', Version(3, 5, 3)))
80-
if sys.version_info < (3, 8):
81-
AutoInstall.register(Package('selenium', Version(3, 141, 0)))
76+
77+
if sys.platform == 'linux':
78+
AutoInstall.register(Package('selenium', Version(4, 24, 0), wheel=True, implicit_deps=[
79+
Package('websocket', Version(1, 8, 0), pypi_name='websocket-client')]))
8280
else:
8381
AutoInstall.register(Package('selenium', Version(4, 12, 0), wheel=True))
82+
8483
AutoInstall.register(Package('service_identity', Version(21, 1, 0), pypi_name='service-identity'))
8584
AutoInstall.register(Package('sortedcontainers', Version(2, 4, 0)))
8685
AutoInstall.register(Package('tornado', Version(4, 5, 3)))

WebKit/Tools/Scripts/libraries/resultsdbpy/resultsdbpy/controller/archive_controller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def download(
8585

8686
if not result:
8787
abort(404, description='No archives matching the specified criteria')
88-
return send_file(result, attachment_filename=f'{filename}.zip', as_attachment=True)
88+
return send_file(result, download_name=f'{filename}.zip', as_attachment=True)
8989

9090
def upload(self):
9191
AssertRequest.is_type(['POST'])

WebKit/Tools/Scripts/libraries/resultsdbpy/resultsdbpy/flask_support/flask_testcase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class FlaskTestCase(unittest.TestCase):
4141

4242
@classmethod
4343
def driver(cls):
44-
if cls._cached_driver:
44+
if not int(os.environ.get('selenium', '0')) or cls._cached_driver:
4545
return cls._driver
4646

4747
try:

WebKit/Tools/Scripts/libraries/resultsdbpy/resultsdbpy/model/wait_for_docker_test_case.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
class WaitForDockerTestCase(unittest.TestCase):
3333

3434
def setUp(self):
35-
if Docker.is_running() and int(os.environ.get('slow_tests', '0')):
35+
if int(os.environ.get('slow_tests', '0')) and Docker.is_running():
3636
with Docker.instance():
3737
StrictRedis().flushdb()
3838
FakeStrictRedis().flushdb()

WebKit/Tools/Scripts/libraries/resultsdbpy/resultsdbpy/view/static/js/configuration.js

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,22 +115,45 @@ class Configuration {
115115
return '';
116116
if (['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'].includes(match[2]))
117117
return match[2];
118-
if (['J', 'N', 'R'].includes(match[2]))
119-
return 'A';
120-
if (['K', 'S'].includes(match[2])) {
118+
if (['J', 'R'].includes(match[2])) {
121119
const count = parseInt(match[3]);
122-
if (count < 200)
120+
if (count < 500)
121+
return 'A';
122+
if (count < 700)
123123
return 'B';
124+
if (count < 800)
125+
return 'C';
126+
return 'D';
127+
}
128+
if (['N'].includes(match[2])) {
129+
const count = parseInt(match[3]);
124130
if (count < 500)
125-
return 'C'
131+
return 'A';
132+
if (count < 700)
133+
return 'B';
134+
if (count <= 800 || count >= 840 && count < 870)
135+
return 'C';
126136
return 'D';
127137
}
138+
if (['K'].includes(match[2])) {
139+
const count = parseInt(match[3]);
140+
if (count < 200)
141+
return 'B';
142+
if (count < 510)
143+
return 'C';
144+
return 'D';
145+
}
146+
if (['S'].includes(match[2])) {
147+
return 'C';
148+
}
128149
if (['L', 'O', 'T'].includes(match[2])) {
129150
const count = parseInt(match[3]);
130151
if (count < 400)
131152
return 'E'
132153
return 'F';
133154
}
155+
if (['M'].includes(match[2]) && Number(match[1]) >= 23)
156+
return 'A';
134157
if (['M', 'U'].includes(match[2]))
135158
return 'G';
136159

WebKit/Tools/Scripts/libraries/resultsdbpy/resultsdbpy/view/static/js/drawer.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,15 @@ function CommitSearchBar(onSearchAction = null) {
123123
}
124124
});
125125
const searchHotKeyFunction = (e) => {
126-
if (e.key == "f" && ( e.ctrlKey || e.metaKey )) {
127-
e.preventDefault();
128-
searchInputRef.element.focus();
129-
}
126+
if (e.key !== "f" || !( e.ctrlKey || e.metaKey ))
127+
return;
128+
129+
const element = searchInputRef.element;
130+
if (element.disabled)
131+
return;
132+
133+
e.preventDefault();
134+
element.focus();
130135
};
131136
const searchInputEventStream = searchInputRef.fromEvent("keyup");
132137
searchInputEventStream.action((e) => {
@@ -138,8 +143,8 @@ function CommitSearchBar(onSearchAction = null) {
138143
});
139144

140145
const searchButtonRef = REF.createRef({});
141-
const searchButtonClikEventStream = searchButtonRef.fromEvent("click");
142-
searchButtonClikEventStream.action((e) => {
146+
const searchButtonClickEventStream = searchButtonRef.fromEvent("click");
147+
searchButtonClickEventStream.action((e) => {
143148
const searchValue = searchInputRef.element.value;
144149
if (onSearchAction)
145150
onSearchAction(searchValue);

WebKit/Tools/Scripts/libraries/resultsdbpy/resultsdbpy/view/static/library/css/webkit.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,18 @@ pre {
649649
border-radius: var(--tinySize);
650650
}
651651

652+
.dot.tiny img, .dot.tiny .text {
653+
width: calc(var(--tinySize) - 2px);
654+
height: calc(var(--tinySize) - 2px);
655+
font-size: calc(var(--tinySize) - 2px);
656+
}
657+
658+
.dot.tiny>img, .dot.tiny>.text {
659+
position: absolute;
660+
top: 1px;
661+
left: 1px;
662+
}
663+
652664
.dot.small {
653665
font-size: var(--tinySize);
654666
width: var(--smallSize);

WebKit/Tools/Scripts/libraries/resultsdbpy/resultsdbpy/view/templates/search.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@
340340
const queryString = paramsToQuery(params);
341341
window.history.pushState(queryString, '', splitURL[0] + '?' + queryString);
342342
}, SUITES)}
343-
${dashboards.map(dashboard=>{return dashboard.toString();})}
343+
${dashboards.map(dashboard=>{return dashboard.toString();}).join('')}
344344
${view}
345345
</div>
346346
</div>`

WebKit/Tools/Scripts/libraries/resultsdbpy/resultsdbpy/view/view_routes_unittest.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ def test_commit_link(self, driver, **kwargs):
116116
@WaitForDockerTestCase.mock_if_no_docker(mock_redis=FakeStrictRedis, mock_cassandra=MockCassandraContext)
117117
@FlaskTestCase.run_with_webserver()
118118
def test_constants(self, client, **kwargs):
119+
self.maxDiff = None
119120
response = client.get(f'{self.URL}/assets/js/constants.js')
120121
self.assertEqual(response.status_code, 200)
121122
self.assertEqual(
@@ -147,6 +148,10 @@ def test_constants(self, client, **kwargs):
147148
'Build',
148149
];
149150
const DEFAULT_ARCHITECTURE = null;
151+
const TESTS_LIMITS = JSON.parse('{"max": 50000, "default": 5000}');
152+
const SUITES_LIMITS = JSON.parse('{"max": 10000, "default": 1000}');
153+
const COMMITS_LIMITS = JSON.parse('{"max": 10000, "default": 1000}');
154+
const DASHBOARD_QUERY = JSON.parse('[]');
150155
151-
export {XCODE_CLOUD_SUITES, DEFAULT_ARCHITECTURE}''',
156+
export {XCODE_CLOUD_SUITES, DEFAULT_ARCHITECTURE, TESTS_LIMITS, SUITES_LIMITS, COMMITS_LIMITS, DASHBOARD_QUERY}''',
152157
)

WebKit/Tools/Scripts/libraries/resultsdbpy/setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def readme():
3333
version='3.1.9',
3434
description='Library for visualizing, processing and storing test results.',
3535
long_description=readme(),
36+
long_description_content_type='text/markdown',
3637
classifiers=[
3738
'Development Status :: 4 - Beta',
3839
'Framework :: Flask',
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Copyright (C) 2024 Apple Inc. All rights reserved.
2+
#
3+
Redistribution and use in source and binary forms, with or without
4+
modification, are permitted provided that the following conditions
5+
are met:
6+
1. Redistributions of source code must retain the above copyright
7+
notice, this list of conditions and the following disclaimer.
8+
2. Redistributions in binary form must reproduce the above copyright
9+
notice, this list of conditions and the following disclaimer in the
10+
documentation and/or other materials provided with the distribution.
11+
#
12+
THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
13+
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
15+
DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
16+
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
17+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
18+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
21+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

WebKit/Tools/Scripts/libraries/webkitbugspy/setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ def readme():
3030

3131
setup(
3232
name='webkitbugspy',
33-
version='0.15.0',
33+
version='0.15.1',
3434
description='Library containing a shared API for various bug trackers.',
3535
long_description=readme(),
36+
long_description_content_type='text/markdown',
3637
classifiers=[
3738
'Development Status :: 5 - Production/Stable',
3839
'Intended Audience :: Developers',

0 commit comments

Comments
 (0)