Commit Graph

497 Commits

Author SHA1 Message Date
Ross Burton
f2ff264492 scripts/abint: generalise autobuilder URL regex
The autobuilder isn't just autobuilder.yoctoproject.org, as the new
cluster is valkyrie.yoctoproject.org.  Generalise the regex to match on
any buildbot URLs with "yocto" in the hostname, as we also have machines
using *.yocto.io.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-23 11:38:22 +01:00
Michael Halstead
51d842b5e0 scripts/release-parser.py: Update for 5.1 release and Walnascar branch
Signed-off-by: Michael Halstead <mhalstead@linuxfoundation.org>
2024-10-16 15:30:17 -07:00
Mathieu Dubois-Briand
bcf51897f1 scripts/run-docs-build: Fix built branches list
Only build contrib branches when explicitly requested.

Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
2024-10-16 11:06:42 +01:00
Richard Purdie
27196fdf41 scripts/run-patchmetrics: Avoid races over directory creation
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-09 23:20:46 +01:00
Richard Purdie
028cada341 auh: Update urls for new autobuilder address
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-09 23:14:08 +01:00
Richard Purdie
cca455446c scripts/run-docs-build: Use the 'cluster-downloads-cache' location for cache files
The docs build uses some cached tarballs, use the standarised location for these.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-09 23:06:08 +01:00
Richard Purdie
c79cc99309 scripts/utils: Use a consistent 'cluster-downloads-cache' location for cache files
Cache files were getting spread all over. Use a more consistent directory
name to make it clear they are cache files.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-09 21:19:17 +01:00
Michael Halstead
b093850639 scripts/release-parser: Update release generator for 5.1
Comment out future stable branch for easy updating.

Signed-off-by: Michael Halstead <mhalstead@linuxfoundation.org>
2024-08-22 06:09:56 -07:00
Richard Purdie
19f4fa0ac5 scripts/collect-results: Handle artefact collection/separation
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-07-17 14:44:51 +01:00
Richard Purdie
0646d5df44 scripts/archive_buildstats.py: Only create directories if we copy files
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-07-14 13:13:31 +01:00
Richard Purdie
faf9deb130 scripts/collect-results: Only create directories if we copy files
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-07-14 13:12:24 +01:00
Richard Purdie
3c44f8da3c collect-results: Fix dir creation and function indentation
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-07-13 23:49:10 +01:00
Richard Purdie
78ca7fb97b archive_buildstats: Only create dirs if we have data
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-07-13 11:42:30 +01:00
Richard Purdie
b1e2db6640 collect-results: Only create dirs if we have data
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-07-13 11:39:07 +01:00
Richard Purdie
9ada77ab57 scripts/generate-testresult-index.py: Add back data.json generation
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-07-12 23:11:51 +01:00
Richard Purdie
da2c03a6cb scripts/generate-ptest-logs: Fix typo
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-07-12 18:04:21 +01:00
Richard Purdie
9dc1462c0b scripts/generate-testresult-index: Add a cache and locking
Add a cache to improve performance and allow old index entries to be reused.

Also add locking so only one copy of the script can run at once.

Fix the path to the index template to be more stable in different execution environments.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-07-12 17:55:21 +01:00
Richard Purdie
a21238acab scripts: Split ptest log extraction to separate script
The ptest extraction should really happen separately to the index generation,
move it to do so.

Add code to only consider directories changed in the last 7 days to make
the script faster.

Add an indexing target to config.json to trigger the script.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-07-12 17:13:34 +01:00
Ross Burton
60e2011f34 scripts: rebase before pushing patch and CVE metrics
There's a chance that run-cvecheck and run-patchmetrics fail to push
because the remote repository has changed. Try to resolve this by pulling
and rebasing immediately before the push, and failing if we can't rebase.

