From 710f9106c52932a46acabf88b10b1617c9cd6181 Mon Sep 17 00:00:00 2001 From: Caesar Bell Date: Thu, 2 May 2024 13:05:15 -0400 Subject: [PATCH 01/10] :package: DOP-4497 updtes the mongodb node driver --- package-lock.json | 207 +++++++++++++++++++++++++++++++++++++--------- package.json | 2 +- 2 files changed, 170 insertions(+), 39 deletions(-) diff --git a/package-lock.json b/package-lock.json index 22a1bdde3..b7ecfbb80 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,7 +28,7 @@ "fs-extra": "^7.0.1", "jest-mock-extended": "^2.0.2-beta2", "js-yaml": "^3.13.1", - "mongodb": "^5.1.0", + "mongodb": "6.5", "simple-git": "^2.45.1", "tsscmp": "^1.0.6", "validator": "^10.11.0" @@ -5986,6 +5986,14 @@ "resolved": "https://registry.npmjs.org/@kwsites/promise-deferred/-/promise-deferred-1.1.1.tgz", "integrity": "sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw==" }, + "node_modules/@mongodb-js/saslprep": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.5.tgz", + "integrity": "sha512-XLNOMH66KhJzUJNwT/qlMnS4WsNDWD5ASdyaSH3EtK+F4r/CFGa3jT4GNi4mfOitGvWXtdLgQJkQjxSVrio+jA==", + "dependencies": { + "sparse-bitfield": "^3.0.3" + } + }, "node_modules/@nicolo-ribaudo/chokidar-2": { "version": "2.1.8-no-fsevents.3", "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz", @@ -7958,6 +7966,7 @@ "version": "8.2.2", "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-8.2.2.tgz", "integrity": "sha512-FtQu10RWgn3D9U4aazdwIE2yzphmTJREDqNdODHrbrZmmMqI0vMheC/6NE/J1Yveaj8H+ela+YwWTjq5PGmuhA==", + "dev": true, "dependencies": { "@types/node": "*", "@types/webidl-conversions": "*" @@ -9131,11 +9140,11 @@ } }, "node_modules/bson": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/bson/-/bson-5.3.0.tgz", - "integrity": "sha512-ukmCZMneMlaC5ebPHXIkP8YJzNl5DC41N5MAIvKDqLggdao342t4McltoJBQfQya/nHBWAcSsYRqlXPoQkTJag==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/bson/-/bson-6.6.0.tgz", + "integrity": "sha512-BVINv2SgcMjL4oYbBuCQTpE3/VKOSxrOA8Cj/wQP7izSzlBGVomdm+TcUd0Pzy0ytLSSDweCKQ6X3f5veM5LQA==", "engines": { - "node": ">=14.20.1" + "node": ">=16.20.1" } }, "node_modules/buffer": { @@ -12957,7 +12966,8 @@ "node_modules/ip": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", - "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==" + "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==", + "devOptional": true }, "node_modules/is-arguments": { "version": "1.1.1", @@ -17292,8 +17302,7 @@ "node_modules/memory-pager": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", - "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==", - "optional": true + "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==" }, "node_modules/merge-stream": { "version": "2.0.0", @@ -17475,34 +17484,47 @@ } }, "node_modules/mongodb": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-5.6.0.tgz", - "integrity": "sha512-z8qVs9NfobHJm6uzK56XBZF8XwM9H294iRnB7wNjF0SnY93si5HPziIJn+qqvUR5QOff/4L0gCD6SShdR/GtVQ==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.5.0.tgz", + "integrity": "sha512-Fozq68InT+JKABGLqctgtb8P56pRrJFkbhW0ux+x1mdHeyinor8oNzJqwLjV/t5X5nJGfTlluxfyMnOXNggIUA==", "dependencies": { - "bson": "^5.3.0", - "mongodb-connection-string-url": "^2.6.0", - "socks": "^2.7.1" + "@mongodb-js/saslprep": "^1.1.5", + "bson": "^6.4.0", + "mongodb-connection-string-url": "^3.0.0" }, "engines": { - "node": ">=14.20.1" - }, - "optionalDependencies": { - "saslprep": "^1.0.3" + "node": ">=16.20.1" }, "peerDependencies": { - "@aws-sdk/credential-providers": "^3.201.0", - "mongodb-client-encryption": ">=2.3.0 <3", - "snappy": "^7.2.2" + "@aws-sdk/credential-providers": "^3.188.0", + "@mongodb-js/zstd": "^1.1.0", + "gcp-metadata": "^5.2.0", + "kerberos": "^2.0.1", + "mongodb-client-encryption": ">=6.0.0 <7", + "snappy": "^7.2.2", + "socks": "^2.7.1" }, "peerDependenciesMeta": { "@aws-sdk/credential-providers": { "optional": true }, + "@mongodb-js/zstd": { + "optional": true + }, + "gcp-metadata": { + "optional": true + }, + "kerberos": { + "optional": true + }, "mongodb-client-encryption": { "optional": true }, "snappy": { "optional": true + }, + "socks": { + "optional": true } } }, @@ -17510,6 +17532,7 @@ "version": "2.6.0", "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-2.6.0.tgz", "integrity": "sha512-WvTZlI9ab0QYtTYnuMLgobULWhokRjtC7db9LtcVfJ+Hsnyr5eo6ZtNAt3Ly24XZScGMelOcGtm7lSn0332tPQ==", + "dev": true, "dependencies": { "@types/whatwg-url": "^8.2.1", "whatwg-url": "^11.0.0" @@ -17519,6 +17542,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", + "dev": true, "dependencies": { "punycode": "^2.1.1" }, @@ -17530,6 +17554,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "dev": true, "engines": { "node": ">=12" } @@ -17538,6 +17563,7 @@ "version": "11.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", + "dev": true, "dependencies": { "tr46": "^3.0.0", "webidl-conversions": "^7.0.0" @@ -17693,6 +17719,54 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, + "node_modules/mongodb/node_modules/@types/whatwg-url": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-11.0.4.tgz", + "integrity": "sha512-lXCmTWSHJvf0TRSO58nm978b8HJ/EdsSsEKLd3ODHFjo+3VGAyyTp4v50nWvwtzBxSMQrVOK7tcuN0zGPLICMw==", + "dependencies": { + "@types/webidl-conversions": "*" + } + }, + "node_modules/mongodb/node_modules/mongodb-connection-string-url": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.0.tgz", + "integrity": "sha512-t1Vf+m1I5hC2M5RJx/7AtxgABy1cZmIPQRMXw+gEIPn/cZNF3Oiy+l0UIypUwVB5trcWHq3crg2g3uAR9aAwsQ==", + "dependencies": { + "@types/whatwg-url": "^11.0.2", + "whatwg-url": "^13.0.0" + } + }, + "node_modules/mongodb/node_modules/tr46": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", + "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==", + "dependencies": { + "punycode": "^2.3.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/mongodb/node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "engines": { + "node": ">=12" + } + }, + "node_modules/mongodb/node_modules/whatwg-url": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-13.0.0.tgz", + "integrity": "sha512-9WWbymnqj57+XEuqADHrCJ2eSXzn8WXIW/YSGaZtb2WKAInQ6CHfaUUcTyyver0p8BDg5StLQq8h1vtZuwmOig==", + "dependencies": { + "tr46": "^4.1.1", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -19315,6 +19389,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.3.tgz", "integrity": "sha512-/MY/PEMbk2SuY5sScONwhUDsV2p77Znkb/q3nSVstq/yQzYJOH/Azh29p9oJLsl3LnQwSvZDKagDGBsBwSooag==", + "dev": true, "optional": true, "dependencies": { "sparse-bitfield": "^3.0.3" @@ -20009,6 +20084,7 @@ "version": "4.2.0", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "devOptional": true, "engines": { "node": ">= 6.0.0", "npm": ">= 3.0.0" @@ -20018,6 +20094,7 @@ "version": "2.7.1", "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", + "devOptional": true, "dependencies": { "ip": "^2.0.0", "smart-buffer": "^4.2.0" @@ -20083,7 +20160,6 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", "integrity": "sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==", - "optional": true, "dependencies": { "memory-pager": "^1.0.2" } @@ -26543,6 +26619,14 @@ "resolved": "https://registry.npmjs.org/@kwsites/promise-deferred/-/promise-deferred-1.1.1.tgz", "integrity": "sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw==" }, + "@mongodb-js/saslprep": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.5.tgz", + "integrity": "sha512-XLNOMH66KhJzUJNwT/qlMnS4WsNDWD5ASdyaSH3EtK+F4r/CFGa3jT4GNi4mfOitGvWXtdLgQJkQjxSVrio+jA==", + "requires": { + "sparse-bitfield": "^3.0.3" + } + }, "@nicolo-ribaudo/chokidar-2": { "version": "2.1.8-no-fsevents.3", "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz", @@ -28219,6 +28303,7 @@ "version": "8.2.2", "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-8.2.2.tgz", "integrity": "sha512-FtQu10RWgn3D9U4aazdwIE2yzphmTJREDqNdODHrbrZmmMqI0vMheC/6NE/J1Yveaj8H+ela+YwWTjq5PGmuhA==", + "dev": true, "requires": { "@types/node": "*", "@types/webidl-conversions": "*" @@ -29084,9 +29169,9 @@ } }, "bson": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/bson/-/bson-5.3.0.tgz", - "integrity": "sha512-ukmCZMneMlaC5ebPHXIkP8YJzNl5DC41N5MAIvKDqLggdao342t4McltoJBQfQya/nHBWAcSsYRqlXPoQkTJag==" + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/bson/-/bson-6.6.0.tgz", + "integrity": "sha512-BVINv2SgcMjL4oYbBuCQTpE3/VKOSxrOA8Cj/wQP7izSzlBGVomdm+TcUd0Pzy0ytLSSDweCKQ6X3f5veM5LQA==" }, "buffer": { "version": "4.9.2", @@ -31984,7 +32069,8 @@ "ip": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", - "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==" + "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==", + "devOptional": true }, "is-arguments": { "version": "1.1.1", @@ -35241,8 +35327,7 @@ "memory-pager": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", - "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==", - "optional": true + "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==" }, "merge-stream": { "version": "2.0.0", @@ -35372,20 +35457,61 @@ } }, "mongodb": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-5.6.0.tgz", - "integrity": "sha512-z8qVs9NfobHJm6uzK56XBZF8XwM9H294iRnB7wNjF0SnY93si5HPziIJn+qqvUR5QOff/4L0gCD6SShdR/GtVQ==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.5.0.tgz", + "integrity": "sha512-Fozq68InT+JKABGLqctgtb8P56pRrJFkbhW0ux+x1mdHeyinor8oNzJqwLjV/t5X5nJGfTlluxfyMnOXNggIUA==", "requires": { - "bson": "^5.3.0", - "mongodb-connection-string-url": "^2.6.0", - "saslprep": "^1.0.3", - "socks": "^2.7.1" + "@mongodb-js/saslprep": "^1.1.5", + "bson": "^6.4.0", + "mongodb-connection-string-url": "^3.0.0" + }, + "dependencies": { + "@types/whatwg-url": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-11.0.4.tgz", + "integrity": "sha512-lXCmTWSHJvf0TRSO58nm978b8HJ/EdsSsEKLd3ODHFjo+3VGAyyTp4v50nWvwtzBxSMQrVOK7tcuN0zGPLICMw==", + "requires": { + "@types/webidl-conversions": "*" + } + }, + "mongodb-connection-string-url": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.0.tgz", + "integrity": "sha512-t1Vf+m1I5hC2M5RJx/7AtxgABy1cZmIPQRMXw+gEIPn/cZNF3Oiy+l0UIypUwVB5trcWHq3crg2g3uAR9aAwsQ==", + "requires": { + "@types/whatwg-url": "^11.0.2", + "whatwg-url": "^13.0.0" + } + }, + "tr46": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", + "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==", + "requires": { + "punycode": "^2.3.0" + } + }, + "webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==" + }, + "whatwg-url": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-13.0.0.tgz", + "integrity": "sha512-9WWbymnqj57+XEuqADHrCJ2eSXzn8WXIW/YSGaZtb2WKAInQ6CHfaUUcTyyver0p8BDg5StLQq8h1vtZuwmOig==", + "requires": { + "tr46": "^4.1.1", + "webidl-conversions": "^7.0.0" + } + } } }, "mongodb-connection-string-url": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-2.6.0.tgz", "integrity": "sha512-WvTZlI9ab0QYtTYnuMLgobULWhokRjtC7db9LtcVfJ+Hsnyr5eo6ZtNAt3Ly24XZScGMelOcGtm7lSn0332tPQ==", + "dev": true, "requires": { "@types/whatwg-url": "^8.2.1", "whatwg-url": "^11.0.0" @@ -35395,6 +35521,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", + "dev": true, "requires": { "punycode": "^2.1.1" } @@ -35402,12 +35529,14 @@ "webidl-conversions": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", - "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==" + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "dev": true }, "whatwg-url": { "version": "11.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", + "dev": true, "requires": { "tr46": "^3.0.0", "webidl-conversions": "^7.0.0" @@ -36695,6 +36824,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.3.tgz", "integrity": "sha512-/MY/PEMbk2SuY5sScONwhUDsV2p77Znkb/q3nSVstq/yQzYJOH/Azh29p9oJLsl3LnQwSvZDKagDGBsBwSooag==", + "dev": true, "optional": true, "requires": { "sparse-bitfield": "^3.0.3" @@ -37239,12 +37369,14 @@ "smart-buffer": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", - "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==" + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "devOptional": true }, "socks": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", + "devOptional": true, "requires": { "ip": "^2.0.0", "smart-buffer": "^4.2.0" @@ -37294,7 +37426,6 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", "integrity": "sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==", - "optional": true, "requires": { "memory-pager": "^1.0.2" } diff --git a/package.json b/package.json index d78e8845b..4bceb6ed7 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "fs-extra": "^7.0.1", "jest-mock-extended": "^2.0.2-beta2", "js-yaml": "^3.13.1", - "mongodb": "^5.1.0", + "mongodb": "6.5", "simple-git": "^2.45.1", "tsscmp": "^1.0.6", "validator": "^10.11.0" From 12bbd1b91ad9a659610a2d69c440300ee6c4b3b4 Mon Sep 17 00:00:00 2001 From: Caesar Bell Date: Thu, 2 May 2024 14:29:47 -0400 Subject: [PATCH 02/10] :wrench: DOP-4497 adds feature branch to the deploy feature branch ymal file --- .github/workflows/deploy-feature-branch.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy-feature-branch.yml b/.github/workflows/deploy-feature-branch.yml index 57e992671..cae9f36da 100644 --- a/.github/workflows/deploy-feature-branch.yml +++ b/.github/workflows/deploy-feature-branch.yml @@ -2,6 +2,7 @@ on: pull_request: branches: - main + - DOP-4497 types: - opened - reopened From 5cb4656d09aac2ea2be1f99bd6fd839b31b72923 Mon Sep 17 00:00:00 2001 From: Caesar Bell Date: Thu, 2 May 2024 15:24:23 -0400 Subject: [PATCH 03/10] :wrench: DOP-4497 removed the branch name from the deployed feature branch --- .github/workflows/deploy-feature-branch.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/deploy-feature-branch.yml b/.github/workflows/deploy-feature-branch.yml index cae9f36da..57e992671 100644 --- a/.github/workflows/deploy-feature-branch.yml +++ b/.github/workflows/deploy-feature-branch.yml @@ -2,7 +2,6 @@ on: pull_request: branches: - main - - DOP-4497 types: - opened - reopened From e9d91a81db4088aae0c53b42d91d2bf71ff90373 Mon Sep 17 00:00:00 2001 From: Caesar Bell Date: Fri, 3 May 2024 15:32:30 -0400 Subject: [PATCH 04/10] :bug: DOP-4498 removed looking for value from response --- src/repositories/jobRepository.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/repositories/jobRepository.ts b/src/repositories/jobRepository.ts index d2e27da19..205c230e0 100644 --- a/src/repositories/jobRepository.ts +++ b/src/repositories/jobRepository.ts @@ -122,8 +122,8 @@ export class JobRepository extends BaseRepository { options, `Mongo Timeout Error: Timed out while retrieving job` ); - if (response.value) { - const job: Job = response.value; + if (response) { + const job: Job = response; await this.notify(job._id, c.get('jobUpdatesQueueUrl'), JobStatus.inProgress, 0); return job; } From b50f2f352ae9ac5172aa7d5829c1457600d4a8d2 Mon Sep 17 00:00:00 2001 From: Caesar Bell Date: Fri, 3 May 2024 15:38:34 -0400 Subject: [PATCH 05/10] :white_check_mark: DOP-4498 removed looking for value from response --- tests/unit/repositories/jobRepository.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/repositories/jobRepository.test.ts b/tests/unit/repositories/jobRepository.test.ts index a241cec7d..ba65df1d0 100644 --- a/tests/unit/repositories/jobRepository.test.ts +++ b/tests/unit/repositories/jobRepository.test.ts @@ -106,11 +106,11 @@ describe('Job Repository Tests', () => { test('getOneQueuedJobAndUpdate succeeds', async () => { const testData = TestDataProvider.getFindOneAndUpdateCallInfo(); - const mockVal = { value: getBuildJobPlain() }; + const mockVal = getBuildJobPlain(); jest.spyOn(jobRepo, 'notify').mockResolvedValueOnce(true); dbRepoHelper.collection.findOneAndUpdate.mockResolvedValueOnce(mockVal); - await expect(jobRepo.getOneQueuedJobAndUpdate()).resolves.toEqual(mockVal.value); + await expect(jobRepo.getOneQueuedJobAndUpdate()).resolves.toEqual(mockVal); expect(dbRepoHelper.collection.findOneAndUpdate).toBeCalledTimes(1); expect(dbRepoHelper.collection.findOneAndUpdate).toBeCalledWith( testData.query, From b3516840763ceb4d935c2a85c7d9230891dbac7b Mon Sep 17 00:00:00 2001 From: Caesar Bell Date: Mon, 6 May 2024 12:31:17 -0400 Subject: [PATCH 06/10] :bug: DOP-4497 removes value as the return value is no longer used since ModifyResult is not retuned due to includeResultMetadata being false --- src/repositories/jobRepository.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/repositories/jobRepository.ts b/src/repositories/jobRepository.ts index 205c230e0..c57e85c53 100644 --- a/src/repositories/jobRepository.ts +++ b/src/repositories/jobRepository.ts @@ -46,7 +46,7 @@ export class JobRepository extends BaseRepository { if (shouldNotifySqs) { await this.notify(objectId.toString(), c.get('jobUpdatesQueueUrl'), JobStatus.completed, 0); } - return updateResponse.value; + return updateResponse; } async insertJob(job: Omit, url: string): Promise { From 3071b32896dd004c9d8447724d7fb5fb479d844b Mon Sep 17 00:00:00 2001 From: Caesar Bell Date: Mon, 6 May 2024 12:52:17 -0400 Subject: [PATCH 07/10] :white_check_mark: DOP-4497 update test to fix 'TypeError: Right-hand side of 'instanceof' is not callable' --- tests/unit/repositories/jobRepository.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/unit/repositories/jobRepository.test.ts b/tests/unit/repositories/jobRepository.test.ts index ba65df1d0..5794a1ded 100644 --- a/tests/unit/repositories/jobRepository.test.ts +++ b/tests/unit/repositories/jobRepository.test.ts @@ -50,11 +50,11 @@ describe('Job Repository Tests', () => { expect(dbRepoHelper.collection.findOneAndUpdate).toBeCalledTimes(1); }); - test('Update with completion status succeeds', async () => { + test('Update with completion status succeeds', () => { setupForFindOneAndUpdateSuccess(); - await expect( - jobRepo.updateWithStatus('64ad959b423952aeb9341fad', 'All good', JobStatus.completed) - ).resolves.toEqual(job); + expect(jobRepo.updateWithStatus('64ad959b423952aeb9341fad', 'All good', JobStatus.completed)).resolves.toEqual( + job + ); expect(dbRepoHelper.collection.findOneAndUpdate).toBeCalledTimes(1); expect(dbRepoHelper.logger.error).toBeCalledTimes(0); }); From 01eee4f03a57ac3cf12406e290d13f04de60acbe Mon Sep 17 00:00:00 2001 From: Caesar Bell Date: Mon, 6 May 2024 13:24:40 -0400 Subject: [PATCH 08/10] :white_check_mark: DOP-4497 adds includeResultMetadata:true to support existing behavior for updateWithStatus method --- src/repositories/jobRepository.ts | 4 ++-- tests/unit/repositories/jobRepository.test.ts | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/repositories/jobRepository.ts b/src/repositories/jobRepository.ts index c57e85c53..7da3ff6dc 100644 --- a/src/repositories/jobRepository.ts +++ b/src/repositories/jobRepository.ts @@ -40,13 +40,13 @@ export class JobRepository extends BaseRepository { const updateResponse = await this.findOneAndUpdate( query, update, - {}, + { includeResultMetadata: true }, `Mongo Timeout Error: Timed out while updating job status to "${status}" for jobId: ${id}` ); if (shouldNotifySqs) { await this.notify(objectId.toString(), c.get('jobUpdatesQueueUrl'), JobStatus.completed, 0); } - return updateResponse; + return updateResponse.value; } async insertJob(job: Omit, url: string): Promise { diff --git a/tests/unit/repositories/jobRepository.test.ts b/tests/unit/repositories/jobRepository.test.ts index 5794a1ded..ba65df1d0 100644 --- a/tests/unit/repositories/jobRepository.test.ts +++ b/tests/unit/repositories/jobRepository.test.ts @@ -50,11 +50,11 @@ describe('Job Repository Tests', () => { expect(dbRepoHelper.collection.findOneAndUpdate).toBeCalledTimes(1); }); - test('Update with completion status succeeds', () => { + test('Update with completion status succeeds', async () => { setupForFindOneAndUpdateSuccess(); - expect(jobRepo.updateWithStatus('64ad959b423952aeb9341fad', 'All good', JobStatus.completed)).resolves.toEqual( - job - ); + await expect( + jobRepo.updateWithStatus('64ad959b423952aeb9341fad', 'All good', JobStatus.completed) + ).resolves.toEqual(job); expect(dbRepoHelper.collection.findOneAndUpdate).toBeCalledTimes(1); expect(dbRepoHelper.logger.error).toBeCalledTimes(0); }); From 91181489c388bf9871be2cf3588d370695772575 Mon Sep 17 00:00:00 2001 From: Caesar Bell Date: Mon, 6 May 2024 15:01:42 -0400 Subject: [PATCH 09/10] :bug: DOP-4497 adds includeResultMetadata option to support older behavior i.e. value as a response --- src/repositories/jobRepository.ts | 6 +++--- tests/data/data.ts | 2 +- tests/unit/repositories/jobRepository.test.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/repositories/jobRepository.ts b/src/repositories/jobRepository.ts index 7da3ff6dc..45e966d6f 100644 --- a/src/repositories/jobRepository.ts +++ b/src/repositories/jobRepository.ts @@ -115,15 +115,15 @@ export class JobRepository extends BaseRepository { async findOneAndUpdateJob(query): Promise { const update = { $set: { startTime: new Date(), status: 'inProgress' } }; - const options = { sort: { priority: -1, createdTime: 1 }, returnNewDocument: true }; + const options = { sort: { priority: -1, createdTime: 1 }, returnNewDocument: true, includeResultMetadata: true }; const response = await this.findOneAndUpdate( query, update, options, `Mongo Timeout Error: Timed out while retrieving job` ); - if (response) { - const job: Job = response; + if (response.value) { + const job: Job = response.value; await this.notify(job._id, c.get('jobUpdatesQueueUrl'), JobStatus.inProgress, 0); return job; } diff --git a/tests/data/data.ts b/tests/data/data.ts index b3b2763a0..b3e38483a 100644 --- a/tests/data/data.ts +++ b/tests/data/data.ts @@ -319,7 +319,7 @@ export class TestDataProvider { createdTime: { $lte: new Date() }, }, update: { $set: { startTime: new Date(), status: 'inProgress' } }, - options: { sort: { priority: -1, createdTime: 1 }, returnNewDocument: true }, + options: { sort: { priority: -1, createdTime: 1 }, returnNewDocument: true, includeResultMetadata: true }, }; } diff --git a/tests/unit/repositories/jobRepository.test.ts b/tests/unit/repositories/jobRepository.test.ts index ba65df1d0..a241cec7d 100644 --- a/tests/unit/repositories/jobRepository.test.ts +++ b/tests/unit/repositories/jobRepository.test.ts @@ -106,11 +106,11 @@ describe('Job Repository Tests', () => { test('getOneQueuedJobAndUpdate succeeds', async () => { const testData = TestDataProvider.getFindOneAndUpdateCallInfo(); - const mockVal = getBuildJobPlain(); + const mockVal = { value: getBuildJobPlain() }; jest.spyOn(jobRepo, 'notify').mockResolvedValueOnce(true); dbRepoHelper.collection.findOneAndUpdate.mockResolvedValueOnce(mockVal); - await expect(jobRepo.getOneQueuedJobAndUpdate()).resolves.toEqual(mockVal); + await expect(jobRepo.getOneQueuedJobAndUpdate()).resolves.toEqual(mockVal.value); expect(dbRepoHelper.collection.findOneAndUpdate).toBeCalledTimes(1); expect(dbRepoHelper.collection.findOneAndUpdate).toBeCalledWith( testData.query, From c313c57919fe9b982c440310dfbaf45815eb7038 Mon Sep 17 00:00:00 2001 From: Caesar Bell Date: Tue, 7 May 2024 11:26:52 -0400 Subject: [PATCH 10/10] :zap: DOP-4497 sets includeResultMetadata: true as a default option in baseRepository findOneAndUpdate --- src/repositories/baseRepository.ts | 2 +- src/repositories/jobRepository.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/repositories/baseRepository.ts b/src/repositories/baseRepository.ts index 564e9b268..86778ead8 100644 --- a/src/repositories/baseRepository.ts +++ b/src/repositories/baseRepository.ts @@ -166,7 +166,7 @@ export abstract class BaseRepository { try { const updateResponse = await this.promiseTimeoutS( this._config.get('MONGO_TIMEOUT_S'), - this._collection.findOneAndUpdate(query, update, options), + this._collection.findOneAndUpdate(query, update, { ...options, includeResultMetadata: true }), errorMsg ); if (!updateResponse) { diff --git a/src/repositories/jobRepository.ts b/src/repositories/jobRepository.ts index 45e966d6f..d2e27da19 100644 --- a/src/repositories/jobRepository.ts +++ b/src/repositories/jobRepository.ts @@ -40,7 +40,7 @@ export class JobRepository extends BaseRepository { const updateResponse = await this.findOneAndUpdate( query, update, - { includeResultMetadata: true }, + {}, `Mongo Timeout Error: Timed out while updating job status to "${status}" for jobId: ${id}` ); if (shouldNotifySqs) { @@ -115,7 +115,7 @@ export class JobRepository extends BaseRepository { async findOneAndUpdateJob(query): Promise { const update = { $set: { startTime: new Date(), status: 'inProgress' } }; - const options = { sort: { priority: -1, createdTime: 1 }, returnNewDocument: true, includeResultMetadata: true }; + const options = { sort: { priority: -1, createdTime: 1 }, returnNewDocument: true }; const response = await this.findOneAndUpdate( query, update,