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

Move generic schemas from Resource to kinto.core #1054

Merged
merged 5 commits into from
Feb 9, 2017

Conversation

gabisurita
Copy link
Member

@gabisurita gabisurita commented Feb 1, 2017

Related to #1033

This allow importing generic schemas on other parts of kinto core without breaking the import order.

  • Add a CHANGELOG entry.

This is needed to allow importing generic schemas on other parts
of kinto core without breaking the import order.

Related to Kinto#1033
@gabisurita gabisurita force-pushed the move-generic-schemas branch from cbe1336 to ea52f52 Compare February 1, 2017 21:48
5.3.2 is already released and some merges were listed on the wrong
version.
- Request schemas (including validation and deserialization) are now isolated by method
and endpoint type (#1047).
- Move generic API schemas (e.g TimeStamps and HeaderFields) from `kinto.core.resource.schema`
to a sepate file on `kinto.core.schema`.
Copy link
Contributor

Choose a reason for hiding this comment

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

I remember we had that before, and we changed... What does the docs say? Will the old location still be accesible? deprecated?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

@gabisurita gabisurita Feb 1, 2017

Choose a reason for hiding this comment

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

Hmm, that's interesting. I agree ResourceSchema should be on kinto.core.resource because it's only related to the resource (and I'm keeping it there), but I'm not so sure about other things like Timestamps or Header fields that could be reused in other parts of the core.

Most of these schemas are imported on kinto.core.resource so they are still accessible. Only Timestamp and URL aren't, and they aren't used anywhere on Kinto. Do you know why we have them there?

Copy link
Contributor

@leplatrem leplatrem Feb 1, 2017

Choose a reason for hiding this comment

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

Do you know why we have them there?

Originally (archeology) they were in core because we thought they were common types of fields. They're just used in third parties or plugins. We can deprecated them, no worries.

Copy link
Member Author

@gabisurita gabisurita Feb 2, 2017

Choose a reason for hiding this comment

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

We can deprecated them, no worries.

OK. I don't have a strong opinion about it. We can keep them too. In case we deprecate or move them, do you think we should add warning messages or we can just make it a breaking change?

Copy link
Member Author

Choose a reason for hiding this comment

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

About the documentation: I couldn't fond mentions to these schemas anywhere. Also in some parts we use a colander String with url validator to implement an url instead of the URL schema.

Copy link
Contributor

@glasserc glasserc left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM!

@@ -0,0 +1,110 @@
import six
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be nice to have a module-level docstring explaining what's supposed to go in this file vs. what goes in kinto.core.resource.schema.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't see many module-level docstrings on kinto.core (__init__.py is the only exception), that's why I didn't use them, but I agree it would be nice to have this written in the code somewhere.

Keep backward compatibility from all the schemas moved from
`kinto.core.resource.schema` to `kinto.core.schema` by keeping a
deprecated reference to the missing schemas (URL and TimeStamp).

Also set a docstring on `kinto.core.schema` saying which schemas
should be included there and instructions to where other schemas
should live.
@gabisurita gabisurita requested a review from leplatrem February 8, 2017 11:20
- Upgraded to Kinto-Admin 1.8.1
- Configure the Kinto Admin auth methods from the server configuration (#1042)
- Request schemas (including validation and deserialization) are now isolated by method
and endpoint type (#1047).
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these deletions expected?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, these are unreleased. They probably got there by a problem in some auto merge.

@gabisurita gabisurita merged commit 11b9c26 into Kinto:master Feb 9, 2017
@gabisurita gabisurita deleted the move-generic-schemas branch February 9, 2017 16:15
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.

3 participants