From 00ddc80fb842b2ec58087fd89689b2363d60fa7f Mon Sep 17 00:00:00 2001 From: Silke Hofstra Date: Thu, 9 Apr 2026 20:24:39 +0200 Subject: [PATCH 1/2] common/Scripts/publish_series.py: Increase performance **Summary** Increase the performance of checking known builds by getting the list of builds only once before starting. This is mostly apparent in a dry-run, which now only does *one* HTTP call for the entire run. --- common/Scripts/publish_series.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/Scripts/publish_series.py b/common/Scripts/publish_series.py index bf0ec6dc6a35..3f48b11cd2ae 100755 --- a/common/Scripts/publish_series.py +++ b/common/Scripts/publish_series.py @@ -79,6 +79,7 @@ def __init__(self, base: Optional[str], head: str, path: str, title: str, self.render = render self.wait = wait self.git = Git(path) + self.builds = Builds().all def run(self) -> bool: commits = self.git.commit_refs(self.base, self.head) @@ -171,7 +172,7 @@ def _git_push(self) -> None: def _push_build(self, build: Build) -> int: print(f'Pushing build: {build}') if self.noop: - return Builds().all[-1].id + return self.builds[-1].id output = self._run('ssh', 'build-controller@build.getsol.us', 'build', build.source, build.tag, build.path, build.ref, @@ -181,7 +182,7 @@ def _push_build(self, build: Build) -> int: def _build_exists(self, build: Build) -> Tuple[bool, int]: try: - found = next(b for b in Builds().all + found = next(b for b in self.builds if b.tag == build.tag and b.status != 'FAILED') return True, found.id except StopIteration: From f6a4a6784d5890f2044a566017798c9afed43e0a Mon Sep 17 00:00:00 2001 From: Silke Hofstra Date: Thu, 9 Apr 2026 20:31:01 +0200 Subject: [PATCH 2/2] common/Scripts/publish_series.py: Improve output **Summary** Improve the output of builds by showing the commit message instead of the raw python object. This turns lines like the following: ``` Pushing build: Build(source='python-setuptools', tag='python-setuptools-82.0.1-26', path='packages/py/python-setuptools', ref='d3562c463b73375afa3eca88a48fffd850b84086', comment='BUILD 1/11') ``` Into: ``` Pushing build: python-setuptools: Update to v82.0.1 (d3562c463b) ``` --- common/Scripts/publish_series.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/common/Scripts/publish_series.py b/common/Scripts/publish_series.py index 3f48b11cd2ae..b5606d33067c 100755 --- a/common/Scripts/publish_series.py +++ b/common/Scripts/publish_series.py @@ -104,7 +104,7 @@ def run(self) -> bool: self._render(commit) if self._skip_commit(commit): - print(f'Skipping commit: {self.git.commit_summary(commit)}') + print(f'Skipping commit: {self._commit_str(commit)}') continue comment = f'BUILD {i+1}/{len(commits)}' @@ -117,7 +117,7 @@ def run(self) -> bool: if not found: id = self._push_build(build) else: - print(f'Skipping build: {build}') + print(f'Skipping build: {self._commit_str(build.ref)}') if self.wait: self._wait_for_build(id) @@ -170,7 +170,7 @@ def _git_push(self) -> None: self.git.run('push') def _push_build(self, build: Build) -> int: - print(f'Pushing build: {build}') + print(f'Pushing build: {self._commit_str(build.ref)}') if self.noop: return self.builds[-1].id @@ -226,6 +226,9 @@ def _render(self, commit: str) -> None: f.close() self._run('xdg-open', f.name) + def _commit_str(self, ref: str) -> str: + return f'{self.git.commit_summary(ref)} ({ref[:10]})' + @staticmethod def _run(*args: str) -> str: res = subprocess.run(args, text=True, capture_output=True)