[web] Remove split-tests compile-backend-class* and compile-timeout-20s* (#17700)

* Remove split-tests of `compile-timeout-20s` and `compile-timeout-20s-existing-users`

* Remove `NEW_COMPILE_TIMEOUT_ENFORCED_CUTOFF` variables

* Revert timeout override `60` -> `20`

* Update settings.overrides.saas.js: `compileTimeout: 20`

* Remove `compile-backend-class-n2d`

* Remove `force_new_compile_timeout`

* Remove `showNewCompileTimeoutUI`

* Remove `compileTimeChanging`

* Simplify code by removing segmentation object

* Remove `CompileTimeoutChangingSoon`

* Remove `user.features.compileTimeout = '20 (with 10s prompt)'`

* Remove `CompileTimeWarning`

* Remove `TimeoutUpgradePrompt` (old)

* Remove `compile-backend-class`

* Remove unused translations

* Update tests

* Fix: Show `CompileTimeout` even if `!window.ExposedSettings.enableSubscriptions`

* Create script to migrate users to 20s compileTimeout

* migration script: exclude `compileTimeout: 20` from the match

* migration script: use `batchedUpdate`

* Remove `showFasterCompilesFeedbackUI` and `FasterCompilesFeedback`

Helped-by: Jakob Ackermann <jakob.ackermann@overleaf.com>

* Remove `_getCompileBackendClassDetails`, simplify definition of `limits` object

* Remove `Settings.apis.clsi.defaultBackendClass`

* Remove unnecessary second scan of the whole user collection in dry mode

* Override `timeout` to 20 for users having `compileGroup === 'standard' && compileTimeout <= 60`

* Remove second `logCount`: re-run the script in dry-mode if you want to see that count

* Use secondary readPreference when counting users

* Fix script setup and exit 0

* Fix: Remove `user.` from query path!

* Add acceptance test on script migration_compile_timeout_60s_to_20s.js

GitOrigin-RevId: 3cb65130e6d7fbd9c54005f4c213066d0473e9d8
This commit is contained in:
Antoine Clausse
2024-04-15 08:04:24 +00:00
committed by Copybot
parent 03fb015f8f
commit 2dd10c7fee
27 changed files with 302 additions and 980 deletions
@@ -52,8 +52,6 @@ export const DetachCompileProvider: FC = ({ children }) => {
setStopOnValidationError: _setStopOnValidationError,
showLogs: _showLogs,
showCompileTimeWarning: _showCompileTimeWarning,
showNewCompileTimeoutUI: _showNewCompileTimeoutUI,
showFasterCompilesFeedbackUI: _showFasterCompilesFeedbackUI,
stopOnFirstError: _stopOnFirstError,
stopOnValidationError: _stopOnValidationError,
stoppedOnFirstError: _stoppedOnFirstError,
@@ -192,18 +190,6 @@ export const DetachCompileProvider: FC = ({ children }) => {
'detacher',
'detached'
)
const [showNewCompileTimeoutUI] = useDetachStateWatcher(
'showNewCompileTimeoutUI',
_showNewCompileTimeoutUI,
'detacher',
'detached'
)
const [showFasterCompilesFeedbackUI] = useDetachStateWatcher(
'showFasterCompilesFeedbackUI',
_showFasterCompilesFeedbackUI,
'detacher',
'detached'
)
const [stopOnFirstError] = useDetachStateWatcher(
'stopOnFirstError',
_stopOnFirstError,
@@ -413,8 +399,6 @@ export const DetachCompileProvider: FC = ({ children }) => {
setStopOnValidationError,
showLogs,
showCompileTimeWarning,
showNewCompileTimeoutUI,
showFasterCompilesFeedbackUI,
startCompile,
stopCompile,
stopOnFirstError,
@@ -466,8 +450,6 @@ export const DetachCompileProvider: FC = ({ children }) => {
setStopOnValidationError,
showCompileTimeWarning,
showLogs,
showNewCompileTimeoutUI,
showFasterCompilesFeedbackUI,
startCompile,
stopCompile,
stopOnFirstError,
@@ -72,8 +72,6 @@ export type CompileContext = {
setStopOnValidationError: (value: boolean) => void
showCompileTimeWarning: boolean
showLogs: boolean
showNewCompileTimeoutUI?: string
showFasterCompilesFeedbackUI: boolean
stopOnFirstError: boolean
stopOnValidationError: boolean
stoppedOnFirstError: boolean
@@ -103,11 +101,7 @@ export const LocalCompileProvider: FC = ({ children }) => {
const { hasPremiumCompile, isProjectOwner } = useEditorContext()
const {
_id: projectId,
rootDocId,
showNewCompileTimeoutUI,
} = useProjectContext()
const { _id: projectId, rootDocId } = useProjectContext()
const { pdfPreviewOpen } = useLayoutContext()
@@ -182,10 +176,6 @@ export const LocalCompileProvider: FC = ({ children }) => {
// whether the logs should be visible
const [showLogs, setShowLogs] = useState(false)
// whether the faster compiles feedback UI should be displayed
const [showFasterCompilesFeedbackUI, setShowFasterCompilesFeedbackUI] =
useState(false)
// whether the compile dropdown arrow should be animated
const [animateCompileDropdownArrow, setAnimateCompileDropdownArrow] =
useState(false)
@@ -358,9 +348,6 @@ export const LocalCompileProvider: FC = ({ children }) => {
if (data.clsiServerId) {
setClsiServerId(data.clsiServerId) // set in scope, for PdfSynctexController
}
setShowFasterCompilesFeedbackUI(
Boolean(data.showFasterCompilesFeedbackUI)
)
if (data.outputFiles) {
const outputFiles = new Map()
@@ -633,8 +620,6 @@ export const LocalCompileProvider: FC = ({ children }) => {
setStopOnFirstError,
setStopOnValidationError,
showLogs,
showNewCompileTimeoutUI,
showFasterCompilesFeedbackUI,
startCompile,
stopCompile,
stopOnFirstError,
@@ -683,8 +668,6 @@ export const LocalCompileProvider: FC = ({ children }) => {
setStopOnValidationError,
showCompileTimeWarning,
showLogs,
showNewCompileTimeoutUI,
showFasterCompilesFeedbackUI,
startCompile,
stopCompile,
stopOnFirstError,
@@ -30,7 +30,6 @@ const ProjectContext = createContext<
_id: UserId
email: string
}
showNewCompileTimeoutUI?: string
tags: {
_id: string
name: string
@@ -74,7 +73,6 @@ export const ProjectProvider: FC = ({ children }) => {
features,
publicAccesLevel: publicAccessLevel,
owner,
showNewCompileTimeoutUI,
trackChangesState,
} = project || projectFallback
@@ -86,17 +84,6 @@ export const ProjectProvider: FC = ({ children }) => {
[]
)
// temporary override for new compile timeout
const forceNewCompileTimeout = new URLSearchParams(
window.location.search
).get('force_new_compile_timeout')
const newCompileTimeoutOverride =
forceNewCompileTimeout === 'active'
? 'active'
: forceNewCompileTimeout === 'changing'
? 'changing'
: undefined
const value = useMemo(() => {
return {
_id,
@@ -107,8 +94,6 @@ export const ProjectProvider: FC = ({ children }) => {
features,
publicAccessLevel,
owner,
showNewCompileTimeoutUI:
newCompileTimeoutOverride || showNewCompileTimeoutUI,
tags,
trackChangesState,
}
@@ -121,8 +106,6 @@ export const ProjectProvider: FC = ({ children }) => {
features,
publicAccessLevel,
owner,
showNewCompileTimeoutUI,
newCompileTimeoutOverride,
tags,
trackChangesState,
])