From cdaa86d78b24fe8be4be476822f5b16352c1dff4 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Mon, 10 Jun 2024 08:00:52 -0700 Subject: [PATCH] Stop logging refs set We currently emit a debug log line for each ref that we set when preparing a repo for a job. This might be an enormous number of very boring log lines for large repos. Since we now store this information in a file accessible to the job (which can be saved with the job logs), this information is now accessible for debug purposes that way. Instead, just log how many refs we intend to set (so that if there are a lot, we know what the executor/merger is doing) and log any missing objects. Change-Id: Iebc52cbc4aa4fb778b371f90343e53ece6fa3699 --- zuul/merger/merger.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/zuul/merger/merger.py b/zuul/merger/merger.py index fb5d8b3091..6cb4e37eae 100644 --- a/zuul/merger/merger.py +++ b/zuul/merger/merger.py @@ -556,6 +556,11 @@ class Repo(object): with open(refs_path, 'wb') as f: f.write(b'# pack-refs with: peeled fully-peeled sorted \n') sorted_paths = sorted(refs.keys()) + msg = f"Setting {len(sorted_paths)} refs in {repo.git_dir}" + if log: + log.debug(msg) + else: + messages.append(msg) for path in sorted_paths: hexsha = refs[path] try: @@ -564,7 +569,6 @@ class Repo(object): binsha = gitdb.util.to_bin_sha(hexsha) oinfo = repo.odb.info(binsha) f.write(f'{hexsha} {path}\n'.encode(encoding)) - msg = f"Set reference {path} at {hexsha} in {repo.git_dir}" if oinfo.type == b'tag': # We are an annotated or signed tag which # refers to another commit. We must handle this @@ -572,11 +576,6 @@ class Repo(object): tagobj = git.Object.new_from_sha(repo, binsha) tagsha = tagobj.object.hexsha f.write(f'^{tagsha}\n'.encode(encoding)) - msg += f" with tag target {tagsha}" - if log: - log.debug(msg) - else: - messages.append(msg) except ValueError: # If the object does not exist, skip setting it. msg = (