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