Commit Graph

29 Commits

Author SHA1 Message Date
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
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
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
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
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
Richard Purdie
e185e1efde run-patchmetrics: Add mickledore
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-04-11 11:45:50 +01:00
Richard Purdie
5fee00855e yocto-metrics: Add langdale CVE monitoring
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-10-28 13:30:19 +01:00
Alexander Kanavin
e18974a86c scripts/run-patchmetrics: remove conf/templateconf.cfg as well between builds
With the recent template config changes to oe-core its content is no longer
backwards compatible.

'-f' is to guarantee future compatibility with build setups where the file
is not present.

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-09-02 11:43:59 +01:00
Richard Purdie
54630b14ce scripts/run-patchmetrics: Ensure cve data for last year is copied
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-29 07:45:46 +01:00
Richard Purdie
3921d4f3ec scripts: Ensure directories exist
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-14 22:09:16 +01:00
Richard Purdie
60902768cc scripts/run-patchmetrics: Drop honister, remove oldder json files
Keeping all the previous json files in tree has too much overhead
so drop the old ones. Honister doesn't support cve-check with json.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-25 17:52:39 +01:00
Richard Purdie
47d8883222 scripts/run-patchmetrics: Continue CVE checks for honister for now
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-25 09:46:15 +01:00
Richard Purdie
10ecb12155 scripts: Add script to update CVE count data in json file
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-25 08:32:19 +01:00
Richard Purdie
6655466ea6 scripts/run-patchmetrics: Seperate out cve-check json files into direcotries
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-24 15:21:23 +01:00
Richard Purdie
803bdecd62 scripts/run-patchmetrics: Ensure tmpdir is clean between build runs
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-23 22:56:23 +01:00
Richard Purdie
125f1dbea4 scripts: Add patch to filter the chart data to make it usable
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-23 22:54:54 +01:00
Richard Purdie
c491e01653 scripts/run-patchmetrics: Ensure environment works for dunfell
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-23 22:11:19 +01:00
Richard Purdie
e3beeb9328 scripts: Extend CVE testing to kirkstone and dunfell branches
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-23 16:22:35 +01:00
Richard Purdie
7eca1ae4d7 scripts: Add ability to add/process missing patch stats data
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-23 16:05:23 +01:00
Richard Purdie
ca67ed751e run-patchmetrics: Add very basic cve-check functionality
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-17 17:14:13 +01:00
Richard Purdie
8702fdbb72 Clarify license and copyright information
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-17 10:29:45 +01:00
Richard Purdie
348467c2c8 run-patchmetrics: Use -m for realpath for results dir as it doesn't exist
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-13 17:21:45 +01:00
Richard Purdie
5b73a9b6eb run-patchmetrics: Use full variable names
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-13 17:19:17 +01:00
Richard Purdie
fd1aa61d87 scripts/run-patchmetrics: Ensure paths are sanitized
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-13 16:39:59 +01:00
Richard Purdie
1887e59889 config/scripts: Allow publishing of patch metrics
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-13 16:37:10 +01:00
Richard Purdie
2765a6a314 config/scripts: Add initial patch metric tracking code
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-13 16:21:57 +01:00