From a65d4589d0330dac9d9040abcef4af1b1b6903e4 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Thu, 20 Aug 2020 10:26:56 +0200 Subject: [PATCH] git/hooks: ensures the revision sent to fedora-messaging are strings not oid objects The issue was triggered when multiple commits were pushed at once at which point the list of revisions contained a list of OID objects that are not JSON serializable but can be converted to text via str() or by accessing their .hex attribute. However, when a single commit is pushed, the list of revisions contains just the hash of the commit pushed and thus is already a string. So relying on .hex will not work then. Using str() becomes the solution that works for both scenarios. Fixes https://pagure.io/fedora-infrastructure/issue/9247 Signed-off-by: Pierre-Yves Chibon --- roles/git/hooks/files/post-receive-fedora-messaging | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/git/hooks/files/post-receive-fedora-messaging b/roles/git/hooks/files/post-receive-fedora-messaging index c1606e07de..060b06764e 100644 --- a/roles/git/hooks/files/post-receive-fedora-messaging +++ b/roles/git/hooks/files/post-receive-fedora-messaging @@ -142,7 +142,7 @@ for line in lines: files=files, total=total, ), - rev=rev, + rev=str(rev), path=abspath, repo=repo_name, namespace=namespace,