Skip to content

Commit e9b2bda

Browse files
committed
[bazel] Update script to find versions, and roll browsers
1 parent 679fdb8 commit e9b2bda

File tree

2 files changed

+65
-35
lines changed

2 files changed

+65
-35
lines changed

common/repositories.bzl

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ def pin_browsers():
1010

1111
http_archive(
1212
name = "linux_firefox",
13-
url = "https://ftp.mozilla.org/pub/firefox/releases/109.0.1/linux-x86_64/en-US/firefox-109.0.1.tar.bz2",
14-
sha256 = "487a18ecbb0b3b91e402b55424f429d2e4e6127696ee48bb0e60ce7f9879d581",
13+
url = "https://ftp.mozilla.org/pub/firefox/releases/113.0.2/linux-x86_64/en-US/firefox-113.0.2.tar.bz2",
14+
sha256 = "5a4b4fc537d5d358c0fe416fff91692bae9b62264dabd557cf99fb6cbda91acf",
1515
build_file_content = """
1616
filegroup(
1717
name = "files",
@@ -27,53 +27,53 @@ exports_files(
2727

2828
dmg_archive(
2929
name = "mac_firefox",
30-
url = "https://ftp.mozilla.org/pub/firefox/releases/109.0.1/mac/en-US/Firefox%20109.0.1.dmg",
31-
sha256 = "4d69f1675824ff317710d4eadb8ca875573c29692247f398e23bc7a4d31159ba",
30+
url = "https://ftp.mozilla.org/pub/firefox/releases/113.0.2/mac/en-US/Firefox%20113.0.2.dmg",
31+
sha256 = "48749d747b6814e90f643d401a6edf65807551902c8f2fba11de89dc728fa824",
3232
build_file_content = "exports_files([\"Firefox.app\"])",
3333
)
3434

3535
http_archive(
3636
name = "linux_geckodriver",
37-
url = "https://github.com/mozilla/geckodriver/releases/download/v0.32.1/geckodriver-v0.32.1-linux64.tar.gz",
38-
sha256 = "8059f4b4e0bc62dac0c26d020948e92918a8425c382585a19aa50fe3c8284fa8",
37+
url = "https://github.com/mozilla/geckodriver/releases/download/v0.33.0/geckodriver-v0.33.0-linux64.tar.gz",
38+
sha256 = "5f5e89bb31fe5f55f963f56ef7e55a5c8e9dc415d94b1ddc539171a327b8e6c4",
3939
build_file_content = "exports_files([\"geckodriver\"])",
4040
)
4141

4242
http_archive(
4343
name = "mac_geckodriver",
44-
url = "https://github.com/mozilla/geckodriver/releases/download/v0.32.1/geckodriver-v0.32.1-macos.tar.gz",
45-
sha256 = "09883777f88e4f40aeebc6bd8eed75197ea80cff3f89c41a69455e0bc1b92536",
44+
url = "https://github.com/mozilla/geckodriver/releases/download/v0.33.0/geckodriver-v0.33.0-macos.tar.gz",
45+
sha256 = "a39c72553beae18c58a560c84cfe86c1708d101bb3d57b8744e3eca64f403703",
4646
build_file_content = "exports_files([\"geckodriver\"])",
4747
)
4848

4949
pkg_archive(
5050
name = "mac_edge",
51-
url = "https://officecdn-microsoft-com.akamaized.net/pr/C1297A47-86C4-4C1F-97FA-950631F94777/MacAutoupdate/MicrosoftEdge-109.0.1518.78.pkg?platform=Mac&Consent=0&channel=Stable",
52-
sha256 = "a5d59232a411f0d90fe080f739cd2cc14bc5bcea02d86250f9d5df84e32dd162",
51+
url = "https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/5a7ac9fb-6410-4438-a5d1-24a16ab24157/MicrosoftEdge-113.0.1774.57.pkg",
52+
sha256 = "08a84d425db829e378b558dcc0a3df41a60aa7b25ca999d8afd5ebb3c86382e5",
5353
move = {
54-
"MicrosoftEdge-109.0.1518.78.pkg/Payload/Microsoft Edge.app": "Edge.app",
54+
"MicrosoftEdge-113.0.1774.57.pkg/Payload/Microsoft Edge.app": "Edge.app",
5555
},
5656
build_file_content = "exports_files([\"Edge.app\"])",
5757
)
5858

5959
http_archive(
6060
name = "linux_edgedriver",
61-
url = "https://msedgedriver.azureedge.net/109.0.1518.78/edgedriver_linux64.zip",
62-
sha256 = "7492b69802cd52a0d1cc36752fa2aa87122757473b61567b716e0ed5e18431da",
61+
url = "https://msedgedriver.azureedge.net/113.0.1774.57/edgedriver_linux64.zip",
62+
sha256 = "d6992f54c711c1042256b2ab10a0b1054e30222e01484fc068857bee72329adb",
6363
build_file_content = "exports_files([\"msedgedriver\"])",
6464
)
6565

6666
http_archive(
6767
name = "mac_edgedriver",
68-
url = "https://msedgedriver.azureedge.net/109.0.1518.78/edgedriver_mac64.zip",
69-
sha256 = "3235c877f1665487437ca5990d8519e7e30439e8e7b39b22b5d4975e6ba295c8",
68+
url = "https://msedgedriver.azureedge.net/113.0.1774.57/edgedriver_mac64.zip",
69+
sha256 = "299b53816807c70498020d05fe18e442627a40a0f987df87702b3089eb93d6af",
7070
build_file_content = "exports_files([\"msedgedriver\"])",
7171
)
7272

7373
http_archive(
7474
name = "linux_chrome",
75-
url = "https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/1070019/chrome-linux.zip",
76-
sha256 = "735f46d06fe00fac95ed0d51630e38ba12b255621df2011750ff94eba9024b93",
75+
url = "https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/1121435/chrome-linux.zip",
76+
sha256 = "10b4f9e1d4c5d3985b2127a8d771f6f9aacb2b49a2104bd72e0627ffe713718d",
7777
build_file_content = """
7878
filegroup(
7979
name = "files",
@@ -89,22 +89,22 @@ exports_files(
8989

9090
http_archive(
9191
name = "mac_chrome",
92-
url = "https://storage.googleapis.com/chromium-browser-snapshots/Mac/1070019/chrome-mac.zip",
93-
sha256 = "d7bf04e425405318bed942b3b6208a424bcbc2e98183063db16a5d2407a035b3",
92+
url = "https://storage.googleapis.com/chromium-browser-snapshots/Mac/1121435/chrome-mac.zip",
93+
sha256 = "472db714979bf7148a629a13f2c561a919c29c129dfbd697824bba9ea8429042",
9494
strip_prefix = "chrome-mac",
9595
build_file_content = "exports_files([\"Chromium.app\"])",
9696
)
9797

9898
http_archive(
9999
name = "linux_chromedriver",
100-
url = "https://chromedriver.storage.googleapis.com/109.0.5414.74/chromedriver_linux64.zip",
101-
sha256 = "ced4d463501d8a1195f1264a91373b1626ba52beb08e3c7e868ef7a82ae116d6",
100+
url = "https://chromedriver.storage.googleapis.com/113.0.5672.63/chromedriver_linux64.zip",
101+
sha256 = "126151e17b5e42a39d6945f1df2b675d08ad2c79b469a84ecca3aa32f9b9a127",
102102
build_file_content = "exports_files([\"chromedriver\"])",
103103
)
104104

105105
http_archive(
106106
name = "mac_chromedriver",
107-
url = "https://chromedriver.storage.googleapis.com/109.0.5414.74/chromedriver_mac64.zip",
108-
sha256 = "a0dad15fab5c00f8b09d8a2b04eddb8915b3457b5c5aa77177399e5a40eb8670",
107+
url = "https://chromedriver.storage.googleapis.com/113.0.5672.63/chromedriver_mac64.zip",
108+
sha256 = "26c6be21536fe91e8972b5ddf1e8fccee6f07792f74270c599d0457a663d6dc1",
109109
build_file_content = "exports_files([\"chromedriver\"])",
110110
)

scripts/pinned_browsers.py

Lines changed: 42 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env python
22

3-
import codecs
43
import hashlib
54
import json
65
import urllib3
@@ -77,7 +76,17 @@ def chrome():
7776
name = "linux_chrome",
7877
url = "%s",
7978
sha256 = "%s",
80-
build_file_content = "exports_files([\\"chrome-linux\\"])",
79+
build_file_content = \"\"\"
80+
filegroup(
81+
name = "files",
82+
srcs = glob(["**/*"]),
83+
visibility = ["//visibility:public"],
84+
)
85+
86+
exports_files(
87+
["chrome-linux/chrome"],
88+
)
89+
\"\"\",
8190
)
8291
""" % (linux, sha)
8392

@@ -98,15 +107,26 @@ def chrome():
98107
raise RuntimeError("Cannot find stable chrome")
99108

100109
def edge():
101-
r = http.request('GET', 'https://msedgedriver.azureedge.net/LATEST_STABLE')
102-
v = r.data.decode('utf-16').strip()
103-
104-
content = ""
110+
r = http.request('GET', 'https://edgeupdates.microsoft.com/api/products')
111+
all_data = json.loads(r.data)
105112

106-
edge = "https://officecdn-microsoft-com.akamaized.net/pr/C1297A47-86C4-4C1F-97FA-950631F94777/MacAutoupdate/MicrosoftEdge-%s.pkg?platform=Mac&Consent=0&channel=Stable" % v
107-
sha = calculate_hash(edge)
113+
edge = None
114+
hash = None
115+
version = None
108116

109-
content = content + """
117+
for data in all_data:
118+
if not "Stable" == data.get("Product"):
119+
continue
120+
for release in data["Releases"]:
121+
if "MacOS" == release.get("Platform"):
122+
for artifact in release["Artifacts"]:
123+
if "pkg" == artifact["ArtifactName"]:
124+
edge = artifact["Location"]
125+
hash = artifact["Hash"]
126+
version = release["ProductVersion"]
127+
128+
if edge and hash:
129+
return """
110130
pkg_archive(
111131
name = "mac_edge",
112132
url = "%s",
@@ -116,9 +136,9 @@ def edge():
116136
},
117137
build_file_content = "exports_files([\\"Edge.app\\"])",
118138
)
119-
""" % (edge, sha, v)
139+
""" % (edge, hash.lower(), version)
120140

121-
return content
141+
return ""
122142

123143
def edgedriver():
124144
r = http.request('GET', 'https://msedgedriver.azureedge.net/LATEST_STABLE')
@@ -194,7 +214,17 @@ def firefox():
194214
name = "linux_firefox",
195215
url = "%s",
196216
sha256 = "%s",
197-
build_file_content = "exports_files([\\"firefox\\"])",
217+
build_file_content = \"\"\"
218+
filegroup(
219+
name = "files",
220+
srcs = glob(["**/*"]),
221+
visibility = ["//visibility:public"],
222+
)
223+
224+
exports_files(
225+
["firefox/firefox"],
226+
)
227+
\"\"\",
198228
)
199229
""" % (linux, sha)
200230

0 commit comments

Comments
 (0)