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

Fix schema, make it stricter, add tests #705

Merged
merged 2 commits into from
Dec 13, 2024
Merged

Conversation

cfredric
Copy link
Collaborator

This addresses some of the feedback in #506. Namely:

  • Fixes the expected location of the "contact" property
  • Disallows unexpected properties in the top-level object
  • Disallows unexpected properties in each set entry
  • Requires that each entry's associated sites are unique
  • Requires that each entry's service sites are unique
  • Requires that each entry has at least one of the "associatedSites", "serviceSites", or "ccTLDs" keys

@cfredric cfredric requested a review from arichiv December 13, 2024 17:03
@cfredric cfredric self-assigned this Dec 13, 2024
Copy link

The RWS JSON was successfully validated!

THIS PR CONTAINS SYSTEM CHANGES PLEASE REVIEW WITH CARE!

Copy link
Member

@arichiv arichiv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to see the current schema still passes,

]
}
rws_check = RwsCheck(rws_sites=json_dict, etlds=None, icanns=set(["ca"]))
with self.assertRaises(ValidationError):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for all the tests, it would be nice to test something more specific so you know it's the error you expected and not just any error. It doesn't have to be in this PR (and maybe shouldn't be), but it would be nice to have specificity in the message of the exception or the exception class

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, agreed. I'm not sure if we get fine-grained detail from the schema validator, but it'd be a good thing to look into.

@cfredric cfredric merged commit 8296ccf into GoogleChrome:main Dec 13, 2024
3 checks passed
@cfredric cfredric deleted the schema branch December 13, 2024 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants