Commit Graph

22 Commits

Author SHA1 Message Date
335017ba68 try a reduced signature for better compatibility with sarif variations
This doesn't help; sarif is just too dynamic.  Try a pull parser instead.
2025-10-19 23:36:38 -07:00
c15dc6d4bc Fix subtle type problem: M8 is required for early steps, datetime64[ns] later 2025-10-19 13:35:02 -07:00
Michael Hohn
ee11214aee Add support for external timestamps
This allows external files containing

    timestamps = {
        "db_create_start"      : pd.Timestamp(0.0, unit='s'),
        "db_create_stop"       : pd.Timestamp(0.0, unit='s'),
        "scan_start_date"      : pd.Timestamp(0.0, unit='s'),
        "scan_stop_date"       : pd.Timestamp(0.0, unit='s'),
    }

to be used to provide those values, instead of the above defaults.

This patch changes the top-level scripts
        bin/sarif-extract-scans
        bin/sarif-extract-scans-runner
and provides
        scripts/test-timestamps.sh
for verification.

The following keys are also accepted:
    {
      "db_create_start": ...,
      "db_create_stop": ...,
      "scan_start": ...
      "scan_stop": ...
    }
2023-08-18 17:06:58 -07:00
Kristen Newbury
a3aed444c1 Add explicit column ordering to to_csv writes
in interfaces:
sarif-pad-aggregates
sarif-extract-scans
2023-05-29 08:58:29 -04:00
Kristen Newbury
eb50bdf834 Merge branch 'main' 2023-05-15 13:09:21 -04:00
Kristen Newbury
953d47edd3 Fix extract scans interface CLI default 2023-03-02 11:43:25 -05:00
Kristen Newbury
04e3dedb77 Merge pull request #2 from dbeer/exceptions
Fix exception reraising
2023-01-12 12:23:00 -05:00
Kristen Newbury
1a915e4de8 Update how project_id is generated
previously relied on assumption:
naming like: <org>/<project> in
repositoryUri
now just uses full repositoryUri
2023-01-05 16:37:55 -05:00
Daniel Beer
6b475becd9 Fix exception reraising 2022-12-30 12:40:07 -05:00
Kristen Newbury
04a5aae14d Add CLI support
enabled by -f flag with CLI value
tested on sarif from CodeQL CLIs:
2.6.3, 2.9.4, 2.11.4
MUST contain versionControlProvenance property however
2022-12-15 19:12:58 -05:00
Kristen Newbury
009cf12d2c Fix load error csv output error 2022-12-12 17:15:49 -05:00
Kristen Newbury
2bda917a4e Improve error handling on signature mismatch cases
and cleanup old todos that have been addressed
2022-11-23 14:06:23 -05:00
Kristen Newbury
066fcb8248 Add error handling csv writer
writer generates status csv per sarif
2022-11-14 13:02:36 -05:00
Kristen Newbury
1caf03f5f0 Rework project name format and project id format 2022-11-07 13:56:50 -05:00
Kristen Newbury
d9116eba6a Move flakegen scan id to outermost bin tool runner 2022-10-25 10:40:25 -04:00
Kristen Newbury
4285b7a834 Add unique flakegen scan id 2022-10-21 12:16:44 -04:00
Michael Hohn
235acf6b93 Quote all non-numeric CSV output 2022-08-10 17:44:29 -07:00
Michael Hohn
560b9ecf35 Enforce types when forming the scan tables (internal and output formatting)
Force all column types to ensure appropriate formatting for writing.  In
particular, no character data in place of integers, no floats, no
objects in place of strings.

Table formation for the functions
- st.joins_for_results
- st.joins_for_scans
- st.joins_for_projects
enforces types.
2022-08-07 19:04:13 -07:00
Michael Hohn
741be0cfe1 Include project table in output of sarif-extract-scans; add commit_id to scans table 2022-06-02 16:45:04 -07:00
Michael Hohn
eb8e2f18e9 Initial version of sarif-extract-scans, to be tested
Running

    cd ~/local/sarif-cli/data/treeio
    sarif-extract-scans scan-spec-0.json test-scan

produces the 2 derived and one sarif-based table (codeflows.csv):

    ls test-scan/
    codeflows.csv  results.csv  scans.csv

Adding -r via

    sarif-extract-scans -r scan-spec-0.json test-scan

writes all tables:

    ls test-scan/
    artifacts.csv  kind_pathproblem.csv  project.csv           results.csv  scans.csv
    codeflows.csv  kind_problem.csv      relatedLocations.csv  rules.csv
2022-05-16 18:58:53 -07:00
Michael Hohn
154b0bdc56 WIP: assemble derived 'results' table 2022-05-13 17:01:18 -07:00
Michael Hohn
b212423907 WIP: sarif-extract-scans: back to single sarif file handling, incorporate multi-file libraries 2022-05-10 19:01:38 -07:00