mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
Merge pull request #34761 from overleaf/bg-enable-clsi-checkpoints
adds enableCheckpoint to compile requests from web to clsi GitOrigin-RevId: 431b28602091cf8f7252ad836f083c7b092351d4
This commit is contained in:
@@ -1161,6 +1161,7 @@ function _finaliseRequest(projectId, options, project, docs, files) {
|
||||
enablePdfCaching:
|
||||
(Settings.enablePdfCaching && options.enablePdfCaching) || false,
|
||||
pdfCachingMinChunkSize: options.pdfCachingMinChunkSize,
|
||||
enableCheckpoint: Boolean(options.enableCheckpoint),
|
||||
flags,
|
||||
metricsMethod: options.compileGroup,
|
||||
metricsPath: options.metricsPath,
|
||||
|
||||
@@ -46,13 +46,12 @@ function getOutputFilesArchiveSpecification(projectId, userId, buildId) {
|
||||
}
|
||||
|
||||
async function _getSplitTestOptions(req, res) {
|
||||
const { variant } = await SplitTestHandler.promises.getAssignment(
|
||||
const compileFromHistory = await SplitTestHandler.promises.featureFlagEnabled(
|
||||
req,
|
||||
res,
|
||||
'compile-from-history',
|
||||
{ includeReferer: true }
|
||||
)
|
||||
const compileFromHistory = variant === 'enabled'
|
||||
|
||||
const pdfDownloadDomain = Settings.pdfDownloadDomain
|
||||
const enablePdfCaching = Settings.enablePdfCaching
|
||||
@@ -67,11 +66,20 @@ async function _getSplitTestOptions(req, res) {
|
||||
}
|
||||
|
||||
const pdfCachingMinChunkSize = Settings.pdfCachingMinChunkSize
|
||||
|
||||
const enableCheckpoint = await SplitTestHandler.promises.featureFlagEnabled(
|
||||
req,
|
||||
res,
|
||||
'compile-with-checkpoint',
|
||||
{ includeReferer: true }
|
||||
)
|
||||
|
||||
return {
|
||||
compileFromHistory,
|
||||
pdfDownloadDomain,
|
||||
enablePdfCaching,
|
||||
pdfCachingMinChunkSize,
|
||||
enableCheckpoint,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,11 +214,15 @@ const _CompileController = {
|
||||
pdfCachingMinChunkSize,
|
||||
pdfDownloadDomain,
|
||||
compileFromHistory,
|
||||
enableCheckpoint,
|
||||
} = await _getSplitTestOptions(req, res)
|
||||
if (Features.hasFeature('saas')) {
|
||||
options.compileFromClsiCache = true
|
||||
options.populateClsiCache = true
|
||||
options.compileFromHistory = compileFromHistory
|
||||
if (enableCheckpoint) {
|
||||
options.enableCheckpoint = enableCheckpoint
|
||||
}
|
||||
}
|
||||
options.enablePdfCaching = enablePdfCaching
|
||||
if (enablePdfCaching) {
|
||||
|
||||
@@ -153,13 +153,11 @@ describe('CompileController', function () {
|
||||
'../../../../app/src/Features/SplitTests/SplitTestHandler',
|
||||
() => ({
|
||||
default: {
|
||||
getAssignment: (ctx.getAssignment = sinon.stub().yields(null, {
|
||||
variant: 'default',
|
||||
})),
|
||||
featureFlagEnabled: (ctx.featureFlagEnabled = sinon
|
||||
.stub()
|
||||
.yields(null, false)),
|
||||
promises: {
|
||||
getAssignment: sinon.stub().resolves({
|
||||
variant: 'default',
|
||||
}),
|
||||
featureFlagEnabled: sinon.stub().resolves(false),
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user