-
Notifications
You must be signed in to change notification settings - Fork 155
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
Define the validation configuration options #224
Comments
There currently is a draft for configuration options support at #247 (a very early state for now). I think that it could make sense to split the "configuration" into two levels:
The idea of the configuration for the validator run is to have
Its top-level elements correspond (exactly) to the official command line arguments. This would allow to define different "standard runs" for the validator solely within the config file, which then completely replaces the (other) command line arguments, and could just be passed in as The options for the validation process are then stored in the Which of the options that are mentioned in the first post are supposed to be supported at which stage is not yet clear. But a rough idea was to extend these options to selectively configure the handling of certain content types. The question about how to encode this in JSON is not entirely obvious. A rough idea would be to have a structure like this:
which would be translated as
(The intention is to eventually address this comment in the (An aside: It would probably make sense to then also add an Unrelated/TODO: The build is currently failing at the linting step, which is checking |
The latest state extends the validation options with more fine-grained control about the validated content types. This is not yet fully and deeply configurable as drafted above, because the question of how exactly to configure the validation process for each type has to be sorted out. But a reasonable first step is that it is possible to define which content types should be validated at all. The
(When Running the validator with
using the following
will report the invalid B3DM. Removing the The state has to be further tested and reviewed. But general feedback about the approach (config file format, content type definitions, etc) can be added here. Note: The latest change also fixes a critical bug that severly limits the usability of the validator as a library: The registration of the known content type (and extension) validators had only be done in |
Just to keep track of why certain things are done in a way that appears to be ... awkward at the first glance: As mentioned int he previous comment, there are things that have to be done once - like globally registering validators for the different content types. Theoretically, this should be done with static initializer blocks, like so...
One has to be very careful about where this block is inserted, because the blocks and fields are processed in textual order within one class (see https://v8.dev/features/class-static-initializer-blocks ). But even then, things fall apart pretty quickly: When there are two different classes that contain such blocks, it's everything but clear which part of which class is initialized at which point in time. It might theoretically be possible to derive that from ... some specification. But the knowledge that has to go into that and the brittleness of the result (which might break "unexplicably" for someone who doesn't know the details of the initialization order) made me think that the somewhat |
One question about how the validated content types should be configured appears to be a very high-level one. Namely, whether the content types should be included or excluded explicitly via the configuration settings. Both cases can have different effects when the validator is updated:
It's hard to predict which behavior is the more desirable one. Therefore, the
|
The current state is part of the 0.2.0 release. This does not involve stability guarantees, and is offered as a "preview" and to gather feedback. Therefore, I'll leave this issue open for now, but any comments about the current approach should still be posted here. |
There may be different options or settings that affect the validation process in various ways. These options are currently drafted in the
ValidationOptions.ts
class. For now, this only contains a flagvalidateContentData
, which determines whether tile content data is resolved and validated. But this is really just a "placeholder", to show the intended usage. There is not even a way to programmatically set this flag...The comment in the
ValidationOptions.ts
already mentions some other possible configuration options:["B3DM", "GLB"]
schemaUri
should be validatedhttps://example.com/data.glb
The desired granularity, structure and representation of these options is certainly not obvious. For example,
validateContentTypes
would be a more fine-grained version ofvalidateContentData
, as invalidateContentData=true
corresponding tovalidateContentTypes=[B3DM, I3DM, CMPT, PNTS, GLB, GLTF]
validateContentData=false
corresponding tovalidateContentTypes=[]
And one could generalize that arbitrarily - up to
validateStuffWithThisGlobPattern="*.{glb,b3dm}"
...From the "consuming" API side, most of this could probably boil down to a function like
shouldValidate(uri) : boolean
. This function could internally check a flag, or check the file extension to be contained in the list, or check a glob pattern. But the question about how these options will be configured, programmatically or via the command line, still has to be answered.Another dimension of possible configuration options refers to the questions of
In the worst case, this might affect the whole validation process itself.
The current approach or idea is to always perform all validations and report all issues. If somebody wants to "ignore" certain issues, then this can be achieved by filtering the
ValidationResult
. For example, as inresult.removeAll(severity=WARNING)
.But the question about the degrees of freedom for the configuration is still non-trivial. For eample, the approach of filtering the
ValidationResult
does not allow the user to ignore issues depending on the context. For example, someone might want to ignoreBOUNDING_VOLUME_INCONSISTENT
errors when they refer to bounding spheres, but not when they refer to bounding regions. This fine-grained configurability would not be possible now, and not trivial to implement generically.A "combination" of the questions raised above is: How should the validator handle resources that can not be resolved? When performing the validation on the local file system, with a (supposedly!) complete tileset, then it should probably be possible to resolve all resources, and when one of them can not be resolved, it should be an ERROR. In other cases, a non-resolvable resource might only be considered to be a WARNING, and not necessarily cause the validation to fail.
The text was updated successfully, but these errors were encountered: