Commit Graph

467 Commits

Author SHA1 Message Date
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
Richard Purdie
a9233c154f scripts/run-toaster-tests: Ensure hashserve is passed to toaster
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-09 10:11:51 +00:00
Marlon Rodriguez Garcia
c4f8a45e0a script/run-toaster-test : Added new global variables needed to run test in toaster build folder
Update run-toaster-test to include BUILDDIR and TOASTER_TEST_USE_SSTATE_MIRROR which will be use in the build test in toaster

Signed-off-by: Marlon Rodriguez Garcia <marlon.rodriguez-garcia@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-08 12:06:53 +00:00
Alexander Lussier-Cullen
9291298d41 scripts/run-toaster-tests.py: run via pytest and fix environment setup
Strip quotes from directory variables as they caused path errors.
Add environment variable for the toaster artifact directory.
Migrate from tox and django tools to using pytest.
Install python module requirements from the script as this is no
longer handled by tox.

Signed-off-by: Alexander Lussier-Cullen <alexander.lussier-cullen@savoirfairelinux.com>
CC: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-06 22:37:42 +00:00
Michael Halstead
1c3a588fc9 scripts/sstate-clean: run by cron on the autobuilder
Publish what cleans up the public SSTATE to help with debugging.

Signed-off-by: Michael Halstead <mhalstead@linuxfoundation.org>
2023-11-29 16:18:12 -08:00
Alexander Lussier-Cullen
e1289afb9e scripts/run-toaster-tests.py: Add environment variables
Pass the toaster test environment SSTATE_DIR and DL_DIR for faster
builds and TOASTER_DJANGO_TMPDIR to remove problematic temp files
from the root level '/tmp' directory.

Signed-off-by: Alexander Lussier-Cullen <alexander.lussier-cullen@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-23 15:23:02 +00:00
Michael Halstead
7914c9f8ec scripts: basic clean up of releases/layer parser
Signed-off-by: Michael Halstead <mhalstead@linuxfoundation.org>
2023-11-20 19:45:47 -08:00
Michael Halstead
aadcd5b0a4 scripts: releases parser handle version sorting correctly
Sort versions as if we used semantic versioning.
Include updates for the 4.3 release as well.

Signed-off-by: Michael Halstead <mhalstead@linuxfoundation.org>
2023-11-17 13:23:42 -08:00
Trevor Gamblin
3ac995a39f patchtest: add selftest runner
Add a runner that installs the patchtest dependencies in a Python venv
and then starts patchtest's selftests.

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-15 16:05:17 +00:00
Alexander Lussier-Cullen
c12157b568 Add toaster test builder
Add a toaster test builder that runs the tox test suite using a new
run-toaster-tests script.

Signed-off-by: Alexander Lussier-Cullen <alexander.lussier-cullen@savoirfairelinux.com>
CC: richard.purdie@linuxfoundation.org
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-15 16:05:17 +00:00
Michael Halstead
aea946ada7 scripts: prepare data for display on www.yoctoproject.org
These produce the files at https://docs.yoctoproject.org/parsed-layers.json
and https://docs.yoctoproject.org/releases.json.

Signed-off-by: Michael Halstead <mhalstead@linuxfoundation.org>
2023-11-03 13:03:27 -07:00
Ross Burton
8c4df34c80 scripts/run-patchmetrics: pull before updating metrics
Do another git-pull in the metrics repository before updating the
metrics, in case other metrics jobs running in parallel have updated the
repositories since they were cloned.  There will always be possibility
of racing metrics jobs, but this should reduce the chance of it
happening.

An alternative would be to commit and then rebase before pushing, but I
fear that a git-merge could produce invalid JSON and we'd have to
manually fix up the repository.  In my opinion, a wasted metrics run is
preferable to potentially corrupted repositories.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-03 15:06:35 +00:00
Ross Burton
97c6c18708 scripts/run-cvecheck: pull before updating metrics
Do another git-pull in the metrics repository before updating the
metrics, in case other metrics jobs running in parallel have updated the
repositories since they were cloned.  There will always be possibility
of racing metrics jobs, but this should reduce the chance of it
happening.

An alternative would be to commit and then rebase before pushing, but I
fear that a git-merge could produce invalid JSON and we'd have to
manually fix up the repository.  In my opinion, a wasted metrics run is
preferable to potentially corrupted repositories.

[RP: Moved to after the bitbke invocation]

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-03 15:06:35 +00:00
Richard Purdie
e797c5f70a auh-meta-oe: Send to the openembedded-devel mailing list, not core
To do that we need a separate config file.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-03 10:57:44 +00:00
Yoann Congal
870f0435bc config.json: Move AUH from custom scripts to config.json
setup-auh and run-auh were doing what the AB config.json does:
* creating repo checkouts: Now use NEEDREPOS
* configuring bitbake env: Now use extravars

This refactoring is needed to prepare adding AUH meta-oe support.

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-03 10:49:02 +00:00
Ross Burton
2954d78759 Rewrite metrics-gathering scripts
Rewrite the scripts that gather the metrics to be more generic.

