[yocto-autobuilder-helper,2/2] scripts/send-qa-email: fix bug in git push logic for yocto-testresults

Submitted by Steve Sakoman on April 23, 2020, 12:43 a.m. | Patch ID: 172114

Details

Message ID 20200423004344.29216-2-steve@sakoman.com
State New
Headers show

Commit Message

Steve Sakoman April 23, 2020, 12:43 a.m.
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(-)

Patch hide | download patch | download mbox

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)
 

Comments

Richard Purdie April 23, 2020, 1:44 p.m.
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
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#49224): https://lists.yoctoproject.org/g/yocto/message/49224
Mute This Topic: https://lists.yoctoproject.org/mt/73210216/3617530
Group Owner: yocto+owner@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub  [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-