[ YOCTO #15529 ]

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-07-12 12:41:54 +01:00
Alexis Lothoré
9852c7da33 scripts: send_qa_email: do not try to generate a regression report when missing base and/or target
Fixes [YOCTO 15503]

When running autobuilder onm a testing or stable branch, the following
exception may occur:

Traceback (most recent call last):
  File "/home/pokybuild/yocto-worker/a-full/yocto-autobuilder-helper/scripts/send_qa_email.py", line 278, in <module>
    send_qa_email()
  File "/home/pokybuild/yocto-worker/a-full/yocto-autobuilder-helper/scripts/send_qa_email.py", line 207, in send_qa_email
    generate_regression_report(querytool, targetrepodir, regression_base, regression_target, tempdir, args.results_dir, log)
  File "/home/pokybuild/yocto-worker/a-full/yocto-autobuilder-helper/scripts/send_qa_email.py", line 93, in generate_regression_report
    regreport = subprocess.check_output([querytool, "regression-report", base, target, '-t', resultdir])
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib64/python3.11/subprocess.py", line 1883, in _execute_child
    self.pid = _fork_exec(
               ^^^^^^^^^^^
TypeError: expected str, bytes or os.PathLike object, not NoneType

This issue is due to base and target revision being None, but subprocess
module do not tolerate arguments being None,

Prevent the script from even trying to generate a regression report if we
are missing some info about revisions to compare.

Cc: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-07-02 13:11:49 +01:00
Alexis Lothoré
9e961637ba scripts: test_send_qa_email: fix broken tests
Commit 1dc77f5908 ("scripts: send_qa_email: add dry-run mode") updated
the get_regression_base_and_target to allow it to receive a test result
url. Unfortunately, this function's tests have not been updated
accordingly, so they currently fail because of the missing parameter.

Add a default url in test case and update the function call with this
default value.

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-07-02 13:11:49 +01:00
Alexis Lothoré
dac3e4cc06 scripts: send_qa_email: fix invalid regex syntax warning
When send_qa_email is executed with python >= 3.12, the following warnings
are emitted:

/home/alexis/src/yocto_ci/yocto-autobuilder-helper/./scripts/send_qa_email.py:22: SyntaxWarning: invalid escape sequence '\d'
  p = re.compile('\d{8}-\d+')
/home/alexis/src/yocto_ci/yocto-autobuilder-helper/./scripts/send_qa_email.py:67: SyntaxWarning: invalid escape sequence '\/'
  tested_revision = re.match('refs\/tags\/.*\/\d+-g([a-f0-9]+)\/\d', latest_test_tag).group(1)

This warning has been introduced to replace the DeprecationWarning
initially raised on such escape code in string regex. Python 3.12 changelog
([1]) states that raw string must be used in this case. Update both
send_qa_email and its tests file.

[1] https://docs.python.org/dev/whatsnew/3.12.html#other-language-changes

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-07-02 13:11:49 +01:00
Alba Herrerías
ede8311127 scripts/generate-testresult-index.py: index of autobuilder test results improvements
- Added pico.css to make CSS improvements
- Added filters to the table for better readability of the test results. Filters were added for build type, branch and date
- Added pagination, which improved the performance of the website
- The html index template has been added as a separate file for better maintainability

Co-Authored-By: Ninette Adhikari <13760198+ninetteadhikari@users.noreply.github.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-06-07 17:00:11 +01:00
Ross Burton
3f33fc21a1 publish-artefacts: remove generic-arm64
This was removed from meta-arm as it has been obsoleted by genericarm64.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-05-08 13:55:56 +01:00
Richard Purdie
e2ebe3dc11 cve-generate-chartdata: Handle unexpected files in the stats directory
A build of "stable/dunfell-nut" caused incorrect data to be added to the metrics
repo and resulted in script failures. Handle this situation better.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-04-26 10:48:15 +01:00
Richard Purdie
87db0dccbc scipts/run-patchmetrics: Copy metric data recursively to fix failures
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-04-26 07:26:30 +01:00
hulkoba
de094db1bb generate-chartdata: do not create lastyear json files
the two html files, index.html and index-full.html,
got merged so we only need the json file with the complete set of data.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-04-25 14:43:55 +01:00
Ninette Adhikari
7fe66f781e cve-report: Reformat txt recipe list per branch
Yocto gathers the amount of CVEs per branch at the top of their metrics view.
However, the presentation of this information is not descriptive enough and it’s spread across several files.
This change adds collapsible, nested lists to show all cve information.

Show current CVE count per release,
parse txt files with CVE lists to group them by project and display their total CVE count.
Inline this data on the matrics-page in details elements so there’s no need to navigate away.

The current output includes the count of cve's and the cve-urls. No data is lost here, it looks like:

CVE counts by recipes:

linux-yocto: 134
  https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-1999-0524
  https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-1999-0656
  ...

bluez5: 2
  https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2022-3563
  https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2022-3637
...

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-04-25 14:43:54 +01:00
Michael Halstead
b4f7c4d10a scripts/layer-parser: sort maintainers for better display
Signed-off-by: Michael Halstead <mhalstead@linuxfoundation.org>
2024-04-11 22:59:39 -07:00
Ross Burton
4b9fe2cd8c scripts/abint: fix sorting on initial display
The default sorting was based on the list of seen times, but it should
be based on the latest seen time.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-03-07 22:54:53 +00:00
Ross Burton
d277a1ce1d scripts/abint: add argument parser
Add an argument parser so that the use of the cache or verbose logging
can be enabled/disabled without having to edit the source code.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-03-07 22:54:53 +00:00
Ross Burton
e2ede6667a scripts/abint: sort and organise imports
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-03-07 22:54:53 +00:00
Richard Purdie
142caae69e run-config/config.json: Add support for installing extra tools for specific targets
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-03-07 22:28:29 +00:00
Ross Burton
a9d143eee4 publish-artefacts: publish genericarm64 images
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-03-05 15:43:47 +00:00
Richard Purdie
094714e502 Add bitbake-extra-tests to cover taskexp ncurses UI.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-18 17:34:12 +00:00
Ross Burton
f12bfe787a scripts/abint: add a footer showing when the report was generated
Signed-off-by: Ross Burton <ross.burton@arm.com>
2024-02-15 12:35:42 +00:00
Ross Burton
27497d01c2 generate-testresult-index: fix key generation when filenames have hyphens
This script generates sorting keys so that 20240201-4 sorts before 20240201-20,
but the code assumes that there is only one hyphen when it splits.

However, there is now a patchstatus-meta-oe directory, which causes the
script to throw an exception.

Before padding, use a regex to check that the key is of the format we expect,
that is two integers separated by a hyphen.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-09 23:37:52 +00:00
Ross Burton
cd419db04c Add an AB-INT report
This report visualises the AB-INT bugs over time, to help find trends
such as bugs which are no longer occuring, or bugs which should be fixed
urgently.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-09 23:37:52 +00:00
Richard Purdie
b113aba114 config.json: Add meta-exein compatibility testing
Add meta-exein yocto-check-layer testing. Due to HOSTTOOLS issues, we
need to had a horrible hack. v2 compatibility doesn't test for HOSTTOOLS
changes although perhaps the next version might.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-08 10:01:57 +00:00
Ross Burton
1843fb4989 run-config: log the contents of bblayers.conf after edits
This is useful when using large sets of layers to
verify that the right layers have been added in
the right order.

Signed-off-by: Ross Burton <ross.burton@arm.com>
2024-02-07 12:13:01 +00:00
Ross Burton
bf6e536261 run-config: generalise auto.conf logging and only show when changed
Extract the logging of auto.conf to a new log_file_contents() function,
and instead of calling it before _every_ call of bitbake, only show it when
actually writing the auto.conf.

Signed-off-by: Ross Burton <ross.burton@arm.com>
2024-02-07 12:07:19 +00:00
Richard Purdie
2a4797a143 layer-config: Allow layer add to be disabled on a per target basis
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-01 12:15:59 +00:00
Richard Purdie
1591f007b3 cve-report: Add summary counts of CVEs by recipe
It is often helpful to know how many CVEs are open against a given recipe.
Add a summary table of this to the end of the CVE listing.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-23 14:34:31 +00:00
Alexis Lothoré
1dc77f5908 scripts: send_qa_email: add dry-run mode
Add a dry-run mode to be able to run send_qa_email locally but disabling
any output (no commit or tag pushed upstream, no mail sent). This eases
all release-related debugging. This dry-run mode is enabled by the
following changes:
- add a -d/--dry-run parameter to send_qa_email
- update test_results url to allow cloning test_results repository without
  having its public key registered upstream
- skip test results storage
- do not erase test results temp dir
- skip email sending (but still generate it)

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-02 16:13:27 +00:00
Michael Halstead
100f31d035 scripts/release-parser.py: download latest
Download links need to point to the latest point release.

Signed-off-by: Michael Halstead <mhalstead@linuxfoundation.org>
2023-12-21 09:51:49 -08:00
Michael Halstead
425dacb962 scripts/release-parser.py: correct stable version
Update from mickledore to nanbield.

Signed-off-by: Michael Halstead <mhalstead@linuxfoundation.org>
2023-12-21 09:48:18 -08:00
Alexis Lothoré
62cc7bdfc3 scripts: send_qa_email: protect get_regression_base_and_target from exceptions
generate_regression_reports is currently protect in a try/catch block to
prevent it from canceling QA email generation when encountering an issue,
but get_regression_base_and_target is not.

Make sure that get_regression_base_and_target can not prevent QA email from
being generated by adding it to the try/catch block protecting
send_qa_email. While doing so, make sure to preserve the exitcode variable
to make sure that the step is still marked as fail in autobuilder to make
sure the error does not go silent. However the variable is not needed as
global anymore since it is now used in a single function.

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-17 19:09:57 +00:00
Alexis Lothoré
76c5c295b3 scripts: send_qa_email: properly compute previous tag for new major release tag
send_qa_email currently fails when dealing with release version starting a
new major, for example 5.0. This has been observed for example when trying
to generate 5.0_M1.rc1

This specific versioning makes previous tag computation method fall through
last branch which currently expects that the current release tag indeed
exists (5.0_M1), which is true when checking regression reports a
posteriori, but not in an autobuilder run (tag is added only when the
release has been "validated")

Fix tag computation for this case by getting previous release tag with git
ls-remote, instead of relying on git describe with a possibly non-existing
tag. While doing so, add a few tests about this specific case.

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-17 19:08:23 +00:00
Alexis Lothoré
c304a50283 scripts: send_qa_email: allow testing against non fixed tags
send_qa_email currently deals with tags in a "reproducible" way: despite
new versions being released on different branches, the computation of the
"reference" version for a specific input version always remain the same.

This behavior does not match perfectly real expectations: if at the some
point we get version 4.3.1 as a comparison reference for a regression
report, and 4.3.2 is released some time later, we want the next comparision
to be done against 4.3.2.

Start introducing this new behavior by allowing the tests to check returned
version against regex patterns instead of static strings, so we can for
example use wildcards on the "micro" version

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-17 19:08:23 +00:00
Alexis Lothoré
6e92359609 scripts: send_qa_email: slightly rework previous tag test
Use intermediate variables for test input/output, and print expected
output in subtest to get more info when a test fails

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-17 19:08:23 +00:00