chore: Sync upstream Firefox to version 147.0, p=#11822

* chore: Sync upstream to `Firefox 147.0`

* chore: Continued migration, b=no-bug, c=tests

* chore: Finish migration without testing, b=no-bug, c=scripts, tabs, media, common, split-view

* feat: Finish migration, b=no-bug, c=common, compact-mode, split-view, workspaces

* feat: Finish basic migration, b=no-bug, c=kbs, common, folders

* feat: Update surfer, b=no-bug, c=scripts
This commit is contained in:
mr. m
2026-01-08 18:06:05 +01:00
committed by GitHub
parent ae93efef57
commit 7e7d860c9e
113 changed files with 788 additions and 800 deletions

View File

@@ -17,7 +17,7 @@ def get_current_version() -> Optional[str]:
try:
with open(METADATA_FILENAME) as f:
metadata = json.load(f)
return metadata["version"]["candidate"]
return metadata["version"]["candidate"], metadata["version"]["candidateBuild"]
except (FileNotFoundError, json.JSONDecodeError) as e:
print(f"Error reading current version: {e}")
return None
@@ -43,8 +43,10 @@ def get_rc_response() -> Optional[str]:
tag = tag_dict["tag"]
if (tag.startswith("FIREFOX") and tag.endswith("_BUILD1")
and "ESR" not in tag and "b" not in tag and "ANDROID" not in tag):
return (tag.replace("FIREFOX_", "").replace("_BUILD1",
"").replace("_", "."))
version = (tag.replace("FIREFOX_", "").replace("_BUILD1",
"").replace("_", "."))
build = int(tag.split("_BUILD")[-1])
return version, build
except (FileNotFoundError, json.JSONDecodeError) as e:
print(f"Error reading RC response: {e}")
return None
@@ -76,15 +78,15 @@ def send_webhook(rc: str) -> None:
print("Webhook URL not set.")
def rc_should_be_updated(rc_response: str, current_version: str) -> bool:
return rc_response and rc_response != current_version
def rc_should_be_updated(rc_response: str, current_version: str, rc_build: int, current_build: int) -> bool:
return rc_response and (rc_response != current_version or rc_build != current_build)
def main() -> int:
current_version = get_current_version()
rc_response = get_rc_response()
current_version, current_build = get_current_version()
rc_response, rc_build = get_rc_response()
if rc_should_be_updated(rc_response, current_version):
if rc_should_be_updated(rc_response, current_version, rc_build, current_build):
send_webhook(rc_response)
return 0

View File

@@ -16,7 +16,7 @@ IGNORE_FILES=(
# Recursively find all .patch files in the current directory and its subdirectories
find src -type f -name "*.patch" | while read -r patch_file; do
# Get the file from the inside of the file as indicated by the patch
target_file=$(grep -m 1 -oP '(?<=\+\+\+ b/).+' "$patch_file")
target_file=$(grep -m 1 -E '^\+\+\+ b/' "$patch_file" | sed 's/^\+\+\+ b\///')
if [[ -z "$target_file" ]]; then
echo "No target file found in patch: $patch_file"
continue

View File

@@ -10,4 +10,4 @@ if [ ! -f "package.json" ]; then
fi
npm update @zen-browser/surfer
npm i @zen-browser/surfer@latest
npm i @zen-browser/surfer@latest -D

View File

@@ -10,9 +10,9 @@ import shutil
from check_rc_response import get_rc_response, rc_should_be_updated
def update_rc(last_version: str):
rc_version = get_rc_response()
if rc_should_be_updated(rc_version, last_version):
def update_rc(last_version: str, last_build: int):
rc_version, rc_build = get_rc_response()
if rc_should_be_updated(rc_version, last_version, rc_build, last_build):
print(f"New Firefox RC version is available: {rc_version}")
print("Removing engine directory and updating surfer.json.")
if os.path.exists("engine"):
@@ -21,6 +21,7 @@ def update_rc(last_version: str):
data = json.load(f)
with open("surfer.json", "w") as f:
data["version"]["candidate"] = rc_version
data["version"]["candidateBuild"] = rc_build
json.dump(data, f, indent=2)
print("Download the new engine by running 'npm run download'.")
os.system("npm run download")
@@ -28,10 +29,10 @@ def update_rc(last_version: str):
print("No new Firefox RC version available.")
def update_ff(is_rc: bool = False, last_version: str = ""):
def update_ff(is_rc: bool = False, last_version: str = "", last_build: int = 0):
"""Runs the npm command to sync Firefox."""
if is_rc:
return update_rc(last_version)
return update_rc(last_version, last_build)
result = os.system("npm run sync:raw")
if result != 0:
raise RuntimeError("Failed to sync Firefox.")
@@ -42,7 +43,8 @@ def get_version_from_file(filename, is_rc):
try:
with open(filename, "r") as f:
data = json.load(f)
return data["version"]["version"] if not is_rc else data["version"]["candidate"]
return (data["version"]["version"] if not is_rc else data["version"]["candidate"],
data["version"]["candidateBuild"])
except (FileNotFoundError, json.JSONDecodeError) as e:
raise RuntimeError(f"Error reading version from {filename}: {e}")
@@ -91,9 +93,9 @@ def main():
try:
if not args.just_l10n:
last_version = get_version_from_file("surfer.json", args.rc)
update_ff(args.rc, last_version)
new_version = get_version_from_file("surfer.json", args.rc)
last_version, last_build = get_version_from_file("surfer.json", args.rc)
update_ff(args.rc, last_version, last_build)
new_version, new_build = get_version_from_file("surfer.json", args.rc)
update_readme(last_version, new_version, args.rc)
print(
f"Updated version from {last_version} to {new_version} in README.md.")