From: Alexis Lothoré <alexis.loth...@bootlin.com>

Whenever we ask gitarchive to retrieve test results for specific revisions,
we first do a "large" search in get_tags, which uses glob patterns with git
ls-remote, and then we filter received tags with a regex to parse the tags
fields.
Currently gitarchive assumes that all tags returned by get_tags will match
the regex. This assumption is wrong (for example searching "master-next" in
get_tags may return some tags like "abelloni/master-next), and leads then
to exception when we try to retrieve tags fields:
Traceback (most recent call last):
  File "/home/pokybuild/yocto-worker/a-full/build/scripts/resulttool", line 78, 
in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/pokybuild/yocto-worker/a-full/build/scripts/resulttool", line 72, 
in main
    ret = args.func(args, logger)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File 
"/home/pokybuild/yocto-worker/a-full/build/scripts/lib/resulttool/regression.py",
 line 315, in regression_git
    revs2 = gitarchive.get_test_revs(logger, repo, tag_name, 
branch=args.branch2)
            
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File 
"/home/pokybuild/yocto-worker/a-full/build/meta/lib/oeqa/utils/gitarchive.py", 
line 246, in get_test_revs
    fields, runs = get_test_runs(log, repo, tag_name, **kwargs)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File 
"/home/pokybuild/yocto-worker/a-full/build/meta/lib/oeqa/utils/gitarchive.py", 
line 238, in get_test_runs
    groups = m.groupdict()

Fix this exception by merely skipping those additionals tags which won't
match the regex

Signed-off-by: Alexis Lothoré <alexis.loth...@bootlin.com>
---
 meta/lib/oeqa/utils/gitarchive.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/lib/oeqa/utils/gitarchive.py 
b/meta/lib/oeqa/utils/gitarchive.py
index 2fe48cdcac7f..10cb267dfa92 100644
--- a/meta/lib/oeqa/utils/gitarchive.py
+++ b/meta/lib/oeqa/utils/gitarchive.py
@@ -235,6 +235,8 @@ def get_test_runs(log, repo, tag_name, **kwargs):
     revs = []
     for tag in tags:
         m = tag_re.match(tag)
+        if not m:
+            continue
         groups = m.groupdict()
         revs.append([groups[f] for f in undef_fields] + [tag])
 
-- 
2.42.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#188878): 
https://lists.openembedded.org/g/openembedded-core/message/188878
Mute This Topic: https://lists.openembedded.org/mt/101871468/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to