| ... |
... |
@@ -19,7 +19,6 @@ import ruamel.yaml |
|
19
|
19
|
import fetch_changelogs
|
|
20
|
20
|
from update_manual import update_manual
|
|
21
|
21
|
|
|
22
|
|
-
|
|
23
|
22
|
logger = logging.getLogger(__name__)
|
|
24
|
23
|
|
|
25
|
24
|
|
| ... |
... |
@@ -121,13 +120,16 @@ class ReleasePreparation: |
|
121
|
120
|
self.changelog_date = kwargs.get("changelog_date", self.build_date)
|
|
122
|
121
|
self.num_incrementals = kwargs.get("num_incrementals", 3)
|
|
123
|
122
|
|
|
|
123
|
+ self.disable_fetching = kwargs.get("no_fetch", False)
|
|
|
124
|
+
|
|
124
|
125
|
self.get_last_releases()
|
|
125
|
126
|
|
|
126
|
127
|
logger.info("Checking you have a working GitLab token.")
|
|
127
|
128
|
self.gitlab_token = fetch_changelogs.load_token()
|
|
128
|
129
|
|
|
129
|
130
|
def run(self):
|
|
130
|
|
- self.branch_sanity_check()
|
|
|
131
|
+ if not self.disable_fetching:
|
|
|
132
|
+ self.branch_sanity_check()
|
|
131
|
133
|
|
|
132
|
134
|
self.update_firefox()
|
|
133
|
135
|
self.update_application_services()
|
| ... |
... |
@@ -248,9 +250,10 @@ class ReleasePreparation: |
|
248
|
250
|
else:
|
|
249
|
251
|
remote = config["git_url"]
|
|
250
|
252
|
repo = Repo(self.base_path / "git_clones/firefox")
|
|
251
|
|
- repo.remotes["origin"].set_url(remote)
|
|
252
|
|
- logger.debug("About to fetch Firefox from %s.", remote)
|
|
253
|
|
- repo.remotes["origin"].fetch()
|
|
|
253
|
+ if not self.disable_fetching:
|
|
|
254
|
+ repo.remotes["origin"].set_url(remote)
|
|
|
255
|
+ logger.debug("About to fetch Firefox from %s.", remote)
|
|
|
256
|
+ repo.remotes["origin"].fetch()
|
|
254
|
257
|
tags = get_sorted_tags(repo)
|
|
255
|
258
|
tag_info = None
|
|
256
|
259
|
for t in tags:
|
| ... |
... |
@@ -296,8 +299,9 @@ class ReleasePreparation: |
|
296
|
299
|
branch = f"{version}-TORBROWSER"
|
|
297
|
300
|
|
|
298
|
301
|
repo = Repo(self.base_path / "git_clones/application-services")
|
|
299
|
|
- logger.debug("About to fetch application-services")
|
|
300
|
|
- repo.remotes["origin"].fetch()
|
|
|
302
|
+ if not self.disable_fetching:
|
|
|
303
|
+ logger.debug("About to fetch application-services")
|
|
|
304
|
+ repo.remotes["origin"].fetch()
|
|
301
|
305
|
|
|
302
|
306
|
tags = get_sorted_tags(repo)
|
|
303
|
307
|
tag_info = None
|
| ... |
... |
@@ -323,7 +327,8 @@ class ReleasePreparation: |
|
323
|
327
|
def update_translations(self):
|
|
324
|
328
|
logger.info("Updating translations")
|
|
325
|
329
|
repo = Repo(self.base_path / "git_clones/translation")
|
|
326
|
|
- repo.remotes["origin"].fetch()
|
|
|
330
|
+ if not self.disable_fetching:
|
|
|
331
|
+ repo.remotes["origin"].fetch()
|
|
327
|
332
|
config = self.load_config("translation")
|
|
328
|
333
|
targets = ["base-browser"]
|
|
329
|
334
|
if self.tor_browser:
|
| ... |
... |
@@ -411,11 +416,11 @@ class ReleasePreparation: |
|
411
|
416
|
def update_tor(self):
|
|
412
|
417
|
logger.info("Updating Tor")
|
|
413
|
418
|
databag = configparser.ConfigParser()
|
|
414
|
|
- r = requests.get("https://www.torproject.org/download/versions.ini")
|
|
|
419
|
+ r = requests.get("https://download.torproject.org/versions.ini")
|
|
415
|
420
|
r.raise_for_status()
|
|
416
|
421
|
databag.read_string(r.text)
|
|
417
|
|
- tor_stable = databag["tor-stable"]["version"]
|
|
418
|
|
- tor_alpha = databag["tor-alpha"]["version"]
|
|
|
422
|
+ tor_stable = databag["tor"]["stable"]
|
|
|
423
|
+ tor_alpha = databag["tor"].get("alpha")
|
|
419
|
424
|
logger.debug(
|
|
420
|
425
|
"Found tor stable: %s, alpha: %s",
|
|
421
|
426
|
tor_stable,
|
| ... |
... |
@@ -475,7 +480,8 @@ class ReleasePreparation: |
|
475
|
480
|
return
|
|
476
|
481
|
|
|
477
|
482
|
repo = Repo(self.base_path / "git_clones/zstd")
|
|
478
|
|
- repo.remotes["origin"].fetch()
|
|
|
483
|
+ if not self.disable_fetching:
|
|
|
484
|
+ repo.remotes["origin"].fetch()
|
|
479
|
485
|
tag = repo.rev_parse(f"v{version}")
|
|
480
|
486
|
|
|
481
|
487
|
config["version"] = version
|
| ... |
... |
@@ -530,7 +536,8 @@ class ReleasePreparation: |
|
530
|
536
|
|
|
531
|
537
|
repo = Repo(self.base_path / "git_clones" / proj)
|
|
532
|
538
|
origin = repo.remotes["origin"]
|
|
533
|
|
- origin.fetch()
|
|
|
539
|
+ if not self.disable_fetching:
|
|
|
540
|
+ origin.fetch()
|
|
534
|
541
|
commit = origin.refs["main"].commit.hexsha
|
|
535
|
542
|
|
|
536
|
543
|
config = self.load_config(proj)
|
| ... |
... |
@@ -747,6 +754,11 @@ if __name__ == "__main__": |
|
747
|
754
|
action="store_true",
|
|
748
|
755
|
help="Only update the changelogs",
|
|
749
|
756
|
)
|
|
|
757
|
+ parser.add_argument(
|
|
|
758
|
+ "--no-fetch",
|
|
|
759
|
+ action="store_true",
|
|
|
760
|
+ help="Do not fetch over git",
|
|
|
761
|
+ )
|
|
750
|
762
|
parser.add_argument(
|
|
751
|
763
|
"--log-level",
|
|
752
|
764
|
choices=["debug", "info", "warning", "error"],
|
| ... |
... |
@@ -790,6 +802,8 @@ if __name__ == "__main__": |
|
790
|
802
|
sys.exit(1)
|
|
791
|
803
|
if args.incrementals:
|
|
792
|
804
|
kwargs["incrementals"] = args.incrementals
|
|
|
805
|
+ if args.no_fetch:
|
|
|
806
|
+ kwargs["no_fetch"] = True
|
|
793
|
807
|
rp = ReleasePreparation(args.repository, args.version, **kwargs)
|
|
794
|
808
|
if args.only_changelogs:
|
|
795
|
809
|
logger.info("Updating only the changelogs")
|