-
Notifications
You must be signed in to change notification settings - Fork 0
Update registry parser to validate nested structs #453
base: develop
Are you sure you want to change the base?
Update registry parser to validate nested structs #453
Conversation
This commit updates the validator within the registry parser to properly validate nested var_structs. Previously, nested var_structs were ignored entirely by the validator.
For reference, you can define nested var_structs in Registry.xml as follows:
This is an example we would expect to pass, because each one has a unique name. Previously nothing was validated under the top level struct, so something like the following, would have passed but should have failed:
or
|
@douglasjacobsen Is there a particular reason for keeping the commented-out code in parse.c between lines 805 and 1100? If this code is not needed, but is being left as a comment for posterity, we could add an additional commit that remove the code, thereby maintaining a commit ( |
@mgduda You're right, I should have removed those fields. I'm not 100% sure this is ready to merge though, I think some additional questions need to be answered, like what we should do with nested structs that share the same name and should be merged. Does validation happen correctly on these for example? Anyway, this is mostly just a starting place to get to where validation of these complicated registry files is a bit easier. |
In some initial testing, I added the following to the
After making this addition, the build fails with the following error message:
|
@douglasjacobsen As a side note, perhaps we could create a new tag for pull requests that aren't ready to be merged? There's a real danger that a reviewer may not be aware that a PR isn't ready, and might merge the PR after some not-so-thorough testing. |
@mgduda Sure, I've added a "Don't merge" label to the PR. As far as your error goes, we've seen that error before in the ocean core without the modifications in this PR, so I don't think this changes that behavior at all. I haven't investigated what is causing that issue though. In our cases, the fix was to move the stream definition below the variable definition, but I don't see any reason why that should be a requirement. |
I will rebase and test in ocean core. |
This merge updates the validator within the registry parser to properly
validate nested var_structs. Previously, nested var_structs were ignored
entirely by the validator.