Commit graph

81 commits

Author SHA1 Message Date
Kevin Fenzi
8feca5885b Revert "Reapply "Don't send a fedora-messaging message from the Pagure git hook""
This reverts commit 26358b62a2.

So, this broke the toddler that handles package retirements. ;(

It seems it was commited on feb 20th, but not actually pushed out until
March 4th. At that point, retirements stop. ;(

I think it's getting the new git pagure messages, but they don't
contain the information it expects so it just drops them.

We will need to adjust toddlers before we can re-drop this.
2024-04-01 11:19:00 -07:00
Aurélien Bompard
26358b62a2
Reapply "Don't send a fedora-messaging message from the Pagure git hook"
This reverts commit 7667b0e97e.

The packit folks have migrated to the Pagure-native message:
https://github.com/packit/packit-service/issues/2305
2024-02-20 12:14:44 +01:00
Aurélien Bompard
7667b0e97e
Revert "Don't send a fedora-messaging message from the Pagure git hook"
This reverts commit 4bfc46ce37.

The Packit folks are lisening to the git messages, they will migrate to
the pagure messages but ask us to re-enable them while they do the
migration.
2024-01-15 15:10:46 +01:00
Aurélien Bompard
4bfc46ce37
Don't send a fedora-messaging message from the Pagure git hook
Pagure already sends a message on commit, this causes a duplication.

Related to: https://pagure.io/fedora-infrastructure/issue/11687#comment-890826

Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
2024-01-11 11:35:39 +01:00
Aurélien Bompard
64da337e67
Use fedora-messaging-git-hook on dist-git
Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
2023-12-04 17:58:49 +01:00
Pierre-Yves Chibon
bd6180dcd0 git/hooks: decode the output of the subprocess
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2021-01-25 10:54:51 +01:00
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
155094f884 git/hooks: Update the gnome-post-receive-email hook to use the git-multimail gook instead
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2020-10-02 18:39:08 +00: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
de0b5d6abe git/hooks: point the post-receive-chained-forks file to the proper git hook from pagure
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2020-06-10 00:15:18 +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
Pierre-Yves Chibon
ef61cb0d11 Do not seng git.receive fedmsg message upon changes to the requests git repo
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2018-12-13 14:50:43 +01:00
Pierre-Yves Chibon
85bd191653 Update post-receive-chained to use the new post-receive hook from pagure
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2018-11-21 11:46:49 +01:00
Patrick Uiterwijk
03136b922b And use the new getlogin()
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
2018-08-02 17:04:01 +00:00
Patrick Uiterwijk
7148f95bf8 With https pushing, we need to use the USER env var
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
2018-08-02 17:03:15 +00:00
Patrick Uiterwijk
e592912070 Actually, Todd was right and the failed text was invalid. Let's ignore
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
2018-07-19 00:00:59 +02:00
Patrick Uiterwijk
84141c0895 Pretty sure we want to encode
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
2018-07-18 23:44:21 +02:00
Todd Zullinger
c45689142e git/hooks: remove fedmsg_hook from post-receive-chained-forks
The fedmsg_hook no longer exists.  It was removed from the non-fork
post-receive-chained hook in 9875b043d ("Drop the fedmsg_hook since it
no longer exists", 2018-05-03).

Fixes the following warning when pushing to a fork:

    remote: sh: /usr/lib/python2.7/site-packages/pagure/hooks/files/fedmsg_hook.py: No such file or directory

Signed-off-by: Todd Zullinger <tmz@pobox.com>
2018-05-25 11:39:24 -04:00
Pierre-Yves Chibon
9875b043d3 Drop the fedmsg_hook since it no longer exists
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2018-05-03 12:07:40 +02:00
Pierre-Yves Chibon
3b1e225f73 Add missing get_default_branch 2018-05-03 10:40:13 +02:00
Kevin Fenzi
9bd9110781 Re-enable fedmsg hooks now that there is a acl allowing access to key 2018-04-19 16:42:36 +00:00
Pierre-Yves Chibon
dc86b22f90 Turn off the pagure fedmsg hook for now
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2018-04-17 17:39:48 +02:00
Pierre-Yves Chibon
da5d18632b Turn on the pagure fedmsg hook on all projects and forks
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2018-04-17 14:02:00 +02:00
Pierre-Yves Chibon
a09604d9b2 Add a custom post-receive-chained hook for forks
This hook doesn't send fedmsg messages on the git.receive topic
and does not notify the alternative arch folks about changes

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2018-04-17 12:14:07 +02:00
Todd Zullinger
4a3ef1013c git/hooks: only use first line as project description
Hi all,

This is something I've seen for ages and thought should be fixed (either by
this patch and/or another which supports multi-line description files
properly).

I have an alternate version of this patch which side-steps the issue by adding
the X-Project header last, so if it's multiple lines it won't screw up other
headers.  I think this is the proper fix though.

If multi-line description files are really something which are desired, then a
commit on top of this change could add support for reading the remaining lines
from the description file and add them to the message body.

 roles/git/hooks/files/git.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
2018-02-22 21:58:11 +00:00
Todd Zullinger
476ca97e74 git (post-receive-alternativearch): use unicode for git output
The commit message and diff is stored in `full_change` as a string, via
`read_output()`.  This is passed to `TEXT` which is a unicode string.

When a commit message or diff contains non-ascii characters we get:

    UnicodeDecodeError: 'ascii' codec can't decode byte ...

Encode git output returned from `read_output()` as a unicode string and
define `full_change` as unicode for completeness.

Fixes #6040.
2018-01-19 16:40:08 +01:00
Kevin Fenzi
f93a639600 Revert "revert the hook for now until the initial manifest is ready"
This reverts commit 8a6848385e.
2017-10-16 17:05:56 +00:00
Kevin Fenzi
8a6848385e revert the hook for now until the initial manifest is ready 2017-10-14 21:37:10 +00:00
Kevin Fenzi
3f74ce3fad grokmirror for pkgs/src 2017-10-14 20:36:18 +00:00
Pierre-Yves Chibon
59fe50e3f1 Add support for the hooks setup by pagure itself on dist-git
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2017-10-06 09:55:47 +02:00
Pierre-Yves Chibon
2daeb3224b Add pagure's hook to the post-receive hook and point to the main hooks 2017-10-06 08:52:06 +02:00
Dan Horák
333a155ba9 post-receive-alternativearch - catch removals too
Currently the patterns can catch ExcludeArch & co additions and changes
in the spec file, but not a clean removal.
2017-07-25 10:57:44 +02:00
Pierre-Yves Chibon
dff13eade9 And one more typo to fix... 2017-05-02 13:38:40 +02:00
Pierre-Yves Chibon
70b6f99698 Missing .delta. 2017-05-02 13:37:18 +02:00
Pierre-Yves Chibon
45375683fa Port the fedmsg git hooks to newer pygit2
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2017-05-02 13:31:13 +02:00
Pierre-Yves Chibon
82fb1996dd Move to src.fp.o which is https 2017-04-18 14:29:30 +02:00
Pierre-Yves Chibon
4b45f4620c Make the email sent a little prettier 2017-04-18 14:24:39 +02:00
Pierre-Yves Chibon
dc5394c189 Looks like all we need is a new line 2017-04-18 14:22:38 +02:00
Pierre-Yves Chibon
678e30e837 When sending alternative arch excluding emails, include the full change
Fixes https://pagure.io/fedora-infrastructure/issue/5923
2017-04-18 14:09:28 +02:00
Pierre-Yves Chibon
737f6c5b38 Escape the %ifarch and %ifnarch otherwise python is unhappy 2017-01-16 22:14:45 +01:00
Pierre-Yves Chibon
29a58c2460 Improve the subject of the email sent upon commit 2017-01-16 10:29:15 +01:00
Pierre-Yves Chibon
083901a312 Fix detecting %ifarch/%ifnarch upon commit and improve the email content 2017-01-16 10:24:30 +01:00
Pierre-Yves Chibon
7f0f327c3d Fix the ExcludeArch pattern and add two more 2017-01-13 11:58:05 +01:00
Pierre-Yves Chibon
a6fdbaeff6 Send all the notifications about package excluding some arch to the arch-excludes list 2017-01-10 16:33:15 +01:00