Skip to contentSkip to conversation

ease send-qa-email usage with older history

PATCH Superseded Alexis Lothore 2 participants 7 messages Feb 7, 2023

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover ease send-qa-email usage with older history

Hello,
this minor patch series bring minor fixes into send-qa-email to ease development/debugging in it:
- fetching current build test results works well in CI builds because we are sure that the build results will be in the 5 upper commits of testsresults repository shallow clone (because it has been pushed just before preparing the regression report). It is not true when trying to run send-qa-email offline on older revisions (for development, debugging or improvement of scripting), so we need to force-fetch the target revision as it is done currently for the base revision. As a consequence, this new behaviour allows to make even more "shallow" clones of testresults since all needed data will be force-fetched
- When downloading a test regression report on official release webserver, we do not have information about what base have been used or what is the exact tested revision (at least, without checking the corresponding build logs on autobuilder). So I propose to add this information at the top of each regression report, making it look like this:

========================== Regression report ==============================

=> Target:      master          (5e249ec855517765f4b99e8039cb888ffa09c211)
=> Base:        4.2_M1          (4d19594b8bdacde6d809d3f2a25cff7c5a42295e)

===========================================================================

Match: oeselftest_almalinux-9.1_qemux86-64_20221208113119

       oeselftest_centos-8_qemux86-64_20230126230327
Match: oeselftest_debian-11_qemux86-64_20221208033325
       oeselftest_debian-11_qemux86-64_20230126150229

[...]

I assumed that no tool is currently trying to parse the regression reports, so I chose arbitrarily the metadata format.

@Richard : on a side note, the broken From field in my previous emails was probably due to an accent in my name, it should be fixed now. Please let me know if you still have issues with this, in this case I will force the --from field.

Alexis Lothore (3):
scripts/send-qa-email: force current revision fetch scripts/send-qa-email: reduce testresults shallow clone depth scripts/send-qa-email: add target and base revisions in regression
report

 scripts/send_qa_email.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
Signature · 1 line
2.39.1
#1 lore raw

PATCH 1/3 scripts/send-qa-email: force current revision fetch

If we try to run send-qa-email to simulate past releases (for example, for development or debugging), the execution will very likely fail because the target revision to examine (ie: the poky revision) is too old, and as a consequence is not contained in the testresults shallow clone anymore (because testsresults history keeps moving forward as builds are triggered on autobuilder). As a consequence, force-fetch the "target" revision, as it is already done for the "base" revision

---
 scripts/send_qa_email.py | 1 +
 1 file changed, 1 insertion(+)
