morgan pushed to branch main at The Tor Project / Applications / tor-browser-build
Commits: 11cdd993 by Pier Angelo Vendrame at 2024-10-17T16:05:28+02:00 Bug 41273: Bump Firefox/GeckoView tag when does not match HEAD.
If we detect the tag we would use for build does not match the HEAD of the branch we are using, bump it preemptively. Normally, we would add that tag when ready to build, so this change can help us in case we forget to. If the script is overzealous, we can change the build number before committing.
- - - - -
1 changed file:
- tools/relprep.py
Changes:
===================================== tools/relprep.py ===================================== @@ -242,6 +242,7 @@ class ReleasePreparation: logger.debug("About to fetch Firefox from %s.", remote) repo.remotes["origin"].fetch() tags = get_sorted_tags(repo) + tag_info = None for t in tags: m = re.match( r"(\w+-browser)-([^-]+)-([\d.]+)-(\d+)-build(\d+)", t.tag @@ -251,8 +252,21 @@ class ReleasePreparation: and m.group(1) == browser and m.group(3) == self.version.major ): + logger.debug("Matched tag %s.", t.tag) # firefox-version, rebase, build - return (m.group(2), int(m.group(4)), int(m.group(5))) + tag_info = [m.group(2), int(m.group(4)), int(m.group(5))] + break + if tag_info is None: + raise RuntimeError("No compatible tag found.") + branch = t.tag[: m.end(4)] + logger.debug("Checking if tag %s is head of %s.", t.tag, branch) + if t.object != repo.remotes["origin"].refs[branch].commit: + logger.info( + "Found new commits after tag %s, bumping the build number preemptively.", + t.tag, + ) + tag_info[2] += 1 + return tag_info
def update_translations(self): logger.info("Updating translations") @@ -373,9 +387,7 @@ class ReleasePreparation:
source = self.find_input(config, "openssl") # No need to update URL, as it uses a variable. - hash_url = ( - f"https://github.com/openssl/openssl/releases/download/openssl-%7Bversion%7D/o..." - ) + hash_url = f"https://github.com/openssl/openssl/releases/download/openssl-%7Bversion%7D/o..." r = requests.get(hash_url) r.raise_for_status() source["sha256sum"] = r.text.strip()
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/11...
tor-commits@lists.torproject.org