mirror of
https://github.com/hohn/sarif-cli.git
synced 2025-12-16 17:23:03 +01:00
Move flakegen scan id to outermost bin tool runner
This commit is contained in:
@@ -109,10 +109,6 @@ external_info = ExternalInfo(
|
|||||||
'deadbeef00',
|
'deadbeef00',
|
||||||
)
|
)
|
||||||
|
|
||||||
# Replace scan id to guarantee unique - do not rely on external gen
|
|
||||||
flakegen1 = snowflake_id.Snowflake(1)
|
|
||||||
external_info.scan_id = flakegen1.next()
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Add dataframes for base tables
|
# Add dataframes for base tables
|
||||||
#
|
#
|
||||||
|
|||||||
6
bin/sarif-extract-scans-runner
Normal file → Executable file
6
bin/sarif-extract-scans-runner
Normal file → Executable file
@@ -80,6 +80,7 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
import pickle
|
import pickle
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
from sarif_cli import snowflake_id
|
||||||
|
|
||||||
#
|
#
|
||||||
# Handle arguments
|
# Handle arguments
|
||||||
@@ -129,6 +130,9 @@ if use_successful_runs:
|
|||||||
else:
|
else:
|
||||||
successful_runs = set()
|
successful_runs = set()
|
||||||
|
|
||||||
|
# Scan id guaranteed unique - do not rely on external info
|
||||||
|
flakegen1 = snowflake_id.Snowflake(0)
|
||||||
|
|
||||||
count = -1
|
count = -1
|
||||||
for path in paths:
|
for path in paths:
|
||||||
count += 1
|
count += 1
|
||||||
@@ -143,7 +147,7 @@ for path in paths:
|
|||||||
#
|
#
|
||||||
scan_spec = {
|
scan_spec = {
|
||||||
"project_id": abs(hash(project + component)), # pd.UInt64Dtype()
|
"project_id": abs(hash(project + component)), # pd.UInt64Dtype()
|
||||||
"scan_id": int(os.path.getmtime(path)), # pd.Int64Dtype()
|
"scan_id": flakegen1.next(), # pd.Int64Dtype()
|
||||||
"sarif_file_name": path, # pd.StringDtype()
|
"sarif_file_name": path, # pd.StringDtype()
|
||||||
}
|
}
|
||||||
scan_spec_file = os.path.join(project, component + ".scanspec")
|
scan_spec_file = os.path.join(project, component + ".scanspec")
|
||||||
|
|||||||
Reference in New Issue
Block a user