From d9765a79adaf2128497ae4958e39bad0b2f89936 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Fri, 28 Dec 2018 18:32:55 -0200 Subject: [PATCH 1/4] Fix default importer path (#13045) --- packages/rocketchat-importer/server/startup/store.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rocketchat-importer/server/startup/store.js b/packages/rocketchat-importer/server/startup/store.js index ea828a6750ec..d996b1e9af2e 100644 --- a/packages/rocketchat-importer/server/startup/store.js +++ b/packages/rocketchat-importer/server/startup/store.js @@ -6,7 +6,7 @@ export let RocketChatImportFileInstance; Meteor.startup(function() { const RocketChatStore = RocketChatFile.FileSystem; - let path = '~/uploads'; + let path = '/tmp/rocketchat-importer'; if (RocketChat.settings.get('ImportFile_FileSystemPath') != null) { if (RocketChat.settings.get('ImportFile_FileSystemPath').trim() !== '') { path = RocketChat.settings.get('ImportFile_FileSystemPath'); From ba1f1b49de89c1f9db9265ab7cb3d657b8d37d05 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Fri, 28 Dec 2018 18:33:54 -0200 Subject: [PATCH 2/4] Regression: Get room's members list not working on MongoDB 3.2 (#13051) * Revert status filter for members list * Get MongoDB version on statistics --- .../rocketchat-statistics/server/functions/get.js | 11 ++++++++++- server/methods/getUsersOfRoom.js | 10 ++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/packages/rocketchat-statistics/server/functions/get.js b/packages/rocketchat-statistics/server/functions/get.js index df0be96e356a..cc6a70c2f146 100644 --- a/packages/rocketchat-statistics/server/functions/get.js +++ b/packages/rocketchat-statistics/server/functions/get.js @@ -105,9 +105,18 @@ RocketChat.statistics.get = function _getStatistics() { statistics.migration = RocketChat.Migrations._getControl(); statistics.instanceCount = InstanceStatus.getCollection().find({ _updatedAt: { $gt: new Date(Date.now() - process.uptime() * 1000 - 2000) } }).count(); - if (MongoInternals.defaultRemoteCollectionDriver().mongo._oplogHandle && MongoInternals.defaultRemoteCollectionDriver().mongo._oplogHandle.onOplogEntry && RocketChat.settings.get('Force_Disable_OpLog_For_Cache') !== true) { + const { mongo } = MongoInternals.defaultRemoteCollectionDriver(); + + if (mongo._oplogHandle && mongo._oplogHandle.onOplogEntry && RocketChat.settings.get('Force_Disable_OpLog_For_Cache') !== true) { statistics.oplogEnabled = true; } + try { + const { version } = Promise.await(mongo.db.command({ buildInfo: 1 })); + statistics.mongoVersion = version; + } catch (e) { + console.error('Error getting MongoDB version'); + } + return statistics; }; diff --git a/server/methods/getUsersOfRoom.js b/server/methods/getUsersOfRoom.js index a939fa914570..d6bced8f9bc2 100644 --- a/server/methods/getUsersOfRoom.js +++ b/server/methods/getUsersOfRoom.js @@ -39,8 +39,14 @@ Meteor.methods({ 'u.status': 1, }, }, - ...(showAll ? [] : [{ $match: { 'u.status': 'online' } }]), - { $replaceRoot: { newRoot: { $arrayElemAt: ['$u', 0] } } }, + ...(showAll ? [] : [{ $match: { 'u.status': { $in: ['online', 'away', 'busy'] } } }]), + { + $project: { + _id: { $arrayElemAt: ['$u._id', 0] }, + name: { $arrayElemAt: ['$u.name', 0] }, + username: { $arrayElemAt: ['$u.username', 0] }, + }, + }, ]).toArray(), }; }, From e707f7aa701b9e6314a5b74328e511d2d3589408 Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Fri, 28 Dec 2018 18:34:53 -0200 Subject: [PATCH 3/4] Execute tests with versions 3.2, 3.4, 3.6 and 4.0 of MongoDB (#13049) * Execute tests with versions 3.2, 3.4, 3.6 and 4.0 of MongoDB * Reduce duplicated configuration * Fix image inherintence * Fix test of mongo 4 without oplog --- .circleci/config.yml | 208 ++++++++++++++++++++++++++----------------- 1 file changed, 126 insertions(+), 82 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 673ddf13b631..f9b49582f56c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,74 @@ defaults: &defaults working_directory: ~/repo +attach_workspace: &attach_workspace + at: /tmp + +test-install-dependencies: &test-install-dependencies + name: Install dependencies + command: | + wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add - + sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4 + echo "deb [ arch=amd64 ] http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee /etc/apt/sources.list.d/google.list + echo "deb [ arch=amd64 ] http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list + sudo apt-get update + sudo apt-get install -y mongodb-org-shell google-chrome-stable + +test-run: &test-run + name: Run Tests + command: | + for i in $(seq 1 5); do mongo rocketchat --eval 'db.dropDatabase()' && npm test && s=0 && break || s=$? && sleep 1; done; (exit $s) + +test-npm-install: &test-npm-install + name: NPM install + command: | + npm install + +test-store_artifacts: &test-store_artifacts + path: .screenshots/ + +test-configure-replicaset: &test-configure-replicaset + name: Configure Replica Set + command: | + mongo --eval 'rs.initiate({_id:"rs0", members: [{"_id":1, "host":"localhost:27017"}]})' + mongo --eval 'rs.status()' + +test-docker-image: &test-docker-image + circleci/node:8.11-browsers + +test: &test + <<: *defaults + environment: &test-environment + TEST_MODE: "true" + MONGO_URL: mongodb://localhost:27017/rocketchat + + +test-with-oplog: &test-with-oplog + <<: *test + environment: + <<: *test-environment + MONGO_OPLOG_URL: mongodb://localhost:27017/local + + steps: + - attach_workspace: *attach_workspace + - checkout + - run: *test-install-dependencies + - run: *test-configure-replicaset + - run: *test-npm-install + - run: *test-run + - store_artifacts: *test-store_artifacts + +test-without-oplog: &test-without-oplog + <<: *test + steps: + - attach_workspace: *attach_workspace + - checkout + - run: *test-install-dependencies + - run: *test-npm-install + - run: *test-run + - store_artifacts: *test-store_artifacts + + version: 2 jobs: build: @@ -132,91 +200,60 @@ jobs: - store_artifacts: path: /tmp/build - test-with-oplog: - <<: *defaults + + test-with-oplog-mongo-3-2: + <<: *test-with-oplog docker: - - image: circleci/node:8.11-browsers - - image: mongo:4.0 + - image: *test-docker-image + - image: mongo:3.2 command: [mongod, --noprealloc, --smallfiles, --replSet=rs0] - environment: - TEST_MODE: "true" - MONGO_URL: mongodb://localhost:27017/rocketchat - MONGO_OPLOG_URL: mongodb://localhost:27017/local - - steps: - - attach_workspace: - at: /tmp - - - checkout - - - run: - name: Install dependencies - command: | - wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add - - sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4 - echo "deb [ arch=amd64 ] http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee /etc/apt/sources.list.d/google.list - echo "deb [ arch=amd64 ] http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list - sudo apt-get update - sudo apt-get install -y mongodb-org-shell google-chrome-stable - - - run: - name: Configure Replica Set - command: | - mongo --eval 'rs.initiate({_id:"rs0", members: [{"_id":1, "host":"localhost:27017"}]})' - mongo --eval 'rs.status()' - - - run: - name: NPM install - command: | - npm install - - - run: - name: Run Tests - command: | - for i in $(seq 1 5); do mongo rocketchat --eval 'db.dropDatabase()' && npm test && s=0 && break || s=$? && sleep 1; done; (exit $s) - - - store_artifacts: - path: .screenshots/ + test-with-oplog-mongo-3-4: + <<: *test-with-oplog + docker: + - image: *test-docker-image + - image: mongo:3.4 + command: [mongod, --noprealloc, --smallfiles, --replSet=rs0] - test-without-oplog: - <<: *defaults + test-with-oplog-mongo-3-6: + <<: *test-with-oplog docker: - - image: circleci/node:8.11-browsers - - image: circleci/mongo:4.0 + - image: *test-docker-image + - image: mongo:3.6 + command: [mongod, --noprealloc, --smallfiles, --replSet=rs0] - environment: - TEST_MODE: "true" - MONGO_URL: mongodb://localhost:27017/rocketchat + test-with-oplog-mongo-4-0: + <<: *test-with-oplog + docker: + - image: *test-docker-image + - image: mongo:4.0 + command: [mongod, --noprealloc, --smallfiles, --replSet=rs0] - steps: - - attach_workspace: - at: /tmp - - checkout + test-without-oplog-mongo-3-2: + <<: *test-without-oplog + docker: + - image: *test-docker-image + - image: mongo:3.2 - - run: - name: Install dependencies - command: | - wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add - - sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4 - echo "deb [ arch=amd64 ] http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee /etc/apt/sources.list.d/google.list - echo "deb [ arch=amd64 ] http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list - sudo apt-get update - sudo apt-get install -y mongodb-org-shell google-chrome-stable + test-without-oplog-mongo-3-4: + <<: *test-without-oplog + docker: + - image: *test-docker-image + - image: mongo:3.4 - - run: - name: NPM install - command: | - npm install + test-without-oplog-mongo-3-6: + <<: *test-without-oplog + docker: + - image: *test-docker-image + - image: mongo:3.6 - - run: - name: Run Tests - command: | - for i in $(seq 1 5); do mongo rocketchat --eval 'db.dropDatabase()' && npm test && s=0 && break || s=$? && sleep 1; done; (exit $s) + test-without-oplog-mongo-4-0: + <<: *test-without-oplog + docker: + - image: *test-docker-image + - image: mongo:4.0 - - store_artifacts: - path: .screenshots/ deploy: <<: *defaults @@ -378,22 +415,29 @@ workflows: filters: tags: only: /^[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?$/ - - test-with-oplog: - requires: - - build - filters: - tags: - only: /^[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?$/ - - test-without-oplog: + - test-with-oplog-mongo-3-2: &test-mongo requires: - build filters: tags: only: /^[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?$/ + - test-with-oplog-mongo-3-4: *test-mongo + - test-with-oplog-mongo-3-6: *test-mongo + - test-with-oplog-mongo-4-0: *test-mongo + - test-without-oplog-mongo-3-2: *test-mongo + - test-without-oplog-mongo-3-4: *test-mongo + - test-without-oplog-mongo-3-6: *test-mongo + - test-without-oplog-mongo-4-0: *test-mongo - deploy: requires: - - test-with-oplog - - test-without-oplog + - test-with-oplog-mongo-3-2 + - test-with-oplog-mongo-3-4 + - test-with-oplog-mongo-3-6 + - test-with-oplog-mongo-4-0 + - test-without-oplog-mongo-3-2 + - test-without-oplog-mongo-3-4 + - test-without-oplog-mongo-3-6 + - test-without-oplog-mongo-4-0 filters: branches: only: develop From c413a571ee1b3caeb5d0a7ccfdccf96852a340de Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Fri, 28 Dec 2018 19:11:20 -0200 Subject: [PATCH 4/4] Bump version to 0.73.1 --- .docker/Dockerfile.rhel | 2 +- .github/history.json | 39 +++++++++++++++++++++++++ .sandstorm/sandstorm-pkgdef.capnp | 4 +-- .travis/snap.sh | 2 +- HISTORY.md | 27 ++++++++++++++++- package.json | 2 +- packages/rocketchat-lib/rocketchat.info | 2 +- 7 files changed, 71 insertions(+), 7 deletions(-) diff --git a/.docker/Dockerfile.rhel b/.docker/Dockerfile.rhel index b560232d317f..858fab195fcf 100644 --- a/.docker/Dockerfile.rhel +++ b/.docker/Dockerfile.rhel @@ -1,6 +1,6 @@ FROM registry.access.redhat.com/rhscl/nodejs-8-rhel7 -ENV RC_VERSION 0.73.0 +ENV RC_VERSION 0.73.1 MAINTAINER buildmaster@rocket.chat diff --git a/.github/history.json b/.github/history.json index 7df06d8a445f..28128902518c 100644 --- a/.github/history.json +++ b/.github/history.json @@ -24468,6 +24468,45 @@ ] } ] + }, + "0.73.1": { + "node_version": "8.11.4", + "npm_version": "6.4.1", + "mongo_versions": [ + "3.2", + "3.4", + "3.6", + "4.0" + ], + "pull_requests": [ + { + "pr": "13049", + "title": "Execute tests with versions 3.2, 3.4, 3.6 and 4.0 of MongoDB", + "userLogin": "rodrigok", + "milestone": "0.73.1", + "contributors": [ + "rodrigok" + ] + }, + { + "pr": "13051", + "title": "Regression: Get room's members list not working on MongoDB 3.2", + "userLogin": "sampaiodiego", + "milestone": "0.73.1", + "contributors": [ + "sampaiodiego" + ] + }, + { + "pr": "13045", + "title": "[FIX] Default importer path", + "userLogin": "sampaiodiego", + "milestone": "0.73.1", + "contributors": [ + "sampaiodiego" + ] + } + ] } } } \ No newline at end of file diff --git a/.sandstorm/sandstorm-pkgdef.capnp b/.sandstorm/sandstorm-pkgdef.capnp index 7652abd2dddd..ca5d7e281bff 100644 --- a/.sandstorm/sandstorm-pkgdef.capnp +++ b/.sandstorm/sandstorm-pkgdef.capnp @@ -19,9 +19,9 @@ const pkgdef :Spk.PackageDefinition = ( appTitle = (defaultText = "Rocket.Chat"), - appVersion = 121, # Increment this for every release. + appVersion = 122, # Increment this for every release. - appMarketingVersion = (defaultText = "0.73.0"), + appMarketingVersion = (defaultText = "0.73.1"), # Human-readable representation of appVersion. Should match the way you # identify versions of your app in documentation and marketing. diff --git a/.travis/snap.sh b/.travis/snap.sh index b291d0915473..482f73d3d650 100755 --- a/.travis/snap.sh +++ b/.travis/snap.sh @@ -17,7 +17,7 @@ elif [[ $TRAVIS_TAG ]]; then RC_VERSION=$TRAVIS_TAG else CHANNEL=edge - RC_VERSION=0.73.0 + RC_VERSION=0.73.1 fi echo "Preparing to trigger a snap release for $CHANNEL channel" diff --git a/HISTORY.md b/HISTORY.md index 1a38d7436dce..8d8f379d1306 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,6 +1,31 @@ +# 0.73.1 +`2018-12-28 ยท 1 ๐Ÿ› ยท 2 ๐Ÿ” ยท 2 ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป` + +### Engine versions +- Node: `8.11.4` +- NPM: `6.4.1` +- MongoDB: `3.2, 3.4, 3.6, 4.0` + +### ๐Ÿ› Bug fixes + +- Default importer path ([#13045](https://github.com/RocketChat/Rocket.Chat/pull/13045)) + +
+๐Ÿ” Minor changes + +- Execute tests with versions 3.2, 3.4, 3.6 and 4.0 of MongoDB ([#13049](https://github.com/RocketChat/Rocket.Chat/pull/13049)) +- Regression: Get room's members list not working on MongoDB 3.2 ([#13051](https://github.com/RocketChat/Rocket.Chat/pull/13051)) + +
+ +### ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป Core Team ๐Ÿค“ + +- [@rodrigok](https://github.com/rodrigok) +- [@sampaiodiego](https://github.com/sampaiodiego) + # 0.73.0 -`2018-12-27 ยท 10 ๐ŸŽ‰ ยท 9 ๐Ÿš€ ยท 34 ๐Ÿ› ยท 84 ๐Ÿ” ยท 26 ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป` +`2018-12-28 ยท 10 ๐ŸŽ‰ ยท 9 ๐Ÿš€ ยท 34 ๐Ÿ› ยท 84 ๐Ÿ” ยท 26 ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป` ### Engine versions - Node: `8.11.4` diff --git a/package.json b/package.json index 008c027f142e..4b5ee2a5260a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "Rocket.Chat", "description": "The Ultimate Open Source WebChat Platform", - "version": "0.73.0", + "version": "0.73.1", "author": { "name": "Rocket.Chat", "url": "https://rocket.chat/" diff --git a/packages/rocketchat-lib/rocketchat.info b/packages/rocketchat-lib/rocketchat.info index 808c4e6d16ca..e27cf6ae0436 100644 --- a/packages/rocketchat-lib/rocketchat.info +++ b/packages/rocketchat-lib/rocketchat.info @@ -1,3 +1,3 @@ { - "version": "0.73.0" + "version": "0.73.1" }