[Patchew-devel] [PATCH] tags: new event SeriesReviewed

Paolo Bonzini posted 1 patch 4 years, 6 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/patchew next tags/patchew/20191007082750.25088-1-pbonzini@redhat.com
mods/tags.py | 4 ++++
1 file changed, 4 insertions(+)
[Patchew-devel] [PATCH] tags: new event SeriesReviewed
Posted by Paolo Bonzini 4 years, 6 months ago
This can be useful to send an email about series that have gotten
external reviews.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 mods/tags.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/mods/tags.py b/mods/tags.py
index 0541849..59a367e 100644
--- a/mods/tags.py
+++ b/mods/tags.py
@@ -52,6 +52,7 @@ series cover letter, patch mail body and their replies.
     def __init__(self):
         register_handler("MessageAdded", self.on_message_added)
         declare_event("TagsUpdate", series="message object that is updated")
+        declare_event("SeriesReviewed", series="message object that got Reviewed-by tags for all patches")
 
         # XXX: get this list through module config?
 
@@ -114,9 +115,12 @@ series cover letter, patch mail body and their replies.
         series_reviewers = _find_reviewers(series)
         reviewers = reviewers.union(series_reviewers)
         if num_reviewed == series.get_num()[1] or series_reviewers:
+            need_event = not series.is_reviewed
             series.is_reviewed = True
             series.save()
             series.set_property("reviewers", list(reviewers))
+            if need_event:
+                emit_event("SeriesReviewed", series=series)
         if updated:
             emit_event("TagsUpdate", series=series)
 
-- 
2.21.0

_______________________________________________
Patchew-devel mailing list
Patchew-devel@redhat.com
https://www.redhat.com/mailman/listinfo/patchew-devel
Re: [Patchew-devel] [PATCH] tags: new event SeriesReviewed
Posted by Philippe Mathieu-Daudé 4 years, 6 months ago
On 10/7/19 10:27 AM, Paolo Bonzini wrote:
> This can be useful to send an email about series that have gotten
> external reviews.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>   mods/tags.py | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/mods/tags.py b/mods/tags.py
> index 0541849..59a367e 100644
> --- a/mods/tags.py
> +++ b/mods/tags.py
> @@ -52,6 +52,7 @@ series cover letter, patch mail body and their replies.
>       def __init__(self):
>           register_handler("MessageAdded", self.on_message_added)
>           declare_event("TagsUpdate", series="message object that is updated")
> +        declare_event("SeriesReviewed", series="message object that got Reviewed-by tags for all patches")

Excellent!

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

>   
>           # XXX: get this list through module config?
>   
> @@ -114,9 +115,12 @@ series cover letter, patch mail body and their replies.
>           series_reviewers = _find_reviewers(series)
>           reviewers = reviewers.union(series_reviewers)
>           if num_reviewed == series.get_num()[1] or series_reviewers:
> +            need_event = not series.is_reviewed
>               series.is_reviewed = True
>               series.save()
>               series.set_property("reviewers", list(reviewers))
> +            if need_event:
> +                emit_event("SeriesReviewed", series=series)
>           if updated:
>               emit_event("TagsUpdate", series=series)
>   
> 

_______________________________________________
Patchew-devel mailing list
Patchew-devel@redhat.com
https://www.redhat.com/mailman/listinfo/patchew-devel