aboutsummaryrefslogtreecommitdiffstats
path: root/build/scripts
diff options
context:
space:
mode:
authorsvidyuk <svidyuk@yandex-team.com>2024-02-29 08:36:30 +0300
committersvidyuk <svidyuk@yandex-team.com>2024-02-29 08:54:30 +0300
commit3d87cc1b644c8e1aa5371f84e14794e324b61eb6 (patch)
tree598d223c5f3bdd9e2c44d11caf826f7f1fdfe0bf /build/scripts
parentf8b1d86cff93425ed5d8d0a933f2167f1825df4d (diff)
downloadydb-3d87cc1b644c8e1aa5371f84e14794e324b61eb6.tar.gz
Add module sources path in arcadia to SBOM
b602177461457152031e77d2e8dcb91894576c10
Diffstat (limited to 'build/scripts')
-rw-r--r--build/scripts/link_sbom.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/build/scripts/link_sbom.py b/build/scripts/link_sbom.py
index 8b40850590..8210415ab9 100644
--- a/build/scripts/link_sbom.py
+++ b/build/scripts/link_sbom.py
@@ -30,16 +30,17 @@ def parse_componenet(component):
res['name'] = deduce_name(path)
res['version'] = ver
res["properties"] = [
- {'name': 'arcadia_path', 'value': path},
+ {'name': 'arcadia_module_subdir', 'value': path},
{'name': 'language', 'value': props['lang']}
]
return res
def main():
- parser = argparse.ArgumentParser(description='Generate SBOM datea from used contribs info')
- parser.add_argument('-o', '--output', type=argparse.FileType('w', encoding='UTF-8'), help='resulting SBOM file')
- parser.add_argument('--vcs-info', type=argparse.FileType('r', encoding='UTF-8'), help='VCS information file')
+ parser = argparse.ArgumentParser(description='Generate SBOM data from used contribs info')
+ parser.add_argument('-o', '--output', type=argparse.FileType('w', encoding='UTF-8'), help='resulting SBOM file', required=True)
+ parser.add_argument('--vcs-info', type=argparse.FileType('r', encoding='UTF-8'), help='VCS information file', required=True)
+ parser.add_argument('--mod-path', type=str, help='Path to module in arcadia', required=True)
parser.add_argument('libinfo', metavar='N', type=str, nargs='*', help='libraries info for components section')
args = parser.parse_args()
@@ -53,7 +54,7 @@ def main():
res["version"] = 1
res["components"] = [parse_componenet(lib) for lib in args.libinfo]
res["properties"] = [
- {'name': 'commit_hash', 'value': vcs['ARCADIA_SOURCE_HG_HASH']}
+ {'name': 'commit_hash', 'value': vcs['ARCADIA_SOURCE_HG_HASH'], 'arcadia_module_subdir': args.mod_path}
]
if vcs.get('DIRTY', '') == 'dirty':
res["properties"].append({'name': 'has_uncommited_changes', 'value': True})