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
switch long and lat for geopoint type #286
Conversation
@bajtos Are we okay to merge this? I've opened the 5.x-beta branch as a way to land breaking changes but keep them off master for the time being. |
In the past, when we started to work on a new semver-major version, we created a new branch for the "latest" (4.x in this case) and kept "master" for the work on the upcoming major version. This way the git commit history remains linear. OTOH, when you fork off 5.x-beta branch and then merge it back to master later, then you will have two parallel lines in master history. There is also higher chance of getting merge conflicts, because by the time you merge 5.x-beta back into master, there may be other commits on master that are in conflict with 5.x-beta work. Here is the description of the process we used for LoopBack 3.0: link to gist, see also our internal https://github.com/strongloop-internal/scrum-loopback/issues/601 Last but not least: we need to consider implications for long-term support, as described in http://loopback.io/doc/en/contrib/Long-term-support.html The important practical part is to ensure that each branch we are actively publishing from (3.x, 4.x, etc.) has a unique npm tag, and the tag "latest" is used by the branch containing the stable GA version. For example, strong-remoting's master branch is publishing "3.x" versions tagged as "latest", while the 2.x branch is publishing "2.x" versions tagged as "lts". The section [Publishing pre-release versions] in my gist contains additional information. This is the process we used in LoopBack, it worked pretty well for us IMO. Of course, feel free to choose a different process if it works better for your squad/team. |
See npm/npm#6778 for an explanation why we need different npm tags for different release lines. |
@bajtos PTAL. I've added more checks which make use of MySQL's Point functions and would fail in the old way we saved and loaded the GeoPoint datatype. |
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.
I don't see any obvious problems. LGTM (FWIW).
test/datatypes.test.js
Outdated
}; | ||
var xcor, ycor; | ||
City.create(city1, function(err, res) { | ||
assert.ok(!err); |
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.
FWIW, we use the following pattern in other LoopBack projects - it produces more helpful failure messages:
- assert.ok(!err);
+ if (err) return done(err);
c817a3b
to
01d2504
Compare
MySQL expects reverse order of latitude and longitude from the way we use it in LoopBack, so switch the order when saving and loading Point spatial type we use for Point/GeoPoint.
2af91f0
to
3dad2bf
Compare
Description
MySQL expects reverse order of latitude and longitude from the way we use it in LoopBack, so switch the order when saving and loading Point spatial type we use for Point/GeoPoint.
Related issues
connect to #269
connect to https://github.com/strongloop-internal/scrum-apex/issues/239
Checklist
guide