-
Couldn't load subscription status.
- Fork 8
feat(autocomplete): add type generator from the php yaml definitions MONGOSH-2030 #521
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
Conversation
… have a schema defined
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.
Amazing work @nirinchev! ✨
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.
Great work! Like I explained I think we probably don't need 7fc9890 anymore. Up to you if you want to remove it again.
Description
Adds generators for the aggregation stages using the yaml definitions from https://github.com/mongodb-js/mongo-php-library/tree/v1.x/generator/config.
Three generators are added to process the yaml definitions:
schema-generator.tsgenerates a typescript schema from the yaml definitions which can be used to autocomplete aggregation stages. Notable limitations of the current schema include:$unset: [ 'foo.bar' ]$addFields,$project, etc. will not reflect the new collection schema$lookup.let)SearchScore,GeoPoint, etc.)driver-schema-generator.tsgenerates the schema for the tests in the php yaml library. It does this by infering the schema from the documentation.test-generator.tsgenerates tests from the yaml definitions. Those are not functional tests, but rather verify that the code compiles - that is, the schema definition does not generate false negatives. They don't attempt to verify that the autocompletion always suggests precise results though - i.e. a schema definition where everything isanywould pass all the tests in this PR. Validating autocomplete results are helpful is a follow-up task that will be done when we integrate all the autocomplete tickets together.Open Questions
We probably want to get mongodb/mongo-php-library#1659 eventually merged to ensure we don't diverge too far from upstream.