All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH yocto-autobuilder-helper 1/2] scripts/utils.py: Fix confusing naming of getcomparisonbranch() return value
@ 2020-04-23  0:43 Steve Sakoman
  2020-04-23  0:43 ` [PATCH yocto-autobuilder-helper 2/2] scripts/send-qa-email: fix bug in git push logic for yocto-testresults Steve Sakoman
  0 siblings, 1 reply; 3+ messages in thread
From: Steve Sakoman @ 2020-04-23  0:43 UTC (permalink / raw)
  To: yocto; +Cc: Steve Sakoman

Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
 scripts/utils.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/utils.py b/scripts/utils.py
index 68652d9..25eba31 100644
--- a/scripts/utils.py
+++ b/scripts/utils.py
@@ -358,9 +358,9 @@ def getcomparisonbranch(ourconfig, reponame, branchname):
     if (reponame + ":" + branchname) in getconfig("BUILD_HISTORY_FORKPUSH", ourconfig):
         base = getconfig("BUILD_HISTORY_FORKPUSH", ourconfig)[reponame + ":" + branchname]
         if base:
-            baserepo, basebranch = base.split(":")
-            print("Comparing to %s\n" % (basebranch))
-            return branchname, basebranch
+            baserepo, comparebranch = base.split(":")
+            print("Comparing to %s\n" % (comparebranch))
+            return branchname, comparebranch
     if (reponame + ":" + branchname) in getconfig("BUILD_HISTORY_DIRECTPUSH", ourconfig):
         return branchname, None
     return None, None
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH yocto-autobuilder-helper 2/2] scripts/send-qa-email: fix bug in git push logic for yocto-testresults
  2020-04-23  0:43 [PATCH yocto-autobuilder-helper 1/2] scripts/utils.py: Fix confusing naming of getcomparisonbranch() return value Steve Sakoman
@ 2020-04-23  0:43 ` Steve Sakoman
  2020-04-23 13:44   ` [yocto] " Richard Purdie
  0 siblings, 1 reply; 3+ messages in thread
From: Steve Sakoman @ 2020-04-23  0:43 UTC (permalink / raw)
  To: yocto; +Cc: Steve Sakoman

We were mistakenly doing a force push if the branch was in either
BUILD_HISTORY_FORKPUSH or BUILD_HISTORY_DIRECTPUSH.

Now we force push for branches in BUILD_HISTORY_FORKPUSH, regular push
for branches in BUILD_HISTORY_DIRECTPUSH, and no push if the branch is
in neither list.

Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
 scripts/send-qa-email | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/send-qa-email b/scripts/send-qa-email
index 205f6d1..b4d4cec 100755
--- a/scripts/send-qa-email
+++ b/scripts/send-qa-email
@@ -80,10 +80,10 @@ if 'poky' in repos and os.path.exists(resulttool) and args.results_dir:
                 extraopts = None
 
         subprocess.check_call([resulttool, "store", args.results_dir, tempdir])
-        if basebranch:
+        if comparebranch:
             subprocess.check_call(["git", "push", "--all", "--force"], cwd=tempdir)
             subprocess.check_call(["git", "push", "--tags", "--force"], cwd=tempdir)
-        else:
+        elif basebranch:
             subprocess.check_call(["git", "push", "--all"], cwd=tempdir)
             subprocess.check_call(["git", "push", "--tags"], cwd=tempdir)
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [yocto] [PATCH yocto-autobuilder-helper 2/2] scripts/send-qa-email: fix bug in git push logic for yocto-testresults
  2020-04-23  0:43 ` [PATCH yocto-autobuilder-helper 2/2] scripts/send-qa-email: fix bug in git push logic for yocto-testresults Steve Sakoman
@ 2020-04-23 13:44   ` Richard Purdie
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Purdie @ 2020-04-23 13:44 UTC (permalink / raw)
  To: Steve Sakoman, yocto

On Wed, 2020-04-22 at 14:43 -1000, Steve Sakoman wrote:
> We were mistakenly doing a force push if the branch was in either
> BUILD_HISTORY_FORKPUSH or BUILD_HISTORY_DIRECTPUSH.
> 
> Now we force push for branches in BUILD_HISTORY_FORKPUSH, regular push
> for branches in BUILD_HISTORY_DIRECTPUSH, and no push if the branch is
> in neither list.
> 
> Signed-off-by: Steve Sakoman <steve@sakoman.com>
> ---
>  scripts/send-qa-email | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/send-qa-email b/scripts/send-qa-email
> index 205f6d1..b4d4cec 100755
> --- a/scripts/send-qa-email
> +++ b/scripts/send-qa-email
> @@ -80,10 +80,10 @@ if 'poky' in repos and os.path.exists(resulttool) and args.results_dir:
>                  extraopts = None
>  
>          subprocess.check_call([resulttool, "store", args.results_dir, tempdir])
> -        if basebranch:
> +        if comparebranch:
>              subprocess.check_call(["git", "push", "--all", "--force"], cwd=tempdir)
>              subprocess.check_call(["git", "push", "--tags", "--force"], cwd=tempdir)
> -        else:
> +        elif basebranch:
>              subprocess.check_call(["git", "push", "--all"], cwd=tempdir)
>              subprocess.check_call(["git", "push", "--tags"], cwd=tempdir)
>  

Thanks, well found!

I tweaked the first patch to use comparerepo instead of baserepo. The
confusion came from cut and paste from the buildhistory code.

Cheers,

Richard


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-23 13:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-23  0:43 [PATCH yocto-autobuilder-helper 1/2] scripts/utils.py: Fix confusing naming of getcomparisonbranch() return value Steve Sakoman
2020-04-23  0:43 ` [PATCH yocto-autobuilder-helper 2/2] scripts/send-qa-email: fix bug in git push logic for yocto-testresults Steve Sakoman
2020-04-23 13:44   ` [yocto] " Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.