scripts/send_qa_email.py +1 -0
index 199fe4e..f8ebe34 100755
@@ -75,6 +75,7 @@ def generate_regression_report(resulttool, targetrepodir, basebranch, resultdir,
         running resulttool
         """
         fetch_testresults(resultdir, baserevision)
+        fetch_testresults(resultdir, comparerevision)
         regreport = subprocess.check_output([resulttool, "regression-git", "-B", basebranch, "--commit", baserevision, "--commit2", comparerevision, resultdir])
         with open(outputdir + "/testresult-regressions-report.txt", "wb") as f:
            f.write(regreport)
Signature · 1 line
2.39.1
#2 lore raw

PATCH 2/3 scripts/send-qa-email: reduce testresults shallow clone depth

In reply to Alexis Lothore

Since we are now force-fetching base revisions and target revisions for regression report generation, we can make testresults clone even more "shallow" to increase clone speed in CI pipelines

---
 scripts/send_qa_email.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/send_qa_email.py +2 -2
index f8ebe34..b87e822 100755
@@ -139,10 +139,10 @@ def send_qa_email():
             elif basebranch:
                 cloneopts = ["--branch", basebranch]
             try:
-                subprocess.check_call(["git", "clone", "[email protected]:yocto-testresults", tempdir, "--depth", "5"] + cloneopts)
+                subprocess.check_call(["git", "clone", "[email protected]:yocto-testresults", tempdir, "--depth", "1"] + cloneopts)
             except subprocess.CalledProcessError:
                 print("No comparision branch found, falling back to master")
-                subprocess.check_call(["git", "clone", "[email protected]:yocto-testresults", tempdir, "--depth", "5"])
+                subprocess.check_call(["git", "clone", "[email protected]:yocto-testresults", tempdir, "--depth", "1"])
 
             # If the base comparision branch isn't present regression comparision won't work
             # at least until we can tell the tool to ignore internal branch information
Signature · 1 line
2.39.1
#3 lore raw

PATCH 3/3 scripts/send-qa-email: add target and base revisions in regression report

In reply to Alexis Lothore

Current regression reports do not contain information about versions compared when generating reports. While it is still possible to get the information by searching the autobuilder log, it is not convenient. Moreover, future developments will allow to generate multiple reports (with different bases for comparison) in a single build.
As a consequence, embed target and base revisions in the report header

---
 scripts/send_qa_email.py | 4 ++++
 1 file changed, 4 insertions(+)
scripts/send_qa_email.py +4 -0
index b87e822..e2d7284 100755
@@ -78,6 +78,10 @@ def generate_regression_report(resulttool, targetrepodir, basebranch, resultdir,
         fetch_testresults(resultdir, comparerevision)
         regreport = subprocess.check_output([resulttool, "regression-git", "-B", basebranch, "--commit", baserevision, "--commit2", comparerevision, resultdir])
         with open(outputdir + "/testresult-regressions-report.txt", "wb") as f:
+           f.write(str.encode("========================== Regression report ==============================\n"))
+           f.write(str.encode(f'{"=> Target:": <16}{basebranch: <16}({comparerevision})\n'))
+           f.write(str.encode(f'{"=> Base:": <16}{baseversion: <16}({baserevision})\n'))
+           f.write(str.encode("===========================================================================\n\n"))
            f.write(regreport)
     except subprocess.CalledProcessError as e:
         error = str(e)
Signature · 1 line
2.39.1
#4 lore raw
In reply to Alexis Lothore
Quoted 22 lines · Alexis Lothoré via lists.yoctoproject.org

Hello,
this minor patch series bring minor fixes into send-qa-email to ease development/debugging in it:
- fetching current build test results works well in CI builds because we are sure that the build results will be in the 5 upper commits of testsresults repository shallow clone (because it has been pushed just before preparing the regression report). It is not true when trying to run send-qa-email offline on older revisions (for development, debugging or improvement of scripting), so we need to force-fetch the target revision as it is done currently for the base revision. As a consequence, this new behaviour allows to make even more "shallow" clones of testresults since all needed data will be force-fetched
- When downloading a test regression report on official release webserver, we do not have information about what base have been used or what is the exact tested revision (at least, without checking the corresponding build logs on autobuilder). So I propose to add this information at the top of each regression report, making it look like this:

========================== Regression report ==============================

=> Target:      master          (5e249ec855517765f4b99e8039cb888ffa09c211)
=> Base:        4.2_M1          (4d19594b8bdacde6d809d3f2a25cff7c5a42295e)

===========================================================================

Quoted 8 lines

Match: oeselftest_almalinux-9.1_qemux86-64_20221208113119

       oeselftest_centos-8_qemux86-64_20230126230327
Match: oeselftest_debian-11_qemux86-64_20221208033325
       oeselftest_debian-11_qemux86-64_20230126150229

[...]

I assumed that no tool is currently trying to parse the regression reports, so I chose arbitrarily the metadata format.

The reports have never been useful enough to parse so that should be fine.

Quoted 3 lines

@Richard : on a side note, the broken From field in my previous emails was probably due to an accent in my name, it should be fixed now. Please let me know if you still have issues with this, in this case I will force the --from field.

It still shows incorrectly for me. It is an issue with the bootlin mail setup and DNS, not to do with the character encoding. My changing the accent, it is now duplicating the signed off by lines so I'd avoid doing that!

Cheers,

Richard

#5 lore raw

Hello Richard,

Quoted 7 lines · Richard Purdie
Quoted 2 lines · Alexis Lothoré via lists.yoctoproject.org

I assumed that no tool is currently trying to parse the regression reports, so I chose arbitrarily the metadata format.

The reports have never been useful enough to parse so that should be fine.

Good

Quoted 8 lines
Quoted 3 lines

@Richard : on a side note, the broken From field in my previous emails was probably due to an accent in my name, it should be fixed now. Please let me know if you still have issues with this, in this case I will force the --from field.

It still shows incorrectly for me. It is an issue with the bootlin mail setup and DNS, not to do with the character encoding. My changing the accent, it is now duplicating the signed off by lines so I'd avoid doing that!

Well, that's a shame, sorry for the annoyance. Once the patches are approved or lead to a v2, I will resend with "From:" forced, except if you want me to re-send it right now.

Signature · 3 lines
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#6 lore raw
Quoted 17 lines · Alexis Lothoré

Hello Richard,

Quoted 7 lines · Richard Purdie
Quoted 2 lines · Alexis Lothoré via lists.yoctoproject.org

I assumed that no tool is currently trying to parse the regression reports, so I chose arbitrarily the metadata format.

The reports have never been useful enough to parse so that should be fine.

Good

Quoted 4 lines
Quoted 3 lines

@Richard : on a side note, the broken From field in my previous emails was probably due to an accent in my name, it should be fixed now. Please let me know if you still have issues with this, in this case I will force the --from field.

Quoted 7 lines
Quoted 4 lines

It still shows incorrectly for me. It is an issue with the bootlin mail setup and DNS, not to do with the character encoding. My changing the accent, it is now duplicating the signed off by lines so I'd avoid doing that!

Well, that's a shame, sorry for the annoyance. Once the patches are approved or lead to a v2, I will resend with "From:" forced, except if you want me to re-send it right now.

Patches look otherwise ok to me so please resend!

Cheers,

Richard