Merge pull request #22488 from overleaf/bg-add-filestore-request-logging

add filestore request logging

GitOrigin-RevId: 0ec5c413f0e88521e1da268699ee2ee281c560f1
This commit is contained in:
Brian Gough
2024-12-13 09:05:16 +00:00
committed by Copybot
parent 09bbbfbb28
commit 9d4eeeea90
7 changed files with 21 additions and 15 deletions
@@ -386,7 +386,9 @@ describe('FileStoreHandler', function () {
return done(err)
}
this.request.args[0][0].method.should.equal('get')
this.request.args[0][0].uri.should.equal(fileUrl)
this.request.args[0][0].uri.should.equal(
fileUrl + '?from=getFileStream'
)
done()
}
)
@@ -475,7 +477,8 @@ describe('FileStoreHandler', function () {
describe('getFileSize', function () {
it('returns the file size reported by filestore', function (done) {
const expectedFileSize = 32432
const fileUrl = this.getFileUrl(this.projectId, this.fileId)
const fileUrl =
this.getFileUrl(this.projectId, this.fileId) + '?from=getFileSize'
this.request.head.yields(
new Error('request.head() received unexpected arguments')
)
@@ -138,8 +138,8 @@ describe('ReferencesHandler', function () {
expect(arg.json.docUrls).to.deep.equal([
`${this.settings.apis.docstore.url}/project/${this.projectId}/doc/aaa/raw`,
`${this.settings.apis.docstore.url}/project/${this.projectId}/doc/ccc/raw`,
`${this.settings.apis.filestore.url}/project/${this.projectId}/file/fff`,
`${this.settings.apis.filestore.url}/project/${this.projectId}/file/ggg`,
`${this.settings.apis.filestore.url}/project/${this.projectId}/file/fff?from=bibFileUrls`,
`${this.settings.apis.filestore.url}/project/${this.projectId}/file/ggg?from=bibFileUrls`,
])
expect(arg.json.sourceURLs.length).to.equal(4)
expect(arg.json.sourceURLs).to.deep.equal([
@@ -150,11 +150,11 @@ describe('ReferencesHandler', function () {
url: `${this.settings.apis.docstore.url}/project/${this.projectId}/doc/ccc/raw`,
},
{
url: `${this.settings.apis.filestore.url}/project/${this.projectId}/file/fff`,
url: `${this.settings.apis.filestore.url}/project/${this.projectId}/file/fff?from=bibFileUrls`,
},
{
url: `${this.settings.apis.project_history.url}/project/${this.historyId}/blob/hash`,
fallbackURL: `${this.settings.apis.filestore.url}/project/${this.projectId}/file/ggg`,
fallbackURL: `${this.settings.apis.filestore.url}/project/${this.projectId}/file/ggg?from=bibFileUrls`,
},
])
expect(arg.json.fullIndex).to.equal(true)
@@ -138,7 +138,7 @@ describe('TpdsUpdateSender', function () {
method: 'pipeStreamFrom',
job: {
method: 'post',
streamOrigin: `${filestoreUrl}/project/${projectId}/file/${fileId}`,
streamOrigin: `${filestoreUrl}/project/${projectId}/file/${fileId}?from=tpdsAddFile`,
uri: `${thirdPartyDataStoreApiUrl}/user/${userId}/entity/${encodeURIComponent(
projectName
)}${encodeURIComponent(path)}`,
@@ -192,7 +192,7 @@ describe('TpdsUpdateSender', function () {
job: {
method: 'post',
streamOrigin: `${projectHistoryUrl}/project/${historyId}/blob/${hash}`,
streamFallback: `${filestoreUrl}/project/${projectId}/file/${fileId}`,
streamFallback: `${filestoreUrl}/project/${projectId}/file/${fileId}?from=tpdsAddFile`,
uri: `${thirdPartyDataStoreApiUrl}/user/${userId}/entity/${encodeURIComponent(
projectName
)}${encodeURIComponent(path)}`,