Skip to content

Merge metric views contrib#9

Open
hulkoba wants to merge 3 commits intomainfrom
merge-metric-views-contrib
Open

Merge metric views contrib#9
hulkoba wants to merge 3 commits intomainfrom
merge-metric-views-contrib

Conversation

@hulkoba
Copy link
Contributor

@hulkoba hulkoba commented Apr 2, 2024

M10: Metrics view: CVEs per branch section and M11: Unify metrics views

metrics PR neighbourhoodie/yocto-metrics#4

  • Don't create chartdata-lastyear.json files because they are not needed anymore
  • Change format for generated cve-per-branch-report so it can be interpreted by the metrics view:
...
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
...
}

Local setup

Generate chart data

First, we have to generate the necessary data for the charts.
For this, we have to go to the yocto-autobuilder-helper repo and generate chart data.

# Go to your local clone of the autobuilder repo
cd yocto-autobuilder-helper

Patch metrics data

Make sure to add your local path to the yocto-metrics repo.

# Then run the following to generate the data and save it in your local yocto-metrics repo
./scripts/patchmetrics-generate-chartdata --json "PATH_TO_DEV/yocto-metrics/patch-status.json" --outputdir "PATH_TO_DEV/yocto-metrics/patch-status/"

CVE chart data

Next, you'll need to generate CVE chart data by running the following.
Again please note to add your local path to the yocto-metrics repo.

./scripts/cve-generate-chartdata --json "PATH_TO_DEV/yocto-metrics/cve-count-byday.json" --resultsdir "PATH_TO_DEV/yocto-metrics/cve-check/"

CVE report data

The following is for generating CVE report data.
The branch names and data are listed here.

./scripts/cve-report.py "PATH_TO_DEV/yocto-metrics/cve-check/master/<TIMESTAMP>.json" > "PATH_TO_DEV/yocto-metrics/patch-status/cve-status-master.txt"

For example

./scripts/cve-report.py "../yocto-metrics/cve-check/master/1709622082.json" > "../yocto-metrics/patch-status/cve-status-master.txt"
./scripts/cve-report.py "../yocto-metrics/cve-check/dunfell/1709619021.json" > "../yocto-metrics/patch-status/cve-status-dunfell.txt"
./scripts/cve-report.py "../yocto-metrics/cve-check/kirkstone/1709619448.json" > "../yocto-metrics/patch-status/cve-status-kirkstone.txt"
./scripts/cve-report.py "../yocto-metrics/cve-check/nanbield/1709620787.json" > "../yocto-metrics/patch-status/cve-status-nanbield.txt"

View chart

Once the chart data is created you can run the chart html files in the yocto-metrics repo as follows:

# Go to your local clone of the yocto-metrics repo
cd yocto-metrics

# open the chart html file in your browser
open ./patch-status/index.html

Screenshots

Screenshot from 2024-04-10 10-25-28
Screenshot from 2024-04-10 10-25-35
Screenshot from 2024-04-10 10-25-55

Dark theme

Screenshot from 2024-04-16 08-41-39
Screenshot from 2024-04-16 08-41-45
Screenshot from 2024-04-16 08-41-51

ninetteadhikari and others added 2 commits April 16, 2024 08:46
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
...
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.
@hulkoba hulkoba force-pushed the merge-metric-views-contrib branch from 9c151cf to 731caae Compare April 16, 2024 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants