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

Client: Validate all metadata files against the schema on repository update #85

Closed
AlexanderDzhoganov opened this issue Oct 17, 2014 · 3 comments
Labels
Core (ckan.dll) Issues affecting the core part of CKAN Enhancement New features or functionality ★☆☆

Comments

@AlexanderDzhoganov
Copy link
Member

This will help us avoid chasing non-existent bugs related to broken metadata files.

@AlexanderDzhoganov AlexanderDzhoganov changed the title Validate all metadata files on repository update Validate all metadata files against the schema on repository update Oct 17, 2014
@AlexanderDzhoganov
Copy link
Member Author

I have implemented this in #83 but there is an issue. The json parser doesn't understand schema version v4 and so the validation throws. How should we go about this?

@pjf pjf added design Enhancement New features or functionality labels Oct 18, 2014
@pjf pjf added this to the Advanced Features. milestone Oct 18, 2014
@pjf
Copy link
Member

pjf commented Oct 18, 2014

The good news is that we're already partially protected against this. Travis runs a full scan over CKAN-meta any time there's an update (or incoming pull request), so it should be very hard to get non-validating data into the default repository.

Part of this can be mitigated simply by us having stronger typing in the client itself. Things like the license field being an enum rather than a simple string, and so on. Some of those types could be automatically generated from the spec itself; our build process already does things like inserting version numbers, it would be a pretty easy change to have it write out some enums and the like.

I've gone looking, but can't find any v4 validators for .NET.

We could try to re-write the schema for v3. It would mean a bunch of things which allow either a string or an an array (licenses, authors, etc) would need to always have arrays, which isn't quite as pretty or human friendly. However my biggest concern is that v3 doesn't support an explicit definitions block, which improves readability and maintenance significantly.

I'm happy for us to improve our internal types for now, and revisit this if we start seeing people hosting their own non-validating repositories. By that time thee might be a working v4 validator for .NET. ;)

@pjf pjf added ★☆☆ Core (ckan.dll) Issues affecting the core part of CKAN and removed design labels Oct 21, 2014
@pjf pjf changed the title Validate all metadata files against the schema on repository update Client: Validate all metadata files against the schema on repository update Oct 21, 2014
@pjf pjf removed this from the Advanced Features. milestone Oct 27, 2014
@AlexanderDzhoganov AlexanderDzhoganov removed this from the Advanced Features. milestone Oct 27, 2014
@HebaruSan
Copy link
Member

Netkan itself (bot included) checks new modules against the schema as of #2788.

I think running this validation in the client should not be done. First, it would be a lot more work during repo updates with a huge performance penalty. Second, if a non-conformant module was detected, the end user probably neither caused this problem nor knows how to do anything about it. Keeping the metadata repo clean accomplishes the same goal in a better way.

@HebaruSan HebaruSan closed this as not planned Won't fix, can't repro, duplicate, stale Jan 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core (ckan.dll) Issues affecting the core part of CKAN Enhancement New features or functionality ★☆☆
Projects
None yet
Development

No branches or pull requests

3 participants