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

Add support for MongoDB 3.4 #3185

Merged
merged 39 commits into from Feb 9, 2017
Merged

Add support for MongoDB 3.4 #3185

merged 39 commits into from Feb 9, 2017

Conversation

Kami
Copy link
Member

@Kami Kami commented Feb 6, 2017

This pull request updates pymongo and mongoengine dependencies to latest versions which also support MongoDB 3.4.

In addition to that it also makes various other changes to the code to make it work with newest versions of those libraries (some backward incompatible changes were introduced).

Closes #3100.

TODO

@Kami
Copy link
Member Author

Kami commented Feb 6, 2017

@enykeev I will probably need to update Circle CI scripts to they support installing and testing with multiple MongoDB versions.

I spent time on that in the past for Travis CI and it worked (we had tests running with MongoDB 2.6 and 3.2), but we introduced a "regression" when moving to Circle CI with regards to that aka we now only test with one version :/

I think I already expressed my "concerns" about that in the past, but don't remember why we excluded support for multiple versions.

@codecov-io
Copy link

codecov-io commented Feb 6, 2017

Codecov Report

Merging #3185 into master will increase coverage by 0.05%.

@@            Coverage Diff             @@
##           master    #3185      +/-   ##
==========================================
+ Coverage   77.81%   77.86%   +0.05%     
==========================================
  Files         433      433              
  Lines       22390    22398       +8     
==========================================
+ Hits        17421    17438      +17     
+ Misses       4969     4960       -9
Impacted Files Coverage Δ
st2common/st2common/persistence/db_init.py 73.33% <ø> (ø)
st2common/st2common/models/db/stormbase.py 97.89% <100%> (ø)
st2common/st2common/models/db/init.py 96.28% <88.89%> (-2.06%)
st2common/st2common/persistence/base.py 91.98% <ø> (-3.21%)
st2common/st2common/transport/consumers.py 86.32% <ø> (-3.16%)
st2common/st2common/bootstrap/actionsregistrar.py 93.22% <ø> (-2.54%)
st2actions/st2actions/container/base.py 90.59% <ø> (-1.76%)
st2api/st2api/controllers/resource.py 86.78% <ø> (-1.65%)
st2common/st2common/rbac/decorators.py 84.38% <ø> (-1.56%)
... and 20 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3a61556...d56dea5. Read the comment docs.

@Kami
Copy link
Member Author

Kami commented Feb 7, 2017

I got the builds with two different MongoDB versions working on Circle CI (see diff for corresponding circle.yml and script changes).

Sadly Circle CI user interface is very user-unfriendly and terrible when running multiple things in parallel (it doesn't support build Matrix like Travis CI does which makes it hard to see what is going on).

I will see what I can do to to make it more user-friendly and easier to see which MongoDB version is being used, etc.

In addition to that, it looks like there are still some MongoDB 3.4 related code issues I need to fix (3.4 perform more script index validation, etc. - https://docs.mongodb.com/manual/release-notes/3.4-compatibility/#stricter-validation-of-index-specifications)

@Kami
Copy link
Member Author

Kami commented Feb 7, 2017

All the unit and integration tests are passing with MongoDB 3.2 and 3.4 on CircleCI now.

I will do some more polish and work on a corresponding documentation PR then I will consider this done and ready for the review.

I plan to update the installer scripts to install 3.4 by default in the near future when we have more testing with 3.4 under the belt, but we should still update the blog and release announcement and let people know that since StackStorm v2.2.0 we now also support MongoDB 3.4.

@Kami Kami changed the title [WIP] Add support for MongoDB 3.4 Add support for MongoDB 3.4 Feb 7, 2017
@Kami Kami mentioned this pull request Feb 7, 2017
CHANGELOG.rst Outdated
@@ -49,6 +49,8 @@ in development
put the workflow in a PAUSED state in mistral. (improvement)
* Add support for evaluating jinja expressions in mistral workflow definition where yaql
expressions are typically accepted. (improvement)
* Update the dependencies and the code base so we now also support MongoDB 3.4. Officially
supported MongoDB versions are now MongoDB 3.2 and 3.4. (improvement)
Copy link
Member

Choose a reason for hiding this comment

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

I would put a note in here that clarifies that the default for the installer is still 3.2


# Note: MongoDB 2.4 and 2.6 don't work with ramdisk since they don't work with
# small files and require at least 3 GB of space
# TODO: Use ramdisk
Copy link
Member

Choose a reason for hiding this comment

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

Is this something you wanted to do in this PR or is this for future?

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 in the future - but I will actually remove this note all together since on Circle CI ramdisk doesn't seem to make much difference (probably because of virtualzed memory)

# Script which installs versions of MongoDB specified using an environment variable

if [ ! "${MONGODB_VERSION}" ]; then
echo "MONGODB_VERSION environment variable not set"
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice to provide a list of supported versions in this error message.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed - will update it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, that's a bit hard since it's not a static list - it will work with any version which is available on MongoDB mirrors...

Copy link
Contributor

@m4dcoder m4dcoder left a comment

Choose a reason for hiding this comment

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

Except for a minor comment on the error message regarding the mongodb version, this patch LGTM.

@Kami Kami merged commit 61800d8 into master Feb 9, 2017
@Kami Kami deleted the upgrade_pymongo_and_mongoengine branch February 9, 2017 15:50
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.

None yet

4 participants