[monorepo] run prettier on Jenkinsfiles (#28565)

* [monorepo] consolidate .editorconfig files at the root

* [monorepo] run prettier on Jenkinsfiles

* [saas-e2e] increase timeout for XeTeX compile

GitOrigin-RevId: 48aa82f7c81611899837753ae92c7732998d4ca5
This commit is contained in:
Jakob Ackermann
2025-09-18 14:11:05 +02:00
committed by Copybot
parent 66934586b1
commit a6e9a5c7e9
24 changed files with 310 additions and 276 deletions

View File

@@ -19,3 +19,7 @@ indent_style = tab
[*.{pug,patch}]
trim_trailing_whitespace = false
[Jenkinsfile]
insert_final_newline = false
max_line_length = off

View File

@@ -1,9 +0,0 @@
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

View File

@@ -1,11 +0,0 @@
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 79
tab_width = 4
trim_trailing_whitespace = true

View File

@@ -95,11 +95,7 @@ async function runCheck(client, uniqueToken, context) {
.del(healthCheckKey)
.exec()
.catch(err => {
throw new RedisHealthCheckVerifyError(
'read/delete errored',
context,
err
)
throw new RedisHealthCheckVerifyError('read/delete errored', context, err)
})
if (roundTrippedHealthCheckValue !== healthCheckValue) {
context.roundTrippedHealthCheckValue = roundTrippedHealthCheckValue

14
package-lock.json generated
View File

@@ -56,6 +56,7 @@
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-unicorn": "^56.0.0",
"prettier": "3.6.2",
"prettier-plugin-groovy": "0.2.1",
"typescript": "^5.8.3"
},
"engines": {
@@ -41077,6 +41078,19 @@
"node": ">=6.0.0"
}
},
"node_modules/prettier-plugin-groovy": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/prettier-plugin-groovy/-/prettier-plugin-groovy-0.2.1.tgz",
"integrity": "sha512-89i4b9nxnQ+KKjl/rSktUA0u1HFCK3HeoqXAaHNpQC8wKjnL/FJ87pRQlDi0nrmGsWRcvGqbD1FaTgSS0EZ44Q==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=20.0.0 || ^18.12.0"
},
"peerDependencies": {
"prettier": "^3.3.3"
}
},
"node_modules/pretty-bytes": {
"version": "5.6.0",
"resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz",

View File

@@ -23,6 +23,7 @@
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-unicorn": "^56.0.0",
"prettier": "3.6.2",
"prettier-plugin-groovy": "0.2.1",
"typescript": "^5.8.3"
},
"engines": {

View File

@@ -1,9 +0,0 @@
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

View File

@@ -18,7 +18,6 @@ pipeline {
customWorkspace '/workspace'
}
}
options {
// Print timestamp next to each log line.
timestamps()
@@ -27,12 +26,10 @@ pipeline {
retry(3)
timeout(time: 15, unit: 'MINUTES')
}
environment {
BRANCH_NAME = "${GIT_BRANCH.replace('origin/', '')}"
COMMIT_SHA = "${GIT_COMMIT}"
SHORT_SHA = "${GIT_COMMIT.take(7)}"
OVERLEAF_BASE_BRANCH = "us-east1-docker.pkg.dev/overleaf-ops/ol-docker/overleaf-base-internal:${BRANCH_NAME}"
OVERLEAF_BASE_LATEST = "us-east1-docker.pkg.dev/overleaf-ops/ol-docker/overleaf-base-internal:main"
OVERLEAF_BASE_TAG = "us-east1-docker.pkg.dev/overleaf-ops/ol-docker/overleaf-base-internal:${BRANCH_NAME}-${SHORT_SHA}_${BUILD_ID}"
@@ -42,7 +39,6 @@ pipeline {
IMAGE_TAG_CE = "${OVERLEAF_TAG}"
IMAGE_TAG_PRO = "us-east1-docker.pkg.dev/overleaf-ops/ol-docker/pro:main"
}
stages {
// Retries will use the same pipeline instance. Reset the vars.
stage('Reset vars') {
@@ -63,10 +59,11 @@ pipeline {
steps {
sh 'make install -j10'
sh 'make -C server-ce/test npm_install_in_docker'
script { job_npm_install_done = true }
script {
job_npm_install_done = true
}
}
}
stage('shellcheck') {
steps {
dir('server-ce') {
@@ -74,62 +71,81 @@ pipeline {
}
}
}
stage('Format') {
steps {
script { waitUntil { return job_npm_install_done } }
script {
waitUntil {
return job_npm_install_done
}
}
dir('server-ce/test') {
sh 'make format_in_docker'
}
}
}
stage('Copybara') {
steps {
sh 'copybara/bin/sync'
script { job_copybara_done = true }
script {
job_copybara_done = true
}
}
}
stage('Build CE image') {
steps {
script { waitUntil { return job_copybara_done } }
script {
waitUntil {
return job_copybara_done
}
}
dir('copybara/public/repo/server-ce') {
sh 'make build-base'
sh 'make build-community'
}
script { job_server_ce_build_done = true }
script {
job_server_ce_build_done = true
}
}
}
stage('Push CE to internal') {
steps {
script { waitUntil { return job_server_ce_build_done } }
script {
waitUntil {
return job_server_ce_build_done
}
}
dir('copybara/public/repo/server-ce') {
sh 'make push'
}
}
}
stage('Build Pro image') {
environment {
OVERLEAF_CE_TAG = "${OVERLEAF_TAG}"
OVERLEAF_PRO_TAG= "${IMAGE_TAG_PRO}"
OVERLEAF_PRO_TAG = "${IMAGE_TAG_PRO}"
}
steps {
script { waitUntil { return job_server_ce_build_done } }
script {
waitUntil {
return job_server_ce_build_done
}
}
dir('server-pro') {
sh 'make build-ci'
}
script { job_server_pro_build_done = true }
script {
job_server_pro_build_done = true
}
}
}
stage('Prefetch default') {
steps {
dir('server-ce/test') {
sh 'make prefetch_default -j4'
}
script { job_prefetch_default_done = true }
script {
job_prefetch_default_done = true
}
}
}
stage('Prefetch custom') {
@@ -137,17 +153,22 @@ pipeline {
dir('server-ce/test') {
sh 'make prefetch_custom -j4'
}
script { job_prefetch_custom_done = true }
script {
job_prefetch_custom_done = true
}
}
}
stage('CE default') {
environment {
CYPRESS_SHARD = "CE_DEFAULT"
COMPOSE_PROJECT_NAME = "test-ce-default"
}
steps {
script { waitUntil { return job_npm_install_done && job_server_ce_build_done && job_prefetch_default_done } }
script {
waitUntil {
return job_npm_install_done && job_server_ce_build_done && job_prefetch_default_done
}
}
dir('server-ce/test') {
sh 'make test-e2e'
}
@@ -159,20 +180,27 @@ pipeline {
COMPOSE_PROJECT_NAME = "test-ce-custom-1"
}
steps {
script { waitUntil { return job_npm_install_done && job_server_ce_build_done && job_prefetch_default_done && job_prefetch_custom_done } }
script {
waitUntil {
return job_npm_install_done && job_server_ce_build_done && job_prefetch_default_done && job_prefetch_custom_done
}
}
dir('server-ce/test') {
sh 'make test-e2e'
}
}
}
stage('PRO default 1') {
environment {
CYPRESS_SHARD = "PRO_DEFAULT_1"
COMPOSE_PROJECT_NAME = "test-pro-default-1"
}
steps {
script { waitUntil { return job_npm_install_done && job_server_pro_build_done && job_prefetch_default_done } }
script {
waitUntil {
return job_npm_install_done && job_server_pro_build_done && job_prefetch_default_done
}
}
dir('server-ce/test') {
sh 'make test-e2e'
}
@@ -184,7 +212,11 @@ pipeline {
COMPOSE_PROJECT_NAME = "test-pro-default-2"
}
steps {
script { waitUntil { return job_npm_install_done && job_server_pro_build_done && job_prefetch_default_done } }
script {
waitUntil {
return job_npm_install_done && job_server_pro_build_done && job_prefetch_default_done
}
}
dir('server-ce/test') {
sh 'make test-e2e'
}
@@ -196,7 +228,11 @@ pipeline {
COMPOSE_PROJECT_NAME = "test-pro-custom-1"
}
steps {
script { waitUntil { return job_npm_install_done && job_server_pro_build_done && job_prefetch_default_done && job_prefetch_custom_done } }
script {
waitUntil {
return job_npm_install_done && job_server_pro_build_done && job_prefetch_default_done && job_prefetch_custom_done
}
}
dir('server-ce/test') {
sh 'make test-e2e'
}
@@ -208,7 +244,11 @@ pipeline {
COMPOSE_PROJECT_NAME = "test-pro-custom-2"
}
steps {
script { waitUntil { return job_npm_install_done && job_server_pro_build_done && job_prefetch_default_done && job_prefetch_custom_done } }
script {
waitUntil {
return job_npm_install_done && job_server_pro_build_done && job_prefetch_default_done && job_prefetch_custom_done
}
}
dir('server-ce/test') {
sh 'make test-e2e'
}
@@ -220,7 +260,11 @@ pipeline {
COMPOSE_PROJECT_NAME = "test-pro-custom-3"
}
steps {
script { waitUntil { return job_npm_install_done && job_server_pro_build_done && job_prefetch_default_done && job_prefetch_custom_done } }
script {
waitUntil {
return job_npm_install_done && job_server_pro_build_done && job_prefetch_default_done && job_prefetch_custom_done
}
}
dir('server-ce/test') {
sh 'make test-e2e'
}
@@ -232,7 +276,11 @@ pipeline {
COMPOSE_PROJECT_NAME = "test-pro-custom-4"
}
steps {
script { waitUntil { return job_npm_install_done && job_server_pro_build_done && job_prefetch_default_done && job_prefetch_custom_done } }
script {
waitUntil {
return job_npm_install_done && job_server_pro_build_done && job_prefetch_default_done && job_prefetch_custom_done
}
}
dir('server-ce/test') {
sh 'make test-e2e'
}

View File

@@ -5,8 +5,8 @@
"scripts": {
"cypress:open": "cypress open --e2e --browser chrome",
"cypress:run": "cypress run --e2e --browser chrome",
"format": "prettier --list-different $PWD/'**/*.{js,mjs,ts,tsx,json}'",
"format:fix": "prettier --write $PWD/'**/*.{js,mjs,ts,tsx,json}'"
"format": "prettier --list-different $PWD/'**/{*.{js,mjs,ts,tsx,json},Jenkinsfile}'",
"format:fix": "prettier --write $PWD/'**/{*.{js,mjs,ts,tsx,json},Jenkinsfile}'"
},
"dependencies": {
"@isomorphic-git/lightning-fs": "^4.6.0",

View File

@@ -12,8 +12,8 @@
"test:acceptance:_run": "mocha --recursive --reporter spec --timeout 15000 --exit $@ test/acceptance/js",
"test:unit:_run": "mocha --recursive --reporter spec --exit $@ test/unit/js",
"lint": "eslint --max-warnings 0 --format unix .",
"format": "prettier --list-different $PWD/'**/*.*js'",
"format:fix": "prettier --write $PWD/'**/*.*js'",
"format": "prettier --list-different $PWD/'**/{*.*js,Jenkinsfile}'",
"format:fix": "prettier --write $PWD/'**/{*.*js,Jenkinsfile}'",
"lint:fix": "eslint --fix .",
"types:check": "tsc --noEmit"
},

View File

@@ -11,8 +11,8 @@
"test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP",
"nodemon": "node --watch app.js",
"lint": "eslint --max-warnings 0 --format unix .",
"format": "prettier --list-different $PWD/'**/*.*js'",
"format:fix": "prettier --write $PWD/'**/*.*js'",
"format": "prettier --list-different $PWD/'**/{*.*js,Jenkinsfile}'",
"format:fix": "prettier --write $PWD/'**/{*.*js,Jenkinsfile}'",
"lint:fix": "eslint --fix .",
"types:check": "tsc --noEmit"
},

View File

@@ -1,19 +1,16 @@
pipeline {
agent {
node {
label 'jenkins-agent-web'
customWorkspace '/workspace'
}
}
options {
timestamps()
parallelsAlwaysFailFast()
retry(3)
timeout(time: 15, unit: 'MINUTES')
}
environment {
IMAGE_NAME = 'contacts'
PROJECT_NAME = 'contacts'
@@ -27,8 +24,6 @@ pipeline {
COMMIT_SHA = "${GIT_COMMIT}"
SHORT_SHA = "${GIT_COMMIT.take(7)}"
}
stages {
stage ('Build') {
steps {
@@ -107,4 +102,3 @@ pipeline {
}
}
}

View File

@@ -12,8 +12,8 @@
"test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP",
"nodemon": "node --watch app.js",
"lint": "eslint --max-warnings 0 --format unix .",
"format": "prettier --list-different $PWD/'**/*.*js'",
"format:fix": "prettier --write $PWD/'**/*.*js'",
"format": "prettier --list-different $PWD/'**/{*.*js,Jenkinsfile}'",
"format:fix": "prettier --write $PWD/'**/{*.*js,Jenkinsfile}'",
"lint:fix": "eslint --fix .",
"types:check": "tsc --noEmit"
},

View File

@@ -11,8 +11,8 @@
"test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP",
"nodemon": "node --watch app.js",
"lint": "eslint --max-warnings 0 --format unix .",
"format": "prettier --list-different $PWD/'**/*.*js'",
"format:fix": "prettier --write $PWD/'**/*.*js'",
"format": "prettier --list-different $PWD/'**/{*.*js,Jenkinsfile}'",
"format:fix": "prettier --write $PWD/'**/{*.*js,Jenkinsfile}'",
"lint:fix": "eslint --fix .",
"types:check": "tsc --noEmit"
},

View File

@@ -12,8 +12,8 @@
"nodemon": "node --watch app.js",
"benchmark:apply": "node benchmarks/apply",
"lint": "eslint --max-warnings 0 --format unix .",
"format": "prettier --list-different $PWD/'**/*.*js'",
"format:fix": "prettier --write $PWD/'**/*.*js'",
"format": "prettier --list-different $PWD/'**/{*.*js,Jenkinsfile}'",
"format:fix": "prettier --write $PWD/'**/{*.*js,Jenkinsfile}'",
"lint:fix": "eslint --fix .",
"types:check": "tsc --noEmit"
},

View File

@@ -11,8 +11,8 @@
"start": "node app.js",
"nodemon": "node --watch app.js",
"lint": "eslint --max-warnings 0 --format unix .",
"format": "prettier --list-different $PWD/'**/*.*js'",
"format:fix": "prettier --write $PWD/'**/*.*js'",
"format": "prettier --list-different $PWD/'**/{*.*js,Jenkinsfile}'",
"format:fix": "prettier --write $PWD/'**/{*.*js,Jenkinsfile}'",
"test:acceptance:_run": "mocha --recursive --reporter spec --timeout 15000 --exit $@ test/acceptance/js",
"test:unit:_run": "mocha --recursive --reporter spec --exit $@ test/unit/js",
"lint:fix": "eslint --fix .",

View File

@@ -62,8 +62,8 @@
"start": "node app.js",
"lint": "eslint --max-warnings 0 --format unix .",
"lint:fix": "eslint --fix .",
"format": "prettier --list-different $PWD/'**/*.*js'",
"format:fix": "prettier --write $PWD/'**/*.*js'",
"format": "prettier --list-different $PWD/'**/{*.*js,Jenkinsfile}'",
"format:fix": "prettier --write $PWD/'**/{*.*js,Jenkinsfile}'",
"test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP",
"test:acceptance": "npm run test:acceptance:_run -- --grep=$MOCHA_GREP",
"test:unit:_run": "mocha --recursive --reporter spec --exit $@ test/unit/js",

View File

@@ -11,8 +11,8 @@
"test:unit:_run": "vitest ${NO_CACHE:+\"--no-cache\"} $@ test/unit/js",
"test:unit": "npm run test:unit:_run",
"lint": "eslint --max-warnings 0 --format unix .",
"format": "prettier --list-different $PWD/'**/*.*js'",
"format:fix": "prettier --write $PWD/'**/*.*js'",
"format": "prettier --list-different $PWD/'**/{*.*js,Jenkinsfile}'",
"format:fix": "prettier --write $PWD/'**/{*.*js,Jenkinsfile}'",
"lint:fix": "eslint --fix .",
"types:check": "tsc --noEmit"
},

View File

@@ -12,8 +12,8 @@
"test:acceptance:_run": "mocha --loader=esmock --recursive --reporter spec --timeout 15000 --exit $@ test/acceptance/js",
"test:unit:_run": "mocha --loader=esmock --recursive --reporter spec --exit $@ test/unit/js",
"lint": "eslint --max-warnings 0 --format unix .",
"format": "prettier --list-different $PWD/'**/*.*js'",
"format:fix": "prettier --write $PWD/'**/*.*js'",
"format": "prettier --list-different $PWD/'**/{*.*js,Jenkinsfile}'",
"format:fix": "prettier --write $PWD/'**/{*.*js,Jenkinsfile}'",
"lint:fix": "eslint --fix .",
"types:check": "tsc --noEmit"
},

View File

@@ -11,8 +11,8 @@
"test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP",
"nodemon": "node --watch app.js",
"lint": "eslint --max-warnings 0 --format unix .",
"format": "prettier --list-different $PWD/'**/*.*js'",
"format:fix": "prettier --write $PWD/'**/*.*js'",
"format": "prettier --list-different $PWD/'**/{*.*js,Jenkinsfile}'",
"format:fix": "prettier --write $PWD/'**/{*.*js,Jenkinsfile}'",
"lint:fix": "eslint --fix .",
"types:check": "tsc --noEmit"
},

View File

@@ -6,7 +6,7 @@
"pugClassNotation": "as-is",
"pugIdNotation": "as-is",
"pugSortAttributesBeginning": ["name", "data-type"],
"plugins": ["@prettier/plugin-pug"],
"plugins": ["@prettier/plugin-pug", "prettier-plugin-groovy"],
"semi": false,
"singleQuote": true,
"trailingComma": "es5",

View File

@@ -10,7 +10,7 @@ def action_test_acceptance_app_server_pro = false
def action_build_webpack = false
def action_test_acceptance_app_saas = false
def action_build_pug = false
def action_build_production= false
def action_build_production = false
pipeline {
agent {
@@ -21,7 +21,6 @@ pipeline {
customWorkspace '/workspace'
}
}
options {
// Print timestamp next to each log line.
timestamps()
@@ -30,7 +29,6 @@ pipeline {
retry(3)
timeout(time: 15, unit: 'MINUTES')
}
environment {
IMAGE_NAME = 'web'
PROJECT_NAME = 'web'
@@ -46,7 +44,6 @@ pipeline {
CDN_STAG = "gs://ol-stag-web-assets-1"
CDN_PROD = "gs://mgcp-1117973-ol-prod-web-assets-1"
}
stages {
// Retries will use the same pipeline instance. Reset the vars.
stage('Reset vars') {
@@ -397,7 +394,7 @@ pipeline {
}
}
}
stage('Build Webpack'){
stage('Build Webpack') {
steps {
script {
waitUntil {
@@ -440,7 +437,7 @@ pipeline {
}
}
}
stage('Build Production'){
stage('Build Production') {
steps {
script {
waitUntil {

View File

@@ -480,6 +480,10 @@ format: format_pug
format_pug:
npm run --silent format:pug
format: format_jenkins
format_jenkins:
npm run --silent format:jenkins
format_fix:
npm run --silent format:fix
@@ -489,6 +493,9 @@ format_styles_fix:
format_pug_fix:
npm run --silent format:pug:fix
format_jenkins_fix:
npm run --silent format:jenkins:fix
format_in_docker:
$(RUN_LINT_FORMAT) make format -j2 --output-sync

View File

@@ -31,6 +31,8 @@
"format:styles:fix": "prettier --write $PWD/'**/*.{css,scss}'",
"format:pug": "prettier --list-different $PWD/'**/*.pug'",
"format:pug:fix": "prettier --write $PWD/'**/*.pug'",
"format:jenkins": "prettier --list-different $PWD/'**/Jenkinsfile'",
"format:jenkins:fix": "prettier --write $PWD/'**/Jenkinsfile'",
"lint": "eslint --max-warnings 0 --format unix --ext .js,.jsx,.mjs,.ts,.tsx .",
"lint:fix": "eslint --fix --ext .js,.jsx,.mjs,.ts,.tsx .",
"lint:styles": "stylelint '**/*.scss'",