Merge pull request #15216 from overleaf/csh-issue-11625-mongo-ug-5-filestore

Upgrade mongodb module for filestore from 3.5.9 to 6.1.0

GitOrigin-RevId: 96993d561a5aa188cdcd0af1e4938dec7c374b56
This commit is contained in:
Christopher Hoskin
2023-10-13 08:03:55 +00:00
committed by Copybot
parent 5b08d76817
commit 40e243f2e4
4 changed files with 127 additions and 28 deletions
+1 -1
View File
@@ -40,7 +40,7 @@
"chai-as-promised": "^7.1.1",
"disrequire": "^1.1.0",
"mocha": "^10.2.0",
"mongodb": "^3.5.9",
"mongodb": "^6.1.0",
"sandboxed-module": "2.0.4",
"sinon": "9.0.2",
"sinon-chai": "^3.7.0",
@@ -136,8 +136,8 @@ describe('Filestore', function () {
`${metricPrefix}_egress`
)
}
projectId = ObjectId().toString()
otherProjectId = ObjectId().toString()
projectId = new ObjectId().toString()
otherProjectId = new ObjectId().toString()
})
it('should send a 200 for the status endpoint', async function () {
@@ -155,7 +155,7 @@ describe('Filestore', function () {
'/tmp/filestore_acceptance_tests_file_read.txt'
beforeEach(async function () {
fileId = ObjectId().toString()
fileId = new ObjectId().toString()
fileUrl = `${filestoreUrl}/project/${projectId}/file/${fileId}`
constantFileContent = [
'hello world',
@@ -238,8 +238,8 @@ describe('Filestore', function () {
})
it('should be able to copy files', async function () {
const newProjectID = ObjectId().toString()
const newFileId = ObjectId().toString()
const newProjectID = new ObjectId().toString()
const newFileId = new ObjectId().toString()
const newFileUrl = `${filestoreUrl}/project/${newProjectID}/file/${newFileId}`
let response = await fetch(newFileUrl, {
method: 'PUT',
@@ -343,9 +343,9 @@ describe('Filestore', function () {
projectUrl = `${filestoreUrl}/project/${projectId}`
otherProjectUrl = `${filestoreUrl}/project/${otherProjectId}`
fileIds = [
ObjectId().toString(),
ObjectId().toString(),
ObjectId().toString(),
new ObjectId().toString(),
new ObjectId().toString(),
new ObjectId().toString(),
]
fileUrls = [
`${projectUrl}/file/${fileIds[0]}`,
@@ -416,7 +416,7 @@ describe('Filestore', function () {
let fileId, fileUrl, largeFileContent, error
beforeEach(async function () {
fileId = ObjectId().toString()
fileId = new ObjectId().toString()
fileUrl = `${filestoreUrl}/project/${projectId}/file/${fileId}`
largeFileContent = '_wombat_'.repeat(1024 * 1024) // 8 megabytes
@@ -457,8 +457,8 @@ describe('Filestore', function () {
beforeEach(async function () {
constantFileContent = `This is a file in a different S3 bucket ${Math.random()}`
fileId = ObjectId().toString()
bucketName = ObjectId().toString()
fileId = new ObjectId().toString()
bucketName = new ObjectId().toString()
fileUrl = `${filestoreUrl}/bucket/${bucketName}/key/${fileId}`
const s3ClientSettings = {
@@ -501,7 +501,7 @@ describe('Filestore', function () {
beforeEach(async function () {
date = new Date()
tk.freeze(date)
fileId = ObjectId()
fileId = new ObjectId()
fileUrl = `${filestoreUrl}/project/${projectId}/file/${fileId}`
content = '_wombat_' + Math.random()
@@ -549,7 +549,7 @@ describe('Filestore', function () {
beforeEach(function () {
constantFileContent = `This is yet more file content ${Math.random()}`
fileId = ObjectId().toString()
fileId = new ObjectId().toString()
fileKey = `${projectId}/${fileId}`
fileUrl = `${filestoreUrl}/project/${projectId}/file/${fileId}`
@@ -637,8 +637,8 @@ describe('Filestore', function () {
let newFileId, newFileUrl, newFileKey, opts
beforeEach(function () {
const newProjectID = ObjectId().toString()
newFileId = ObjectId().toString()
const newProjectID = new ObjectId().toString()
newFileId = new ObjectId().toString()
newFileUrl = `${filestoreUrl}/project/${newProjectID}/file/${newFileId}`
newFileKey = `${newProjectID}/${newFileId}`
@@ -857,7 +857,7 @@ describe('Filestore', function () {
)
beforeEach(async function () {
fileId = ObjectId().toString()
fileId = new ObjectId().toString()
fileUrl = `${filestoreUrl}/project/${projectId}/file/${fileId}`
const stat = await fsStat(localFileReadPath)
localFileSize = stat.size
@@ -20,9 +20,9 @@ describe('FileHandler', function () {
fs
const bucket = 'my_bucket'
const key = `${ObjectId()}/${ObjectId()}`
const convertedFolderKey = `${ObjectId()}/${ObjectId()}`
const projectKey = `${ObjectId()}/`
const key = `${new ObjectId()}/${new ObjectId()}`
const convertedFolderKey = `${new ObjectId()}/${new ObjectId()}`
const projectKey = `${new ObjectId()}/`
const sourceStream = 'sourceStream'
const convertedKey = 'convertedKey'
const redirectUrl = 'https://wombat.potato/giraffe'