-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Support custom source for parents #128
Conversation
It's possible to change this to |
e8edf35
to
73c492a
Compare
Ha ha okay thx, I updated to 6 🤷♂️ |
73c492a
to
8aef699
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.
This is good to merge but not until after pelias/schema#459
Once this is published the new version of pelias/model
will not be backwards compatible since it tries to add data to fields which don't exist and the schema uses dynamic: 'strict'
I'll look at merging the pelias/schema
PR now so we can stay ahead of this
Okay so schema is merged, I'm not sure what to do about this breaking change... @orangejulius what's the safest way to release this? |
Yes that's right, this should be marked as a breaking change and likewise we should do major version bumps on all the importers when we merge the dependency update. Since we merged the schema PR already, we can be extra sure that the commit messages and therefore release notes mention the required schema version to minimize confusion. We've also found that waiting a few weeks after the schema change is usually enough to prevent too many people from having problems. |
I guess one other option is to have a post processing step which checks if these fields are just filled with That would mean it remains backwards compatible as long as the importers don't ever pass a 5th argument to And realistically that's not going to happen until we do a general release of Spatial for PIP, I'd hope by then enough time has passed. |
Yeah actually that sounds a lot simpler. It's still a breaking change but since none of the importers (except maybe CSV) will use it in the near future, it probably won't impact anyone. |
Also worth noting that if someone is using a modern version of The error message might not be super user friendly though... |
Hmm yeah. Random errors that are thrown by Elasticsearch when an import attempts to write to a missing field will probably not be user friendly for people running the importers. What would be amazing but probably a lot more work is if the Pelias Model code made a single call to get the Elasticsearch mapping when it first started up, and then used that to validate required fields before writing any documents. Might be worth implementing in the long run though (as a separate PR). |
So, I should remove the else clause here for backward compatibility ? Lines 375 to 379 in 8aef699
|
Let's hold off for now, I'm hoping we can just merge it as-is. After another couple weeks the only developers who are going to get affected by the breaking change are those trying to reimport using a new importer version on an old schema version, which I'm assuming to be fairly rare. |
There is another potentially breaking change we might consider merging at the same time as this |
Happy 2021, @orangejulius @Joxit what's the plan for getting this out the door, suggestions? |
Happy 2021 😄 pelias/schema#459 was merged in August, so breaking change here and feature change in importers ? |
8aef699
to
3182583
Compare
rebased to master |
please mark it as a |
BREAKING CHANGE: new `parent.*_source` field added in ES Document. Since the schema is strict, this version needs pelias-schema v6.1.0. See changelog https://github.com/pelias/schema/releases/tag/v6.1.0
3182583
to
eb8414c
Compare
Marked as BREAKING CHANGE 👍 |
🥳 |
Very nice and gotta say the commit translated to release notes perfectly, with a link to the relevant schema PR and everything (https://github.com/pelias/model/releases/tag/v9.0.0). This may not sound impressive, but we often get it wrong too, so ... 👍 |
thanks 😊 |
Background
At the time of this PR, when we build the hierarchy, we use pelias/pip-service which is an In Memory Point-In-Polygon lookup service based on WOF data. That means, when we have something in the hierarchy, it's necessarily from WOF.
As a result, in the API, when we retrieve data from PIP Service, the source WOF is hard-codded.
The future of PIP is pelias/spatial which supports a plethora of sources. I start the work for a smooth integration from the beginning.
What's new ?
Since spatial is not yet used, the source will always be
null
and the code is 100% backward compatible.I changed the fourth parameter to an object because the linter says :Document.js: line 319, col 40, This function has too many parameters. (5)
for a new parameter.If the fourth parameter is a string, that means that it's an abbreviation, and if it's an object, it should contains abbr and/or source.
I added a fifth parameter for the source.