scan table change: the results.query_id is the @id from the CodeQL query

Before, the query_id was
	==> results.csv <==
	query_id STRING,         -- git commit id of the ql query set

now, it's
	query_id STRING,         -- @id from the CodeQL query
This commit is contained in:
Michael Hohn
2022-08-11 16:56:20 -07:00
committed by =Michael Hohn
parent 8ad69a503b
commit 2b42a7d306
2 changed files with 4 additions and 3 deletions

View File

@@ -299,7 +299,7 @@
==> results.csv <== ==> results.csv <==
id INT, -- primary key id INT, -- primary key
scan_id INT, -- scans.id scan_id INT, -- scans.id
query_id STRING, -- git commit id of the ql query set query_id STRING, -- @id from the CodeQL query
location STRING, location STRING,
message STRING, message STRING,
message_object OBJ, message_object OBJ,

View File

@@ -172,7 +172,7 @@ def _results_from_kind_problem(basetables, external_info):
'id': [flakegen.next() for _ in range(len(b.kind_problem))], 'id': [flakegen.next() for _ in range(len(b.kind_problem))],
'scan_id' : e.scan_id, 'scan_id' : e.scan_id,
'query_id' : e.ql_query_id, 'query_id' : b.kind_problem.rule_id,
'result_type' : "kind_problem", 'result_type' : "kind_problem",
'codeFlow_id' : 0, # link to codeflows (kind_pathproblem only, NULL here) 'codeFlow_id' : 0, # link to codeflows (kind_pathproblem only, NULL here)
@@ -195,6 +195,7 @@ def _results_from_kind_problem(basetables, external_info):
'source_object' : pd.NA, # TODO: find high-level info from query name or tags? 'source_object' : pd.NA, # TODO: find high-level info from query name or tags?
'sink_object' : pd.NA, 'sink_object' : pd.NA,
}) })
# Force column type(s) to avoid floats in output. # Force column type(s) to avoid floats in output.
res1 = res.astype({ 'id' : 'uint64', 'scan_id': 'uint64'}).reset_index(drop=True) res1 = res.astype({ 'id' : 'uint64', 'scan_id': 'uint64'}).reset_index(drop=True)
return res1 return res1
@@ -257,7 +258,7 @@ def _results_from_kind_pathproblem(basetables, external_info):
# is done, below. # is done, below.
res = { res = {
'scan_id' : e.scan_id, 'scan_id' : e.scan_id,
'query_id' : e.ql_query_id, 'query_id' : cfid0ppt0.rule_id.values[0],
# #
'result_type' : "kind_pathproblem", 'result_type' : "kind_pathproblem",
'codeFlow_id' : cfid0, 'codeFlow_id' : cfid0,