Extract the metrics repository cloning out so that we don't have to
repeatedly clone it.

Make the scripts parse their arguments using getopt and be more specific
about what they're passed.  In particular, this means that for the patch
review run we pass the _repository_ that we're scanning so we can do git
operations on it, and the base of the _layers_ (either a layer, or a
directory containing layers) so we know what to scan.

Be more clever when identifying what commits we need to analyse for
patch review: instead of iterating through a set randomly, we can keep
the revision list sorted and the checkout operations are a lot faster.

Remove the commit/file count metric addition as patchreview itself does
that now.

Add an explicit --push option so it's easy to test the scripts in
isolation without pushing.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-31 15:01:57 +00:00
Tim Orling
be76b6a5e4 scripts: add list-yp-compatible-layers.py
This is a handy helper script to query the Buildbot REST API to
create a list of Yocto Project Compatible 2.0 layers, as defined by
successful running of the "check-layers*" jobs.

The script only considers the 'jobs' ("Builders" in Buildbot speak) you
ask it to query.

The script looks at the latest -n successful builds for a branch that
matches from a list. The number of builds approach was used because
the property_list cannot be queried for "branch" in the "builders" API.

It looks for a "step" name pattern via a regex, with which all currently
running "check-layer" and "check-layer-nightly" jobs conform.

Once a branch has successfully been queried, it is removed from the list
in further iterations. The intent is to only find the latest passing
list of compatible layers, for each branch.

The output is a yp_compatible_layers.json file which can
be pretty printed with:

cat yp_compatible_layers.json | jq

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-29 22:40:32 +00:00
Richard Purdie
711b38598f config.json: Add patchtest build
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-26 14:22:33 +01:00
Richard Purdie
f7cac565b4 scripts/run-cvecheck: Remove branch iteration
Rather than running multiple checkouts, lets move this to the autobuilder
to handle and have it trigger the builds with the right checkouts.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-23 16:43:24 +01:00
Richard Purdie
cfdd2d7737 scripts/run-patchmetrics: Only monitor master branch
We only monitor the master branch for patch metrics as we can't really make
improvements to release branches.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-23 16:43:20 +01:00
Richard Purdie
b2f39bf490 metrics: Pass branchname to scripts
To prepapre to run the scripts per branch, pass the branchname to the scripts.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-23 16:25:51 +01:00
Richard Purdie
dba803bdb2 scripts/run-patchmetrics: Split out CVE checks
Split the CVE checks from the patch metrics script

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-23 16:22:37 +01:00
Richard Purdie
2da59d3191 scripts/run-patchmetrics: Only clone metrics if it isn't present
To prepare for splitting things up, only clone the metrics repo if it isn't present.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-23 16:18:28 +01:00
Alexis Lothoré
76c6b3644c scripts/send_qa_email: guess latest tested revision when dealing with branch
It has been observed that some regression reports generation may failed
when the comparision base is a branch (e.g master) because we can not find
any test results associated to the branch HEAD. This is especially true for
branches which often change, because not all revisions on those branch are
subject to CI tests.

To fix that, whenever we are not dealing with a release, parse the latest
tested revision in test results repository on target branch in order to
guess the corresponding revision in poky repository, so we are sure that
revisions passed to yocto_testresults_query are indeed tested and
regression report can be generated

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-04 23:39:50 +01:00
Alexis Lothoré
c70cb948c6 scripts/send-qa-email: define tests results repository url only once
Test results repository url is used at least twice, so define a constant
holding the url instead of hardcoding it multiple times

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-04 23:39:50 +01:00
Alexis Lothoré
44650c9681 scripts/send_qa_email: re-clarify base and target revisions
There are some inversions in words used to describe elements of comparison
for regression reporting: the main function of send_qa_email starts using
"base" to talk about the target revision and "compare" to talk about the
reference against which it is compared. Then later in the script, the
"base" is used as "base of comparison"/reference revision, while the
"target" branch/revision appears. This becomes quite confusing when we need
to update the script

Re-align wording to avoid confusion:
- always use "target" to talk about current branch/revision of interest
  (the newest)
- always use "base" to talk about the reference branch/revision  (the
  oldest), against which we want to compare the target revision

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-04 23:39:50 +01:00
Richard Purdie
2a5b2722d0 scripts/send_qa_email: Add missing global to allow exitcode to work
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-09-27 16:40:37 +01:00
Richard Purdie
5e4d2ffaae scripts/send-qa-email: Add URL of build to QA email
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-09-26 12:03:43 +01:00
Richard Purdie
9d39add273 qa_email: Ensure we set an error exit code for errors
Whilst the script needs to continue if we fail to generate a regression report,
set the exit code accordingly so our CI can flag the issue.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-09-26 11:16:39 +01:00
Richard Purdie
c0202368a1 qa_email: Add headers to the script to improve debugging
It is hard to tell which section of the code specific error messages
come from at present. Add more headers to the output so we can at
least tell which section the messages are from. It also adds some
timing information.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-09-26 11:11:01 +01:00
Alexander Kanavin
af5d072a65 auh-config: systemd now requires usrmerge
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-08-15 21:20:32 +01:00