Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86F76C001DF for ; Wed, 16 Aug 2023 06:57:47 +0000 (UTC) Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by mx.groups.io with SMTP id smtpd.web11.155438.1692169061954844643 for ; Tue, 15 Aug 2023 23:57:42 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=Jl0bxapB; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.41, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-3fe32016bc8so56119635e9.1 for ; Tue, 15 Aug 2023 23:57:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1692169060; x=1692773860; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=2qA8zqTNW41l2fLQ4X1OObuRySFMvygVc3vsDkZeR9g=; b=Jl0bxapBYNwyws8rIuwhT4bUbtywmMr53i1FlxL8qoVo6G4I320755I1Gs/MhZ/6H8 eyMWiV8fyhmfiTr2fG9RGm9Rq7HyG4x44Q4L1DRtVjdI224EovyJEUhW5MBJbpVtu5hq F7Y0rRFH25fcnP4UtFBmvYFky+m6MBAYyERK4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692169060; x=1692773860; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=2qA8zqTNW41l2fLQ4X1OObuRySFMvygVc3vsDkZeR9g=; b=F8/8TnhLqTPCIEfaWZzGa1Se8q1xlUGs9/j9ga7TDn0DoQR2mX7xdzWpP2Ms0JodQs 34egRKMj2pmBGcEclRelDLuVPeua60nreKyEUhbuh5NO5fB/0cNT+ZjeZekHXN44MSFo +GXV7jGLnvI/e+BTa92TCCJpsU1tEnX6ri9LQ+TfORPK6f1hC+hNv8iyw9jQ/bcBn9Ee /qxtSL1IpsT+tg/S7aGx8angi3jUi9pLzeXMciSpIi4Gf9+PHeOeH0OgOmbYVwCH/kGy u6KUNDsUpQYgf00FPv4reDPS7FjVXPaYOeoxwt67sOd2p3942SChz0/sPCMVeI4D6Aor KCGw== X-Gm-Message-State: AOJu0YxL3yZfDAhDCmyZic5+O3ZLP6hByaX1L/dmgs9PuxJkO72WIuAm Qzf2+9SXfwhzZjRk/5uNCDfx1g== X-Google-Smtp-Source: AGHT+IEYFLVBfdG6oGDLgDMMBRpcfGk0s00EV3SMQdXNKZZej8soUomXByvANo4uSfDjLrS4PVBiLQ== X-Received: by 2002:a5d:400a:0:b0:314:415:cbf5 with SMTP id n10-20020a5d400a000000b003140415cbf5mr798475wrp.51.1692169059929; Tue, 15 Aug 2023 23:57:39 -0700 (PDT) Received: from ?IPv6:2001:8b0:aba:5f3c:b782:7711:f696:663e? ([2001:8b0:aba:5f3c:b782:7711:f696:663e]) by smtp.gmail.com with ESMTPSA id r13-20020a0560001b8d00b003143c6e09ccsm20047430wru.16.2023.08.15.23.57.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Aug 2023 23:57:39 -0700 (PDT) Message-ID: Subject: Re: [OE-Core][PATCH 2/2] oeqa/utils/gitarchive: fix tag computation when creating archive From: Richard Purdie To: Alexis =?ISO-8859-1?Q?Lothor=E9?= , Openembedded-core@lists.openembedded.org Cc: Thomas Petazzoni , Alexandre Belloni Date: Wed, 16 Aug 2023 07:57:38 +0100 In-Reply-To: References: <20230811125532.9427-1-alexis.lothore@bootlin.com> <20230811125532.9427-3-alexis.lothore@bootlin.com> <16b82ce9979d4a09ad3dc42ebef2cbb85c1729c3.camel@linuxfoundation.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.1-0ubuntu1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 16 Aug 2023 06:57:47 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/186116 On Wed, 2023-08-16 at 08:36 +0200, Alexis Lothor=C3=A9 wrote: > Hello Richard, >=20 > On 8/15/23 23:13, Richard Purdie wrote: > > On Fri, 2023-08-11 at 14:55 +0200, Alexis Lothor=C3=A9 via > > lists.openembedded.org wrote: > > > From: Alexis Lothor=C3=A9 > > >=20 > > > Sporadic errors have been observed in autobuilder when trying to stor= e new > > > tests results: > > >=20 > > > error: failed to push some refs to 'push.yoctoproject.org:yocto-testr= esults' > > > hint: Updates were rejected because the tag already exists in the rem= ote. > > >=20 > > > The new tag name is generated by gitarchive based on known tags from = the > > > repository (learnt with git tag). In autobuilder case, this repositor= y is a > > > shallow clone, so git tag only returns most recent tags, which mean w= e > > > could miss some older tags which exist in remote but not locally. In = this > > > case, gitarchive will likely create a tag which already exists in rem= ote, > > > and so will fail to push > > >=20 > > > Fix this tag duplication by using git ls-remote to learn about existi= ng > > > tags instead of git tag. Two places which wrongly read only local tag= s has > > > been identified in gitarchive: expand_tag_strings and get_test_runs > > >=20 > > > Fixes [YOCTO #15140] > > >=20 > > > Signed-off-by: Alexis Lothor=C3=A9 > > > --- > > > meta/lib/oeqa/utils/gitarchive.py | 6 ++++-- > > > 1 file changed, 4 insertions(+), 2 deletions(-) > > >=20 > > > diff --git a/meta/lib/oeqa/utils/gitarchive.py b/meta/lib/oeqa/utils/= gitarchive.py > > > index 6e8040eb5c96..73beafecb5fb 100644 > > > --- a/meta/lib/oeqa/utils/gitarchive.py > > > +++ b/meta/lib/oeqa/utils/gitarchive.py > > > @@ -116,7 +116,8 @@ def expand_tag_strings(repo, name_pattern, msg_su= bj_pattern, msg_body_pattern, > > > tag_re =3D tag_re.format(tag_number=3D'(?P[0-9]{= 1,5})') > > > =20 > > > keyws['tag_number'] =3D 0 > > > - for existing_tag in repo.run_cmd('tag').splitlines(): > > > + tags_refs =3D repo.run_cmd(['ls-remote', '--refs', '--tags',= '-q']) > > > + for existing_tag in ["".join(d.split()[1].split('/', 2)[2:])= for d in tags_refs.splitlines()]: > > > match =3D re.match(tag_re, existing_tag) > > > =20 > > > if match and int(match.group('tag_number')) >=3D keyws['= tag_number']: > > > @@ -181,7 +182,8 @@ def get_test_runs(log, repo, tag_name, **kwargs): > > > =20 > > > # Get a list of all matching tags > > > tag_pattern =3D tag_name.format(**str_fields) > > > - tags =3D repo.run_cmd(['tag', '-l', tag_pattern]).splitlines() > > > + revs =3D repo.run_cmd(['ls-remote', '--refs', '--tags', 'origin'= , '-q', tag_pattern]).splitlines() > > > + tags =3D ["".join(d.split()[1].split('/', 2)[2:]) for d in revs] > > > log.debug("Found %d tags matching pattern '%s'", len(tags), tag_= pattern) > > > =20 > > > # Parse undefined fields from tag names > >=20 > >=20 > > I'm worrying a little that this change which recently merged might have > > resulted in: > >=20 > > https://autobuilder.yoctoproject.org/typhoon/#/builders/133/builds/2099 >=20 > I may have taken the wrong assumption that directories manipulated with > gitarchive would always have at least one valid remote configured, but th= is log > tends to prove me wrong :/ > Since the patch aimed to fix a sporadic issue but now leads to another > systematic issue, please feel free to revert it while I ensure about the > scenario and find a proper fix Thanks, I was wondering why one performance worker was affected and the other was not. I guess one has the remote, maybe from when we've tried to fix something and the other doesn't. I've reverted for now until we get to the bottom of it as the stream of failures would be a pain. Cheers, Richard