Upgrade settings-sharelatex to 1.3.0 (#4065)

GitOrigin-RevId: bd24ba44203cf559758f2ff7291723af98b489aa
This commit is contained in:
Alf Eaton 2021-05-19 13:07:22 +01:00 committed by Copybot
parent b777e958d4
commit 3a45d270ec
6 changed files with 24 additions and 17 deletions

View file

@ -30719,9 +30719,9 @@
"integrity": "sha512-9jphSf3UbIgpOX/RKvX02iw/rN2TKdusnsPpGfO/rkcsrd+IRqgHZb4VGnmL0Cynps8Nj2hN45wsi30BzrHDIw==" "integrity": "sha512-9jphSf3UbIgpOX/RKvX02iw/rN2TKdusnsPpGfO/rkcsrd+IRqgHZb4VGnmL0Cynps8Nj2hN45wsi30BzrHDIw=="
}, },
"settings-sharelatex": { "settings-sharelatex": {
"version": "1.2.0", "version": "1.3.0",
"resolved": "https://registry.npmjs.org/settings-sharelatex/-/settings-sharelatex-1.2.0.tgz", "resolved": "https://registry.npmjs.org/settings-sharelatex/-/settings-sharelatex-1.3.0.tgz",
"integrity": "sha512-uqVRPHeL/jsHrAqzUX3Ie9hfId6DrEKnpX2ggepPl5x4LojkF+52TgwK7ephdS4EFwmK88VysTI1lrHGb2zqJg==", "integrity": "sha512-AWSeCiY1eHi+z6DF4bmTyC3tusOc6EF5zDkC28aAOhEAbgVEIuY034kx1X7a4j9HE0iVs0sVOlZrQMWJBVk3oQ==",
"requires": { "requires": {
"coffee-script": "1.6.0" "coffee-script": "1.6.0"
}, },

View file

@ -160,7 +160,7 @@
"sanitize-html": "^1.27.1", "sanitize-html": "^1.27.1",
"sanitizer": "0.1.1", "sanitizer": "0.1.1",
"scroll-into-view-if-needed": "^2.2.25", "scroll-into-view-if-needed": "^2.2.25",
"settings-sharelatex": "^1.2.0", "settings-sharelatex": "^1.3.0",
"underscore": "^1.13.1", "underscore": "^1.13.1",
"url-parse": "^1.4.7", "url-parse": "^1.4.7",
"utf-8-validate": "^5.0.2", "utf-8-validate": "^5.0.2",

View file

@ -2,6 +2,7 @@ const { exec } = require('child_process')
const { promisify } = require('util') const { promisify } = require('util')
const { expect } = require('chai') const { expect } = require('chai')
const logger = require('logger-sharelatex') const logger = require('logger-sharelatex')
const { filterOutput } = require('./helpers/settings')
const { db, ObjectId } = require('../../../app/src/infrastructure/mongodb') const { db, ObjectId } = require('../../../app/src/infrastructure/mongodb')
const DUMMY_NAME = 'unknown.tex' const DUMMY_NAME = 'unknown.tex'
@ -134,9 +135,7 @@ describe('BackFillDummyDocMeta', function () {
} }
let { stderr: stdErr, stdout: stdOut } = result let { stderr: stdErr, stdout: stdOut } = result
stdErr = stdErr.split('\n') stdErr = stdErr.split('\n')
stdOut = stdOut stdOut = stdOut.split('\n').filter(filterOutput)
.split('\n')
.filter(line => !line.includes('Using settings from'))
const oneDayFromProjectId9InSeconds = const oneDayFromProjectId9InSeconds =
getSecondsFromObjectId(projectIds[9]) + ONE_DAY_IN_S getSecondsFromObjectId(projectIds[9]) + ONE_DAY_IN_S
@ -166,7 +165,7 @@ describe('BackFillDummyDocMeta', function () {
] ]
} }
expect(stdOut).to.deep.equal([ expect(stdOut.filter(filterOutput)).to.deep.equal([
`Back filling dummy meta data for ["${docIds[0]}"]`, `Back filling dummy meta data for ["${docIds[0]}"]`,
`Orphaned deleted doc ${docIds[0]} (no deletedProjects entry)`, `Orphaned deleted doc ${docIds[0]} (no deletedProjects entry)`,
`Back filling dummy meta data for ["${docIds[1]}"]`, `Back filling dummy meta data for ["${docIds[1]}"]`,
@ -188,7 +187,7 @@ describe('BackFillDummyDocMeta', function () {
...overlappingPartStdOut, ...overlappingPartStdOut,
'', '',
]) ])
expect(stdErr).to.deep.equal([ expect(stdErr.filter(filterOutput)).to.deep.equal([
...`Options: ${JSON.stringify(options, null, 2)}`.split('\n'), ...`Options: ${JSON.stringify(options, null, 2)}`.split('\n'),
'Waiting for you to double check inputs for 1 ms', 'Waiting for you to double check inputs for 1 ms',
`Processed 1 until ${getObjectIdFromDate('2021-04-02T00:00:00.000Z')}`, `Processed 1 until ${getObjectIdFromDate('2021-04-02T00:00:00.000Z')}`,

View file

@ -2,6 +2,7 @@ const { exec } = require('child_process')
const { promisify } = require('util') const { promisify } = require('util')
const { expect } = require('chai') const { expect } = require('chai')
const logger = require('logger-sharelatex') const logger = require('logger-sharelatex')
const { filterOutput } = require('./helpers/settings')
const { db, ObjectId } = require('../../../app/src/infrastructure/mongodb') const { db, ObjectId } = require('../../../app/src/infrastructure/mongodb')
const ONE_DAY_IN_S = 60 * 60 * 24 const ONE_DAY_IN_S = 60 * 60 * 24
@ -129,10 +130,8 @@ describe('DeleteOrphanedDocsOnlineCheck', function () {
throw error throw error
} }
let { stderr: stdErr, stdout: stdOut } = result let { stderr: stdErr, stdout: stdOut } = result
stdErr = stdErr.split('\n') stdErr = stdErr.split('\n').filter(filterOutput)
stdOut = stdOut stdOut = stdOut.split('\n').filter(filterOutput)
.split('\n')
.filter(line => !line.includes('Using settings from'))
const oneDayFromProjectId9InSeconds = const oneDayFromProjectId9InSeconds =
getSecondsFromObjectId(projectIds[9]) + ONE_DAY_IN_S getSecondsFromObjectId(projectIds[9]) + ONE_DAY_IN_S

View file

@ -2,6 +2,7 @@ const { exec } = require('child_process')
const { promisify } = require('util') const { promisify } = require('util')
const { expect } = require('chai') const { expect } = require('chai')
const logger = require('logger-sharelatex') const logger = require('logger-sharelatex')
const { filterOutput } = require('./helpers/settings')
const { db } = require('../../../app/src/infrastructure/mongodb') const { db } = require('../../../app/src/infrastructure/mongodb')
const BATCH_SIZE = 100 const BATCH_SIZE = 100
@ -110,9 +111,8 @@ describe('RegenerateDuplicateReferralIds', function () {
stdErr = stdErr stdErr = stdErr
.split('\n') .split('\n')
.filter(line => !line.includes('DeprecationWarning')) .filter(line => !line.includes('DeprecationWarning'))
stdOut = stdOut .filter(filterOutput)
.split('\n') stdOut = stdOut.split('\n').filter(filterOutput)
.filter(line => !line.includes('Using settings from'))
expect(stdErr).to.deep.equal([ expect(stdErr).to.deep.equal([
`Completed batch ending ${firstBatch[BATCH_SIZE - 1]}`, `Completed batch ending ${firstBatch[BATCH_SIZE - 1]}`,
`Completed batch ending ${secondBatch[BATCH_SIZE - 1]}`, `Completed batch ending ${secondBatch[BATCH_SIZE - 1]}`,
@ -121,7 +121,7 @@ describe('RegenerateDuplicateReferralIds', function () {
'Done.', 'Done.',
'', '',
]) ])
expect(stdOut).to.deep.equal([ expect(stdOut.filter(filterOutput)).to.deep.equal([
// only duplicates // only duplicates
`Running update on batch with ids ${JSON.stringify(firstBatch)}`, `Running update on batch with ids ${JSON.stringify(firstBatch)}`,
'Got duplicates from looking at batch.', 'Got duplicates from looking at batch.',

View file

@ -0,0 +1,9 @@
function filterOutput(line) {
return (
!line.startsWith('Using settings from ') &&
!line.startsWith('Using default settings from ') &&
!line.startsWith('CoffeeScript settings file')
)
}
module.exports = { filterOutput }