[patchew-devel] [PATCH v4 1/3] git: Improve info if git URL/repo/tag field missing

Fam Zheng posted 3 patches 6 years, 6 months ago
[patchew-devel] [PATCH v4 1/3] git: Improve info if git URL/repo/tag field missing
Posted by Fam Zheng 6 years, 6 months ago
Signed-off-by: Fam Zheng <famz@redhat.com>
---
 mods/git.py | 35 +++++++++++++++++++++++++----------
 1 file changed, 25 insertions(+), 10 deletions(-)

diff --git a/mods/git.py b/mods/git.py
index 2be8904..610aab5 100644
--- a/mods/git.py
+++ b/mods/git.py
@@ -155,17 +155,32 @@ class GitModule(PatchewModule):
                 git_url = message.get_property("git.url")
                 git_repo = message.get_property("git.repo")
                 git_tag = message.get_property("git.tag")
-                message.status_tags.append({
-                    "url": git_url,
-                    "title": format_html("Applied as tag {} in repo {}", git_tag, git_repo),
-                    "type": "info",
-                    "char": "G",
+                if git_url:
+                    message.status_tags.append({
+                        "url": git_url,
+                        "title": format_html("Applied as tag {} in repo {}", git_tag, git_repo),
+                        "type": "info",
+                        "char": "G",
+                        })
+                    if git_repo and git_tag:
+                        message.extra_status.append({
+                            "kind": "good",
+                            "html": format_html('Patches applied successfully (<a href="{}">tree</a>, {}).<br/><samp>git fetch {} {}</samp>',
+                                                git_url, colorbox_a, git_repo, git_tag),
+                        })
+                else:
+                    message.status_tags.append({
+                        "title": format_html("Patches applied succeeded"),
+                        "type": "info",
+                        "char": "G",
+                        })
+                    message.extra_status.append({
+                        "kind": "good",
+                        "html": format_html('Patches applied successfully ({})',
+                                            colorbox_a),
+                        "extra": colorbox_div,
+                        "id": "gitlog"
                     })
-                message.extra_status.append({
-                    "kind": "good",
-                    "html": format_html('Patches applied successfully (<a href="{}">tree</a>, {}).<br/><samp>git fetch {} {}</samp>',
-                                        git_url, colorbox_a, git_repo, git_tag),
-                })
         if request.user.is_authenticated:
             if message.get_property("git.apply-failed") != None or \
                  message.get_property("git.need-apply") == None:
-- 
2.14.3


[patchew-devel] Re: [PATCH v4 1/3] git: Improve info if git URL/repo/tag field missing
Posted by Paolo Bonzini 6 years, 6 months ago
On 23/02/2018 07:59, Fam Zheng wrote:
> +                            "html": format_html('Patches applied successfully (<a href="{}">tree</a>, {}).<br/><samp>git fetch {} {}</samp>',
> +                                                git_url, colorbox_a, git_repo, git_tag),
> +                        })
> +                else:
> +                    message.status_tags.append({
> +                        "title": format_html("Patches applied succeeded"),

This would be "successfully".  Ok with that change.

I understand the point about dogfooding, but I'm not entirely sure about
using the mailing list for Patchew development.  In particular, it would
lose the CI aspect of GitHub until we set up a tester for Patchew
itself.  And using the competition gives us hints on how to do better. ;)

Paolo

[patchew-devel] Re: [PATCH v4 1/3] git: Improve info if git URL/repo/tag field missing
Posted by Fam Zheng 6 years, 6 months ago
On Fri, Feb 23, 2018 at 7:32 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> I understand the point about dogfooding, but I'm not entirely sure about
> using the mailing list for Patchew development.  In particular, it would
> lose the CI aspect of GitHub until we set up a tester for Patchew
> itself.  And using the competition gives us hints on how to do better. ;)

Adding Patchew to the testers in patchew.org would be very easy as
soon as we get some Libvirt tests enabled there, which is the next
step.

What I'm very uncomfortable with on Github is the difficulties to do
incremental reviews, and out of order display of commits in PR. We
cannot live without using Github more or less anyway, so why
embarrassingly force ourselves using it for something like Patchew. :)

Fam