[Patchew-devel] skip_ci and github

Davide Caratti posted 1 patch 1 month, 3 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/patchew-ci tags/patchew/YaZfpTFl5vkuBavq@dcaratti.users.ipa.redhat.com

[Patchew-devel] skip_ci and github

Posted by Davide Caratti 1 month, 3 weeks ago
hello,

Matthieu observed that the MPTCP importer is force-pushing a new tag each
time a reply is sent to a patch. This is because github does not support
push options (unlike gitlab), so 'skip_ci' is ignored.

we tested this workaround:

-- >8 --
diff --git a/patchew-cli b/patchew-cli
index 9472554..4a7adb9 100755
--- a/patchew-cli
+++ b/patchew-cli
@@ -977,7 +977,7 @@ class ApplyCommand(SubCommand):
             print("No series need apply")
             return 3
         logf = tempfile.NamedTemporaryFile(mode="w+", encoding="utf-8")
-        push_repo = toapply.get("git.push_to")
+        push_repo = None if 'ci.skip' in str(toapply.get('git.push_options')) else toapply.get("git.push_to")
         public_repo = toapply.get("git.public_repo")
         wd = tempfile.mkdtemp(dir="/var/tmp")
         try:
-- >8 --

do you know of any patchew user that has github and solved this differently?
thank you in advance!
-- 
davide

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

Re: [Patchew-devel] skip_ci and github

Posted by Paolo Bonzini 1 month, 3 weeks ago
On 11/30/21 18:30, Davide Caratti wrote:
> hello,
> 
> Matthieu observed that the MPTCP importer is force-pushing a new tag each
> time a reply is sent to a patch. This is because github does not support
> push options (unlike gitlab), so 'skip_ci' is ignored.

The best fix IMO would be to switch to gitlab. :)

The problem with the workaround is that the tags in the repository would 
not collect the Reviewed-by/Tested-by/etc. from the mailing list.  But 
if it's good for you, you can apply it locally to your importer.

Paolo

> we tested this workaround:
> 
> -- >8 --
> diff --git a/patchew-cli b/patchew-cli
> index 9472554..4a7adb9 100755
> --- a/patchew-cli
> +++ b/patchew-cli
> @@ -977,7 +977,7 @@ class ApplyCommand(SubCommand):
>               print("No series need apply")
>               return 3
>           logf = tempfile.NamedTemporaryFile(mode="w+", encoding="utf-8")
> -        push_repo = toapply.get("git.push_to")
> +        push_repo = None if 'ci.skip' in str(toapply.get('git.push_options')) else toapply.get("git.push_to")
>           public_repo = toapply.get("git.public_repo")
>           wd = tempfile.mkdtemp(dir="/var/tmp")
>           try:
> -- >8 --
> 
> do you know of any patchew user that has github and solved this differently?
> thank you in advance!
> 

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