| Summary: | AB-INT: yocto-testresults tagging failure, tag already exists | ||
|---|---|---|---|
| Product: | [Infrastructure] AutoBuilder | Reporter: | Alexandre Belloni <alexandre.belloni> |
| Component: | autobuilder | Assignee: | Alexis Lothoré <alexis.lothore> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | Medium+ | CC: | alexandre.belloni, infras.ab.watcher, Infras.watcher, pidge, randy.macleod, tgamblin |
| Version: | unspecified | ||
| Target Milestone: | 4.3 M4 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | AB-INT | ||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | No (bug/feature does not impact docs) | |
|
Description
Alexandre Belloni
2023-06-08 21:10:06 UTC
I think I _theoretically_ found out what happens here.
Diving into tag generation code in resulttool, I observe that the tag number (the "tag_number}" in "{branch}/{commit_count}-g{commit}/{tag_number}" is always computed based on existing tags. This tag number is here to allow to store multiple test results regarding a single poky revision. I eventually reach a "git tag" command to list existing tags. Passed repository is the test results repository cloned by send-qa-email.
The twist is that this clone is in fact a shallow clone, so only recent tags are known. Since recently, my guess is that we had "luck" because if two builds targeting the same poky revision happened, they were timely close enough so the shallow clone was still aware of previous tags on the same poky revision, and tag number was incremented then pushed correctly.
BUT: one of my recent development (2c0d9e19771a4fc8365a40d553b4be19c491785f in yocto-autobuilder-helper) made the clone even more shallow (depth=1). So whenever a build targets a revision which has already been tested, but other tests have been pushed since then, send-qa-email fails to detect the existing tag, so it uses 0 (as first tag number since it thinks it is running tests on this specific version for the first time), creates a tag that does not exist locally but exists remotely, and fails to push.
The proper fix should be to use git ls-remote instead of git tag to make sure to get all remote tags. Quickly checking gitarchive.py (which is called to generate the tag), I see only two places that need the fix. I will come up with something and send a patch
I guess you are right, I got this today:
2023-08-10 22:28:27,720 - oe-selftest - INFO - ... FAIL
Stderr:
2023-08-10 21:02:03,493 - oe-selftest - INFO - Adding: "include selftest.inc" in /home/pokybuild/yocto-worker/oe-selftest-centos/build/build-st-3253880/conf/local.conf
2023-08-10 21:02:03,493 - oe-selftest - INFO - Adding: "include bblayers.inc" in bblayers.conf
INFO: Shallow-cloning testresults in /tmp/yocto-testresults-query.pj8tcxbc
Cloning into '/tmp/yocto-testresults-query.pj8tcxbc'...
fatal: ambiguous argument 'yocto-4.0': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
ERROR: Can not find SHA-1 for yocto-4.0 in /home/pokybuild/yocto-worker/oe-selftest-centos/build
2023-08-10 22:28:27,721 - oe-selftest - INFO - 4: 45/46 388/533 (0.18s) (0 failed) (yoctotestresultsquerytests.TestResultsQueryTests.test_get_sha1)
2023-08-10 22:28:27,721 - oe-selftest - INFO - testtools.testresult.real._StringException: Traceback (most recent call last):
File "/home/pokybuild/yocto-worker/oe-selftest-centos/build/meta/lib/oeqa/selftest/cases/yoctotestresultsquerytests.py", line 27, in test_get_sha1
self.assertEqual(
File "/usr/lib64/python3.9/unittest/case.py", line 837, in assertEqual
assertion_func(first, second, msg=msg)
File "/usr/lib64/python3.9/unittest/case.py", line 830, in _baseAssertEqual
raise self.failureException(msg)
AssertionError: None != '00cfdde791a0176c134f31e5a09eff725e75b905'
Stderr:
2023-08-10 21:02:03,493 - oe-selftest - INFO - Adding: "include selftest.inc" in /home/pokybuild/yocto-worker/oe-selftest-centos/build/build-st-3253880/conf/local.conf
2023-08-10 21:02:03,493 - oe-selftest - INFO - Adding: "include bblayers.inc" in bblayers.conf
INFO: Shallow-cloning testresults in /tmp/yocto-testresults-query.pj8tcxbc
Cloning into '/tmp/yocto-testresults-query.pj8tcxbc'...
fatal: ambiguous argument 'yocto-4.0': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
ERROR: Can not find SHA-1 for yocto-4.0 in /home/pokybuild/yocto-worker/oe-selftest-centos/build
Moved to M4. |