Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sca): new SCA stats schema #313

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions semgrep_output_v1.atd
Original file line number Diff line number Diff line change
Expand Up @@ -1687,6 +1687,50 @@ type ci_scan_complete_stats = {
<python repr="dict">
<ts repr="map">
option;

(* since 1.98.0 *)
(* In collaboration with the Data Science team, it was suggested
salolivares marked this conversation as resolved.
Show resolved Hide resolved
* that we start to group stats by product for organizational purposes.
*
* This field will only be defined for SCA scans.
*)
?supply_chain_stats: supply_chain_stats option;
salolivares marked this conversation as resolved.
Show resolved Hide resolved
}

type resolution_method <ocaml attr="deriving show"> <python decorator="dataclass(frozen=True, order=True)"> = [
salolivares marked this conversation as resolved.
Show resolved Hide resolved
| LockfileParsing
salolivares marked this conversation as resolved.
Show resolved Hide resolved
| DynamicResolution
]

type dependency_resolution_stats = {
resolution_method: resolution_method;
dependency_count: int;
salolivares marked this conversation as resolved.
Show resolved Hide resolved
ecosystem: ecosystem;
}

type dependency_source_file_kind <ocaml attr="deriving show"> <python decorator="dataclass(frozen=True)"> = [
| Lockfile of lockfile_kind
| Manifest of manifest_kind
]

type dependency_source_file = {
kind: dependency_source_file_kind;
path: fpath;
}

type subproject_stats = {
(* The `subproject_id` is derived as a stable hash of the sorted paths of `dependency_source_file`s.
Any change to the set of dependency sources (addition, removal, or modification) results in a new
`subproject_id`, as different dependency sources indicate a different subproject context. *)
subproject_id: string;
(* Files used to determine the subproject's dependencies (lockfiles, manifest files, etc) *)
dependency_sources: dependency_source_file list;
(* Results of dependency resolution, empty if resolution failed *)
?resolved_stats: dependency_resolution_stats option;
}

type supply_chain_stats = {
subprojects_stats: subproject_stats list;
salolivares marked this conversation as resolved.
Show resolved Hide resolved
}

type parsing_stats = {
Expand Down
69 changes: 69 additions & 0 deletions semgrep_output_v1.jsonschema

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 23 additions & 1 deletion semgrep_output_v1.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading