Commit graph

9 commits

Author SHA1 Message Date
Miro Hrončok
400c6ecf47 post-receive-fedora-messaging: Don't attempt to decode unicode strings
On Python 3, we can only decode byte sequences.

subprocess.Popen(universal_newlines=True) always returns unicode stdout/sderr.

Fixes https://pagure.io/fedora-infrastructure/issue/9366

Signed-off-by: Miro Hrončok <miro@hroncok.cz>
2020-10-03 22:48:10 +02:00
Pierre-Yves Chibon
3a7fa049d9 batcave: Fix the two git hooks run in the ansible git repo in the batcave
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2020-09-10 21:33:27 +02:00
Pierre-Yves Chibon
a65d4589d0 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 <pingou@pingoured.fr>
2020-08-20 10:33:47 +02:00
Pierre-Yves Chibon
dc92c9d924 git/hooks: fix typo isinstance != instance
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2020-06-12 14:15:54 +02:00
Pierre-Yves Chibon
b631c49d08 git/hook: apparently the rev can be either a string or the pygit2.Oid object
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2020-06-11 21:39:32 +02:00
Pierre-Yves Chibon
18a674d74d git/hook: parse the revision/hash rather than the Oid object
Fixes https://pagure.io/fedora-infrastructure/issue/9016

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2020-06-11 21:13:44 +02:00
Pierre-Yves Chibon
6e82268613 git/hooks: Start making the hooks crash less on rhel8/python3
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2020-06-06 21:17:05 +02:00
Pierre-Yves Chibon
7acddaeca5 git/hooks: adjusts the post-receive hooks so it loads the correct fedora-messaging config
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2020-05-20 11:23:28 +02:00
Pierre-Yves Chibon
7ee8003ba9 git/hooks: port from fedmsg to fedora-messaging
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2020-05-20 11:13:37 +02:00