diff --git a/common/Scripts/publish_series.py b/common/Scripts/publish_series.py index bf0ec6dc6a35..b5606d33067c 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) @@ -103,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)}' @@ -116,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) @@ -169,9 +170,9 @@ 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 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: @@ -225,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)