blob: d069a583e503218cb1aeb6a174633148b30c9fde [file] [log] [blame]
Okash Khawaja671bed22022-11-10 15:51:19 +00001This directory contains code related to long-term support management of TF-A.
2
3lts-triage.py
4=============
5
6Purpose of this script is to check a patch and determine if that patch qualifies
7as a candidate for one of the LTS branches.
8
9Currently it focuses on cpu errata while it contains basic support for security
10patches. It computes a crude score:
11
121 point if subject line matches tokens for cpu errata or security
131 point for "report_errata ERRATA" in a lib/cpus/aarch{32,64}/*.S file
141 point for "- ``ERRATA_" in docs/design/cpu-specific-build-macros.rst file
15
16Note that the script only looks at commits which are not merge commits.
17
Okash Khawaja66a3a7e2023-01-24 11:06:16 +000018The script expects two branches: 'integration' and 'to_check'. 'integration' is
19the actual integration branch of the TF-A project while 'to_check' points to the
20tip of latest patch in the patchset that was submitted.
21
22The script needs to work out how many commits are in the current patchset which
23will be the ones it needs to triage. In order to do that the script looks at two
24parameters which are currently fixed in code. We can turn them into args if needed.
25First is REBASE_DEPTH which is the number of commits in integration branch to look
26for the common commit between patchset and integration branch. Second parameter is
27MAX_PATCHSET_DEPTH which is the maximum number of commits we expect in the patchset
28submitted.
29
Okash Khawaja68751502023-02-03 18:53:14 +000030At the end, if any commit has non-zero score, the script will create a file named at
31the path provided by --email_path argument.
32
Okash Khawaja671bed22022-11-10 15:51:19 +000033Running it:
34-----------
35
36To run it, provide it a path to a TF-A git repo. Here's help output for convenience:
37
Okash Khawaja68751502023-02-03 18:53:14 +000038$ python lts-triage.py -h
39usage: lts-triage.py [-h] --repo REPO --email_path EMAIL_PATH [--debug]
Okash Khawaja671bed22022-11-10 15:51:19 +000040
41check patches for LTS candidacy
42
43options:
44 -h, --help show this help message and exit
45 --repo REPO path to tf-a git repo
Okash Khawaja68751502023-02-03 18:53:14 +000046 --email_path EMAIL_PATH
47 path including the filename for email file
Okash Khawaja671bed22022-11-10 15:51:19 +000048 --debug print debug logs
49
Okash Khawaja671bed22022-11-10 15:51:19 +000050Below is an example output. On left is commit hash of each of the commits
51observed by this script and on right is score assigned to it.
52
Okash Khawajaa5909ac2023-02-03 19:22:34 +000053$ python lts/lts-triage.py --repo ../trusted-firmware-a/ --email_path ./email.txt
54feat(errata_framework): wrappers to propagate Aarch32 errata info: 0
55feat(errata_framework): add a way to automatically report errata: 0
56feat(errata_framework): add a concise way to implement Aarch64 errata: 0
57refactor(cpus): convert print_errata_status to C: 0
58refactor(cpus): rename errata_report.h to errata.h: 0
59refactor(cpus): move cpu_ops field defines to a header: 0
60chore(fvp): add the aarch32 cortex A57 to the build: 0
61chore(cpus): remove redundant asserts: 0
62refactor(cpus): shorten errata flag defines: 0
63## stopping because found sha1 common between the two branches: 1678bbb57249b6edd4cdebc3cbc33b04df8fa098
Arthur Shed8cd8db2024-03-11 09:54:24 -070064
65=============
66lts-triage-v2.py
67=============
68
69Purpose of this script is to check a patch and determine if that patch qualifies
70as a candidate for one of the LTS branches.
71
72Currently it focuses on cpu errata while it contains basic support for security
73patches. It computes a crude score:
74
751 point if subject line matches tokens for cpu errata or security
761 point for "report_errata ERRATA" in a lib/cpus/aarch{32,64}/*.S file
771 point for "- ``ERRATA_" in docs/design/cpu-specific-build-macros.rst file
78
79Those match tokens were moved to config.py
80Note that the script only looks at commits which are not merge commits.
81
82The script expects two branches: 'integration' and the lts branch, for example 'lts-v2.8'.
83it will check every commit in the integration branch, until it finds a common commit
84, same Change-Id, between the integration branch and the lts branch.
85
86At the end, if any commit has non-zero score, the script will create a file named at
87the path provided by --csv_path argument.
88The csv report includs the following information
891. index
902. commit id in the integration branch
913. commit summary
924. score
935. Gerrit Change-Id
946. patch link for the LTS branch: if the patch has been cherry-picked to the lts branch
95 , the Gerrit URL will be listed
967. patch link for the integration branch
97
98Running it:
99-----------
100
101In order to perform "gerrit query", we need a Gerrit account and the corresponding SSH keyfile.
102Here's help output for convenience:
103
104$ python lts-triage.py -h
105usage: lts-triage.py [-h] --repo REPO --csv_path CSV_PATH --lts LTS --gerrit_user GERRIT_USER
106 --ssh_keyfile SSH_KEYFILE [--debug]
107
108check patches for LTS candidacy
109
110options:
111 -h, --help show this help message and exit
112 --repo REPO path to tf-a git repo
113 --csv_path CSV_PATH path including the filename for CSV file
114 --lts LTS LTS branch, ex. lts-v2.8
115 --gerrit_user GERRIT_USER
116 The Gerrit account to perform the query
117 --ssh_keyfile SSH_KEYFILE
118 The SSH keyfile
119 --debug print debug logs
120
121Below is an example output. On left is commit hash of each of the commits
122observed by this script and on right is score assigned to it.
123
124$./lts-triage-v2.py --repo ../../trusted-firmware-a/ --lts lts-v2.10 --csv_path ./lts-v2.10-report.csv
125 --gerrit_user arthur-she --ssh_keyfile ~/.ssh/id_rsa.pub
126fix(cpus): fix a defect in Cortex-A715 erratum 2561034: 1
127fix(cpus): workaround for Cortex-A715 erratum 2413290: 2
128docs: add documentation for `entry_point_info`: 0
129build(npm): fix Commitizen ES Module errors: 0
130build(npm): adhere to Husky deprecation notice: 0
131fix(misra): fix MISRA defects: 0
132refactor(cm): couple el2 registers with dependent feature flags: 0
133fix(tc): do not use r0 for HW_CONFIG: 0
134fix(cpus): workaround for Cortex-A715 erratum 2344187: 2
135fix(cpus): workaround for Cortex-X4 erratum 2701112: 2
136fix(gic600): workaround for Part 1 of GIC600 erratum 2384374: 0
137fix(cpus): workaround for Cortex-A715 erratum 2331818: 2
138fix(arm): move console flush/switch in common function: 0
139fix(cpus): workaround for Cortex-A715 erratum 2420947: 2
140## stopping because found common Gerrit Change-Id between the two branches: I612338fd2896f3fe614f23d14f56d58d43318a11