Skip to content

Commit

Permalink
Merge pull request #21 from ocsf/compat-cache-fix
Browse files Browse the repository at this point in the history
Fixing cache for compatibility validation
  • Loading branch information
query-jeremy authored Aug 21, 2024
2 parents 40db985 + d7c3d94 commit 4fdf732
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "ocsf-lib"
version = "0.8.0"
version = "0.8.1"
description = "Tools for working with the OCSF schema"
authors = ["Jeremy Fisher <[email protected]>"]
readme = "README.md"
Expand Down
15 changes: 15 additions & 0 deletions src/ocsf/compile/planners/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,21 @@ def __init__(self, schema: ProtoSchema, options: CompilationOptions):
super().__init__(schema, options)


# TODO Make the merge/"patch extends" case more explicit
#
# Extensions may modify the core:
# - Dictionary
# - Objects
# - Events
#
# In the case of objects and events, records must _not_ have a `name` property
# AND must have an `extends` property.
#
# While we're at it, events in extensions don't have to be organized in a
# directory structure that matches the core.
#


@dataclass(eq=True, frozen=True)
class ExtensionModifyOp(Operation):
def apply(self, schema: ProtoSchema) -> MergeResult:
Expand Down
8 changes: 4 additions & 4 deletions src/ocsf/validate/compatibility/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@


# Various modules use logging. Configure as you see fit.
# import logging
# import sys
# logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
#import logging
#import sys
#logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)


def main():
Expand All @@ -103,7 +103,7 @@ def main():
help="Path or version number of the old schema. Defaults to 'latest-stable'.",
)
parser.add_argument("after", help="Path or version number of the new schema.")
parser.add_argument("--cache", help="Path to the schema cache directory.")
parser.add_argument("--cache", default="schema_cache", help="Path to the schema cache directory.")
parser.add_argument("--config", help="Path to the config.toml file.")
parser.add_argument("--info", nargs="*", action="append", help="A finding to assign an info severity to.")
parser.add_argument("--warning", nargs="*", action="append", help="A finding to assign a warning severity to.")
Expand Down

0 comments on commit 4fdf732

Please sign in to comment.