[tor-commits] [Git][tpo/applications/tor-browser-build][main] Bug 41273: Bump Firefox/GeckoView tag when does not match HEAD.

morgan (@morgan) git at gitlab.torproject.org
Thu Oct 17 18:09:52 UTC 2024



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-{version}/openssl-{version}.tar.gz.sha256"
-        )
+        hash_url = f"https://github.com/openssl/openssl/releases/download/openssl-{version}/openssl-{version}.tar.gz.sha256"
         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/11cdd993f8d2decfcd0a9f2767103c77299f740e

-- 
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/11cdd993f8d2decfcd0a9f2767103c77299f740e
You're receiving this email because of your account on gitlab.torproject.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tor-commits/attachments/20241017/08f34333/attachment-0001.htm>


More information about the tor-commits mailing list