-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add maxLength
validation keywords matching nvarchar
values in archive_catalog
#448
Conversation
maxLength
validation keywords matching nvarchar
values in archive_catalog
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #448 +/- ##
==========================================
+ Coverage 95.45% 95.81% +0.35%
==========================================
Files 4 4
Lines 198 215 +17
==========================================
+ Hits 189 206 +17
Misses 9 9 ☔ View full report in Codecov by Sentry. |
Thanks Brett. That's great. I had forgotten the read_pattern and rotation_matrix cases. I think you're right to ignore these as those lengths were picked to be very large and it's hard to see how they will cause problems. It's also good not to touch TVAC & FPS. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
fc4c405
to
057bf92
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed on pointing to dev for tickets (other PRs will need it as well).
Closes spacetelescope/roman_datamodels#342
Add
maxLength
validation keywords matchingnvarchar
values inarchive_catalog
portions of the schemas. A few cases were not handled:nvarchar(max)
as max is undeterminednvarchar
datatype for non-string values. I don't see any way to enforce these as the thing being validated is not a string. Examples are:rotation_matrix
in mosaic_wcs_inforead_pattern
in exposureThe TVAC and FPS schemas are not updated by this PR.
A test was added to check that these match which walks the schemas looking for
archive_catalog
and if it contains anvarchar
(that isn't max) and if the subschema hastype: string
the test checks the subschema has amaxLength
keyword and that it's value matches the one innvarchar
. As this PR fixes the schemas no errors are seen in the CI but some examples of errors are:maxLength
:AssertionError: archive_catalog has nvarchar, schema asdf://stsci.edu/datamodels/roman/schemas/aperture-1.0.0 is missing maxLength
AssertionError: archive_catalog nvarchar does not match maxLength in schema asdf://stsci.edu/datamodels/roman/schemas/aperture-1.0.0
Regression tests running with this PR and roman_datamodels dev (to pick up changes in spacetelescope/roman_datamodels#388):
https://github.com/spacetelescope/RegressionTests/actions/runs/11060303121
Prior to merging this PR I think it makes sense to set the romancal required version for rad and roman_datamodels to dev (so that subsequent work on rad and roman_datamodels can be tested).
Tasks
rad
tests.docs/
page.no-changelog-entry-needed
.)changes/
:echo "changed something" > changes/<PR#>.<changetype>.rst
(see below for change types).romancal
regression test (https://github.com/spacetelescope/RegressionTests/actions/workflows/romancal.yml) with this branch installed ("git+https://github.com/<fork>/rad@<branch>"
).roman_datamodels
utilities and tests.News fragment change types:
changes/<PR#>.feature.rst
: new featurechanges/<PR#>.bugfix.rst
: fixes an issuechanges/<PR#>.doc.rst
: documentation changechanges/<PR#>.removal.rst
: deprecation or removal of public APIchanges/<PR#>.misc.rst
: infrastructure or miscellaneous change