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

Refactored namespaces to use maps of objects #89

Merged
merged 5 commits into from
May 9, 2024

Conversation

jaredoconnell
Copy link
Contributor

Also refactored the namespace fields to have defaults provided in the ScalarType struct


By contributing to this repository, I agree to the contribution guidelines.

Also refactored the namespace fields to have defaults provided in the ScalarType struct
Copy link
Contributor

@webbnh webbnh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, this change looks excellent. However, I have a couple of concerns.

First, I appreciate the test clean-up in schema/bool_test.go; however, when we are refactoring code, we should really try to avoid making changes to the tests. (And, I have several other comments on the changes there, as well.)

Second, it seems like the changes to PatternSchema should be analogous to the ones to StringSchema.

Beyond those comments, it looks like there might be some engine fallout from this:

  • It looks like InvalidSerializationDetectorSchema should probably also get the ScalarType treatment.
  • There are a few references to DEFAULT_NAMESPACE.
  • There are a number of references to ApplyScope() which might need or want tweaking:
    • anySchemaWithExpressions.ApplyScope()? (That looks like it's passing a scope where it should be passing a map of objects.)
    • There are calls to ApplyScope() in processInput() and applyAllNamespaces()?

And, I have a few other comments/questions/nits.

schema/bool_test.go Outdated Show resolved Hide resolved
schema/bool_test.go Outdated Show resolved Hide resolved
schema/bool_test.go Outdated Show resolved Hide resolved
schema/pattern.go Outdated Show resolved Hide resolved
schema/ref.go Outdated Show resolved Hide resolved
schema/ref.go Outdated Show resolved Hide resolved
schema/schema.go Outdated Show resolved Hide resolved
schema/scope.go Show resolved Hide resolved
@jaredoconnell
Copy link
Contributor Author

Everything should be addressed. I also added a comment to the ScalarType struct.

schema/types.go Outdated Show resolved Hide resolved
Copy link
Contributor

@webbnh webbnh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good...except I found a typo that you should fix and I'm hoping that we can remove an if statement.

schema/types.go Outdated Show resolved Hide resolved
schema/bool_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@webbnh webbnh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good...unless you missed one.

schema/object_test.go Show resolved Hide resolved
@jaredoconnell jaredoconnell merged commit 64f4589 into main May 9, 2024
3 checks passed
@jaredoconnell jaredoconnell deleted the namespace-refactor branch May 9, 2024 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants