-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Updated Valijson to version 0.7, adding date validation for manifests. #2359
Conversation
This doesn't have the actual subtree commits that I would expect, containing the subtree metadata that is needed for future pulls. |
I squashed, which is what we did last time. Do you want me to include the entire history? If so I can force push onto this branch. |
You should |
b31beca
to
22c4986
Compare
Git doesn't seem to generate the two usual commits from a If you have any tips on how I can fix this please let me know, this is getting farther than my Git knowledge usually goes :/ I've force pushed my most recent idea onto this branch. |
@JohnMcPMS is my resident Git expert :) |
I was able to do it like this:
I can create a new PR or push to this if you want (or you can recreate it). |
94d3bfd3 Fix format regex escape sequences 25dcdb1c Merge pull request microsoft#160 from jrave/time-format-fields dee2fa64 Support for time related format fields 5f49d77b Basic structure for format constraint a6a4fbb5 Remove redundant call to baseline 0de61e0c Tidy up readme 1ff36254 Add script to bundle library into a single header 21322b2d Move Adapter and BasicAdapter classes to internal 23724b97 Merge pull request microsoft#159 from jackorobot/fix_poco_get_integer 72afeb1f Fixed PocoJsonValue::getInteger being limited to 32-bit integers 4d603df4 Update Authors file 0e3f48c8 Remove vendored copy of urdl 9e7dbd84 Remove outdated Xcode project files 2f6760f6 Merge pull request microsoft#154 from psigen/yaml-cpp-support f4bbf4e0 Remove non-critical yaml-cpp files from PR. b685584e Add optimization for find implementation. c688aa3b Add a unit test for object member access. 76c9f40c Added simple loading utility. 66424a11 Added a column limit to the file. f03461bb Fixed issue with YAML::Node reference usage. 7f23f369 Fix unit tests to match property tree. 698936ae Added missing dep for YAML-cpp. 328db2f6 Initial pass at yaml-cpp support. 34f75118 Add note about GCC versions to readme 5ca87a61 Remove very obsolete valgrind suppressions file 27d30658 Update vendored jsoncpp to version 1.9.5 c2822576 Update CMakeLists to use add_compile_definitions f9701392 Remove unnecessary indentation from code snippets in readme 7d4ea908 Add boost::json example and delete problematic constructors d34f78b4 Improve error messaging when parsing schemas and documents dd32f66d Build tests for fuzzing 8b5f253c Tweak readme formatting a2e39586 Remove Travis CI config 3940b361 Mention web-based demo in readme f5f979b0 Mention boost compiler warnings in README 80afdef5 Merge pull request microsoft#150 from jonpetri/jonpetri/cmake-improvements 4622b958 Set valijson_BUILD_TESTS OFF by default in cmake 50010fd9 Make VALIJSON_USE_EXCEPTIONS interface definition c5dac2bc Install cmake export file c7d5f2cb Remove valijson_INSTALL_HEADERS from cmake build bfb5860c Fix fuzzer build 7b865438 Merge pull request microsoft#147 from keith-bennett-airmap/keith/shellcheck 1f25558c make shellcheck clean 3c185cb8 Merge pull request microsoft#145 from mporsch/smart-pointer-memory-management 828fc876 use implicit conversion of unique_ptr<T, DeleterA> to unique_ptr<const T, DeleterB> cf841e10 use unique_ptr for memory management in constraints and subschema 4a99dd79 Add missing include 75ada05c Use strong types in external_schema example, and update README 26f3a847 Less const-ness 3eaf1bb9 Add note about VALIJSON_USE_EXCEPTIONS to the README 4990e352 Update inspector to enable and handle exceptions af071f01 Update inspector build to work with Qt6 7b6d22f1 Update CMakeLists.txt to check for boost/json.hpp before building tests 5da89730 Merge pull request microsoft#139 from YangJiao1996/master 0f0cc2bc Always apply callback function when validating schema 9a2ebbde Merge pull request microsoft#137 from veselypeta/readme-cmake e5530feb update README add with cmake git-subtree-dir: src/Valijson/valijson git-subtree-split: 94d3bfd39ad4dca1be0f700b5eea8e4234d0e7e8
This comment was marked as outdated.
This comment was marked as outdated.
22c4986
to
72e25f2
Compare
Nope, I'm just very very silly and can't |
/azp run |
Looks good now. |
Azure Pipelines successfully started running 1 pipeline(s). |
Looks like it is "working", but we have some invalid datetimes in our test data:
Which brings up the next question, are we ok with a breaking change here? I don't know if it only breaks our test data, or if it would also break files in the wild. @denelon, I think this is now enforcing something that has been in the schema the whole time, but with no validation. Even so, it is a potential break in functionality, and I think we need to understand how much impact it would have before we check this in. |
Do we have a method to test? |
I think it would be:
For 4, I'm thinking of things like files generated by tools vs by hand. And if/when those tools may have changed whether they were generating bad or good values. I'm less concerned about manifests being rejected by |
Thinking about this further - Is this something that can be applied only to specific manifest versions? E.g - Can 1.0.0 to 1.2.0 be validated as string, and 1.4.0 be validated as date, to prevent it from breaking existing manifests, but being enforced moving forward? |
My only hesitancy with that is that this has been a rule in the schema from when ReleaseDates were first a thing. The breakage is really with |
@jedieaston is this waiting on us for review or something else? |
This is breaking existing tests and also we don't know how many existing manifests have the date field violation. We need to go through the entire pkgs repo and fix violating manifests before this can be merged. |
@yao-msft - Repology recently removed WinGet due to failing parsing of a date. Based on the commit message, and my own review of the manifests, it seems that all other manifests in winget-pkgs have valid dates. I did correct the invalid date mentioned in the commit, so all manifests at pkgs should now be correct. If @jedieaston fixes the existing tests, would this PR be able to move forward? |
Since this pr is 2 years old, and valijson has 1.0.2 release already, I think we can start a new pr from scratch to update to valijson 1.0.2. The commits should be ideally as few as possible (probably 4 commits: squashed commits...; merge squashed commits; update readme|cgmanifest etc; fix testes). But before sending the pr, we'll need to make sure all manifests work with valijson 1.0.2. And we'll probably want to update the service with new changes quickly. I guess it requires some level of e2e effort. |
Just had a discussion with the team, I'll work on this right away. |
Replaced by #4588 |
Resolves #1725.
This PR updates Valijson to version 0.7, which includes validation for dates and times in JSON Schemas. Without any other changes to winget, this has resolved my core ask from that issue, which was making sure that
ReleaseDates
were actually valid dates.Valijson was updated via
git subtree pull -P src/Valijson/valijson https://github.com/tristanpenman/valijson v0.7 --squash
, just like last time. There was a merge conflict (since we don't have the tests for Valijson in the subtree in this repo), so I just kept the deleted files deleted.@denelon, unless you think we need a better error message I'm happy with this being the fix. I can add an error message in an upcoming PR if you want (so that there aren't other changes mixed in with the Valijson update). If so, I'll make sure the issue doesn't close.
Behold:
Microsoft Reviewers: Open in CodeFlow