[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}] [*.{pug,patch}]
trim_trailing_whitespace = false 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) .del(healthCheckKey)
.exec() .exec()
.catch(err => { .catch(err => {
throw new RedisHealthCheckVerifyError( throw new RedisHealthCheckVerifyError('read/delete errored', context, err)
'read/delete errored',
context,
err
)
}) })
if (roundTrippedHealthCheckValue !== healthCheckValue) { if (roundTrippedHealthCheckValue !== healthCheckValue) {
context.roundTrippedHealthCheckValue = roundTrippedHealthCheckValue context.roundTrippedHealthCheckValue = roundTrippedHealthCheckValue

14
package-lock.json generated
View File

@@ -56,6 +56,7 @@
"eslint-plugin-promise": "^6.0.0", "eslint-plugin-promise": "^6.0.0",
"eslint-plugin-unicorn": "^56.0.0", "eslint-plugin-unicorn": "^56.0.0",
"prettier": "3.6.2", "prettier": "3.6.2",
"prettier-plugin-groovy": "0.2.1",
"typescript": "^5.8.3" "typescript": "^5.8.3"
}, },
"engines": { "engines": {
@@ -41077,6 +41078,19 @@
"node": ">=6.0.0" "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": { "node_modules/pretty-bytes": {
"version": "5.6.0", "version": "5.6.0",
"resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", "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-promise": "^6.0.0",
"eslint-plugin-unicorn": "^56.0.0", "eslint-plugin-unicorn": "^56.0.0",
"prettier": "3.6.2", "prettier": "3.6.2",
"prettier-plugin-groovy": "0.2.1",
"typescript": "^5.8.3" "typescript": "^5.8.3"
}, },
"engines": { "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' customWorkspace '/workspace'
} }
} }
options { options {
// Print timestamp next to each log line. // Print timestamp next to each log line.
timestamps() timestamps()
@@ -27,12 +26,10 @@ pipeline {
retry(3) retry(3)
timeout(time: 15, unit: 'MINUTES') timeout(time: 15, unit: 'MINUTES')
} }
environment { environment {
BRANCH_NAME = "${GIT_BRANCH.replace('origin/', '')}" BRANCH_NAME = "${GIT_BRANCH.replace('origin/', '')}"
COMMIT_SHA = "${GIT_COMMIT}" COMMIT_SHA = "${GIT_COMMIT}"
SHORT_SHA = "${GIT_COMMIT.take(7)}" 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_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_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}" 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_CE = "${OVERLEAF_TAG}"
IMAGE_TAG_PRO = "us-east1-docker.pkg.dev/overleaf-ops/ol-docker/pro:main" IMAGE_TAG_PRO = "us-east1-docker.pkg.dev/overleaf-ops/ol-docker/pro:main"
} }
stages { stages {
// Retries will use the same pipeline instance. Reset the vars. // Retries will use the same pipeline instance. Reset the vars.
stage('Reset vars') { stage('Reset vars') {
@@ -63,10 +59,11 @@ pipeline {
steps { steps {
sh 'make install -j10' sh 'make install -j10'
sh 'make -C server-ce/test npm_install_in_docker' sh 'make -C server-ce/test npm_install_in_docker'
script { job_npm_install_done = true } script {
job_npm_install_done = true
}
} }
} }
stage('shellcheck') { stage('shellcheck') {
steps { steps {
dir('server-ce') { dir('server-ce') {
@@ -74,62 +71,81 @@ pipeline {
} }
} }
} }
stage('Format') { stage('Format') {
steps { steps {
script { waitUntil { return job_npm_install_done } } script {
waitUntil {
return job_npm_install_done
}
}
dir('server-ce/test') { dir('server-ce/test') {
sh 'make format_in_docker' sh 'make format_in_docker'
} }
} }
} }
stage('Copybara') { stage('Copybara') {
steps { steps {
sh 'copybara/bin/sync' sh 'copybara/bin/sync'
script { job_copybara_done = true } script {
job_copybara_done = true
}
} }
} }
stage('Build CE image') { stage('Build CE image') {
steps { steps {
script { waitUntil { return job_copybara_done } } script {
waitUntil {
return job_copybara_done
}
}
dir('copybara/public/repo/server-ce') { dir('copybara/public/repo/server-ce') {
sh 'make build-base' sh 'make build-base'
sh 'make build-community' sh 'make build-community'
} }
script { job_server_ce_build_done = true } script {
job_server_ce_build_done = true
}
} }
} }
stage('Push CE to internal') { stage('Push CE to internal') {
steps { steps {
script { waitUntil { return job_server_ce_build_done } } script {
waitUntil {
return job_server_ce_build_done
}
}
dir('copybara/public/repo/server-ce') { dir('copybara/public/repo/server-ce') {
sh 'make push' sh 'make push'
} }
} }
} }
stage('Build Pro image') { stage('Build Pro image') {
environment { environment {
OVERLEAF_CE_TAG = "${OVERLEAF_TAG}" OVERLEAF_CE_TAG = "${OVERLEAF_TAG}"
OVERLEAF_PRO_TAG= "${IMAGE_TAG_PRO}" OVERLEAF_PRO_TAG = "${IMAGE_TAG_PRO}"
} }
steps { steps {
script { waitUntil { return job_server_ce_build_done } } script {
waitUntil {
return job_server_ce_build_done
}
}
dir('server-pro') { dir('server-pro') {
sh 'make build-ci' sh 'make build-ci'
} }
script { job_server_pro_build_done = true } script {
job_server_pro_build_done = true
}
} }
} }
stage('Prefetch default') { stage('Prefetch default') {
steps { steps {
dir('server-ce/test') { dir('server-ce/test') {
sh 'make prefetch_default -j4' sh 'make prefetch_default -j4'
} }
script { job_prefetch_default_done = true } script {
job_prefetch_default_done = true
}
} }
} }
stage('Prefetch custom') { stage('Prefetch custom') {
@@ -137,17 +153,22 @@ pipeline {
dir('server-ce/test') { dir('server-ce/test') {
sh 'make prefetch_custom -j4' sh 'make prefetch_custom -j4'
} }
script { job_prefetch_custom_done = true } script {
job_prefetch_custom_done = true
}
} }
} }
stage('CE default') { stage('CE default') {
environment { environment {
CYPRESS_SHARD = "CE_DEFAULT" CYPRESS_SHARD = "CE_DEFAULT"
COMPOSE_PROJECT_NAME = "test-ce-default" COMPOSE_PROJECT_NAME = "test-ce-default"
} }
steps { 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') { dir('server-ce/test') {
sh 'make test-e2e' sh 'make test-e2e'
} }
@@ -159,20 +180,27 @@ pipeline {
COMPOSE_PROJECT_NAME = "test-ce-custom-1" COMPOSE_PROJECT_NAME = "test-ce-custom-1"
} }
steps { 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') { dir('server-ce/test') {
sh 'make test-e2e' sh 'make test-e2e'
} }
} }
} }
stage('PRO default 1') { stage('PRO default 1') {
environment { environment {
CYPRESS_SHARD = "PRO_DEFAULT_1" CYPRESS_SHARD = "PRO_DEFAULT_1"
COMPOSE_PROJECT_NAME = "test-pro-default-1" COMPOSE_PROJECT_NAME = "test-pro-default-1"
} }
steps { 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') { dir('server-ce/test') {
sh 'make test-e2e' sh 'make test-e2e'
} }
@@ -184,7 +212,11 @@ pipeline {
COMPOSE_PROJECT_NAME = "test-pro-default-2" COMPOSE_PROJECT_NAME = "test-pro-default-2"
} }
steps { 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') { dir('server-ce/test') {
sh 'make test-e2e' sh 'make test-e2e'
} }
@@ -196,7 +228,11 @@ pipeline {
COMPOSE_PROJECT_NAME = "test-pro-custom-1" COMPOSE_PROJECT_NAME = "test-pro-custom-1"
} }
steps { 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') { dir('server-ce/test') {
sh 'make test-e2e' sh 'make test-e2e'
} }
@@ -208,7 +244,11 @@ pipeline {
COMPOSE_PROJECT_NAME = "test-pro-custom-2" COMPOSE_PROJECT_NAME = "test-pro-custom-2"
} }
steps { 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') { dir('server-ce/test') {
sh 'make test-e2e' sh 'make test-e2e'
} }
@@ -220,7 +260,11 @@ pipeline {
COMPOSE_PROJECT_NAME = "test-pro-custom-3" COMPOSE_PROJECT_NAME = "test-pro-custom-3"
} }
steps { 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') { dir('server-ce/test') {
sh 'make test-e2e' sh 'make test-e2e'
} }
@@ -232,7 +276,11 @@ pipeline {
COMPOSE_PROJECT_NAME = "test-pro-custom-4" COMPOSE_PROJECT_NAME = "test-pro-custom-4"
} }
steps { 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') { dir('server-ce/test') {
sh 'make test-e2e' sh 'make test-e2e'
} }
@@ -255,4 +303,4 @@ pipeline {
} }
} }
// vim: set ft=groovy : // vim: set ft=groovy :

View File

@@ -5,8 +5,8 @@
"scripts": { "scripts": {
"cypress:open": "cypress open --e2e --browser chrome", "cypress:open": "cypress open --e2e --browser chrome",
"cypress:run": "cypress run --e2e --browser chrome", "cypress:run": "cypress run --e2e --browser chrome",
"format": "prettier --list-different $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}'" "format:fix": "prettier --write $PWD/'**/{*.{js,mjs,ts,tsx,json},Jenkinsfile}'"
}, },
"dependencies": { "dependencies": {
"@isomorphic-git/lightning-fs": "^4.6.0", "@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:acceptance:_run": "mocha --recursive --reporter spec --timeout 15000 --exit $@ test/acceptance/js",
"test:unit:_run": "mocha --recursive --reporter spec --exit $@ test/unit/js", "test:unit:_run": "mocha --recursive --reporter spec --exit $@ test/unit/js",
"lint": "eslint --max-warnings 0 --format unix .", "lint": "eslint --max-warnings 0 --format unix .",
"format": "prettier --list-different $PWD/'**/*.*js'", "format": "prettier --list-different $PWD/'**/{*.*js,Jenkinsfile}'",
"format:fix": "prettier --write $PWD/'**/*.*js'", "format:fix": "prettier --write $PWD/'**/{*.*js,Jenkinsfile}'",
"lint:fix": "eslint --fix .", "lint:fix": "eslint --fix .",
"types:check": "tsc --noEmit" "types:check": "tsc --noEmit"
}, },

View File

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

View File

@@ -1,110 +1,104 @@
pipeline { pipeline {
agent {
agent { node {
node { label 'jenkins-agent-web'
label 'jenkins-agent-web' customWorkspace '/workspace'
customWorkspace '/workspace' }
}
options {
timestamps()
parallelsAlwaysFailFast()
retry(3)
timeout(time: 15, unit: 'MINUTES')
}
environment {
IMAGE_NAME = 'contacts'
PROJECT_NAME = 'contacts'
IMAGE_REPO = 'us-east1-docker.pkg.dev/overleaf-ops/ol-docker/contacts'
AR_REPO_LOCATION = 'us-east1'
AR_URL = 'us-east1-docker.pkg.dev/overleaf-ops/ol-docker'
BRANCH_NAME = "${env.CHANGE_BRANCH ? env.CHANGE_BRANCH : env.BRANCH_NAME}"
JENKINS_BUILD_NUMBER = "${BUILD_NUMBER}"
BUILD_NUMBER = "${SHORT_SHA}_${BUILD_NUMBER}"
DOCKER_COMPOSE_FLAGS = '-f docker-compose.ci.yml'
COMMIT_SHA = "${GIT_COMMIT}"
SHORT_SHA = "${GIT_COMMIT.take(7)}"
}
stages {
stage ('Build') {
steps {
dir ('services/contacts') {
sh 'make build'
}
} }
} }
stage ('Tests') {
options { parallel {
timestamps() stage ('Push Branch Image') {
parallelsAlwaysFailFast() steps {
retry(3) dir ('services/contacts') {
timeout(time: 15, unit: 'MINUTES') sh 'docker push ${AR_URL}/${IMAGE_NAME}:${BRANCH_NAME}'
}
environment {
IMAGE_NAME = 'contacts'
PROJECT_NAME = 'contacts'
IMAGE_REPO = 'us-east1-docker.pkg.dev/overleaf-ops/ol-docker/contacts'
AR_REPO_LOCATION = 'us-east1'
AR_URL = 'us-east1-docker.pkg.dev/overleaf-ops/ol-docker'
BRANCH_NAME = "${env.CHANGE_BRANCH ? env.CHANGE_BRANCH : env.BRANCH_NAME}"
JENKINS_BUILD_NUMBER = "${BUILD_NUMBER}"
BUILD_NUMBER = "${SHORT_SHA}_${BUILD_NUMBER}"
DOCKER_COMPOSE_FLAGS = '-f docker-compose.ci.yml'
COMMIT_SHA = "${GIT_COMMIT}"
SHORT_SHA = "${GIT_COMMIT.take(7)}"
}
stages {
stage ('Build') {
steps {
dir ('services/contacts') {
sh 'make build'
}
} }
}
} }
stage ('Tests') { stage ('Shellcheck') {
parallel { steps {
stage ('Push Branch Image') { dir ('services/contacts') {
steps { sh 'make shellcheck'
dir ('services/contacts') {
sh 'docker push ${AR_URL}/${IMAGE_NAME}:${BRANCH_NAME}'
}
}
}
stage ('Shellcheck') {
steps {
dir ('services/contacts') {
sh 'make shellcheck'
}
}
}
stage ('Lint') {
steps {
dir ('services/contacts') {
sh 'make lint_ci'
}
}
}
stage ('Format') {
steps {
dir ('services/contacts') {
sh 'make format_ci'
}
}
}
stage ('Typecheck') {
steps {
dir ('services/contacts') {
sh 'make typecheck_ci'
}
}
}
stage ('Test Unit') {
steps {
dir ('services/contacts') {
sh 'make test_unit'
}
}
}
stage ('Test Acceptance') {
steps {
dir ('services/contacts') {
sh 'make test_acceptance'
}
}
}
} }
}
} }
stage('Push Production') { stage ('Lint') {
steps { steps {
dir('services/contacts') { dir ('services/contacts') {
sh 'docker push ${AR_URL}/${IMAGE_NAME}:${BRANCH_NAME}-${BUILD_NUMBER}' sh 'make lint_ci'
}
} }
}
} }
stage ('Format') {
steps {
dir ('services/contacts') {
sh 'make format_ci'
}
}
}
stage ('Typecheck') {
steps {
dir ('services/contacts') {
sh 'make typecheck_ci'
}
}
}
stage ('Test Unit') {
steps {
dir ('services/contacts') {
sh 'make test_unit'
}
}
}
stage ('Test Acceptance') {
steps {
dir ('services/contacts') {
sh 'make test_acceptance'
}
}
}
}
} }
post { stage('Push Production') {
cleanup { steps {
dir('services/contacts') { dir('services/contacts') {
sh 'make clean' sh 'docker push ${AR_URL}/${IMAGE_NAME}:${BRANCH_NAME}-${BUILD_NUMBER}'
}
sh 'make clean_jenkins'
} }
}
} }
} }
post {
cleanup {
dir('services/contacts') {
sh 'make clean'
}
sh 'make clean_jenkins'
}
}
}

View File

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

View File

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

View File

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

View File

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

View File

@@ -62,8 +62,8 @@
"start": "node app.js", "start": "node app.js",
"lint": "eslint --max-warnings 0 --format unix .", "lint": "eslint --max-warnings 0 --format unix .",
"lint:fix": "eslint --fix .", "lint:fix": "eslint --fix .",
"format": "prettier --list-different $PWD/'**/*.*js'", "format": "prettier --list-different $PWD/'**/{*.*js,Jenkinsfile}'",
"format:fix": "prettier --write $PWD/'**/*.*js'", "format:fix": "prettier --write $PWD/'**/{*.*js,Jenkinsfile}'",
"test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP", "test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP",
"test:acceptance": "npm run test:acceptance:_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", "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:_run": "vitest ${NO_CACHE:+\"--no-cache\"} $@ test/unit/js",
"test:unit": "npm run test:unit:_run", "test:unit": "npm run test:unit:_run",
"lint": "eslint --max-warnings 0 --format unix .", "lint": "eslint --max-warnings 0 --format unix .",
"format": "prettier --list-different $PWD/'**/*.*js'", "format": "prettier --list-different $PWD/'**/{*.*js,Jenkinsfile}'",
"format:fix": "prettier --write $PWD/'**/*.*js'", "format:fix": "prettier --write $PWD/'**/{*.*js,Jenkinsfile}'",
"lint:fix": "eslint --fix .", "lint:fix": "eslint --fix .",
"types:check": "tsc --noEmit" "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: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", "test:unit:_run": "mocha --loader=esmock --recursive --reporter spec --exit $@ test/unit/js",
"lint": "eslint --max-warnings 0 --format unix .", "lint": "eslint --max-warnings 0 --format unix .",
"format": "prettier --list-different $PWD/'**/*.*js'", "format": "prettier --list-different $PWD/'**/{*.*js,Jenkinsfile}'",
"format:fix": "prettier --write $PWD/'**/*.*js'", "format:fix": "prettier --write $PWD/'**/{*.*js,Jenkinsfile}'",
"lint:fix": "eslint --fix .", "lint:fix": "eslint --fix .",
"types:check": "tsc --noEmit" "types:check": "tsc --noEmit"
}, },

View File

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

View File

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

View File

@@ -10,7 +10,7 @@ def action_test_acceptance_app_server_pro = false
def action_build_webpack = false def action_build_webpack = false
def action_test_acceptance_app_saas = false def action_test_acceptance_app_saas = false
def action_build_pug = false def action_build_pug = false
def action_build_production= false def action_build_production = false
pipeline { pipeline {
agent { agent {
@@ -21,7 +21,6 @@ pipeline {
customWorkspace '/workspace' customWorkspace '/workspace'
} }
} }
options { options {
// Print timestamp next to each log line. // Print timestamp next to each log line.
timestamps() timestamps()
@@ -30,23 +29,21 @@ pipeline {
retry(3) retry(3)
timeout(time: 15, unit: 'MINUTES') timeout(time: 15, unit: 'MINUTES')
} }
environment { environment {
IMAGE_NAME = 'web' IMAGE_NAME = 'web'
PROJECT_NAME = 'web' PROJECT_NAME = 'web'
IMAGE_REPO = 'us-east1-docker.pkg.dev/overleaf-ops/ol-docker/web' IMAGE_REPO = 'us-east1-docker.pkg.dev/overleaf-ops/ol-docker/web'
AR_REPO_LOCATION = 'us-east1' AR_REPO_LOCATION = 'us-east1'
AR_URL = 'us-east1-docker.pkg.dev/overleaf-ops/ol-docker' AR_URL = 'us-east1-docker.pkg.dev/overleaf-ops/ol-docker'
DOCKER_COMPOSE_FLAGS = '-f docker-compose.ci.yml' DOCKER_COMPOSE_FLAGS = '-f docker-compose.ci.yml'
BRANCH_NAME = "${env.CHANGE_BRANCH ? env.CHANGE_BRANCH : env.BRANCH_NAME}" BRANCH_NAME = "${env.CHANGE_BRANCH ? env.CHANGE_BRANCH : env.BRANCH_NAME}"
JENKINS_BUILD_NUMBER = "${BUILD_NUMBER}" // preserve original BUILD_NUMBER JENKINS_BUILD_NUMBER = "${BUILD_NUMBER}" // preserve original BUILD_NUMBER
BUILD_NUMBER = "${SHORT_SHA}_${BUILD_NUMBER}" // mimic the format used for Cloud Build BUILD_NUMBER = "${SHORT_SHA}_${BUILD_NUMBER}" // mimic the format used for Cloud Build
COMMIT_SHA = "${GIT_COMMIT}" COMMIT_SHA = "${GIT_COMMIT}"
SHORT_SHA = "${GIT_COMMIT.take(7)}" SHORT_SHA = "${GIT_COMMIT.take(7)}"
CDN_STAG = "gs://ol-stag-web-assets-1" CDN_STAG = "gs://ol-stag-web-assets-1"
CDN_PROD = "gs://mgcp-1117973-ol-prod-web-assets-1" CDN_PROD = "gs://mgcp-1117973-ol-prod-web-assets-1"
} }
stages { stages {
// Retries will use the same pipeline instance. Reset the vars. // Retries will use the same pipeline instance. Reset the vars.
stage('Reset vars') { stage('Reset vars') {
@@ -305,99 +302,99 @@ pipeline {
} }
} }
stage('test_frontend_ct_core_other') { stage('test_frontend_ct_core_other') {
environment { environment {
CYPRESS_INTERNAL_BROWSER_CONNECT_TIMEOUT = '120000' CYPRESS_INTERNAL_BROWSER_CONNECT_TIMEOUT = '120000'
}
steps {
script {
waitUntil {
return action_test_frontend_ct_build
}
} }
steps { dir('services/web') {
script { sh "make test_frontend_ct_core_other"
waitUntil {
return action_test_frontend_ct_build
}
}
dir('services/web') {
sh "make test_frontend_ct_core_other"
}
} }
}
} }
stage('test_frontend_ct_core_features') { stage('test_frontend_ct_core_features') {
environment { environment {
CYPRESS_INTERNAL_BROWSER_CONNECT_TIMEOUT = '120000' CYPRESS_INTERNAL_BROWSER_CONNECT_TIMEOUT = '120000'
}
steps {
script {
waitUntil {
return action_test_frontend_ct_build
}
} }
steps { dir('services/web') {
script { sh "make test_frontend_ct_core_features"
waitUntil {
return action_test_frontend_ct_build
}
}
dir('services/web') {
sh "make test_frontend_ct_core_features"
}
} }
}
} }
stage('test_frontend_ct_modules') { stage('test_frontend_ct_modules') {
environment { environment {
CYPRESS_INTERNAL_BROWSER_CONNECT_TIMEOUT = '120000' CYPRESS_INTERNAL_BROWSER_CONNECT_TIMEOUT = '120000'
}
steps {
script {
waitUntil {
return action_test_frontend_ct_build
}
} }
steps { dir('services/web') {
script { sh "make test_frontend_ct_modules"
waitUntil {
return action_test_frontend_ct_build
}
}
dir('services/web') {
sh "make test_frontend_ct_modules"
}
} }
}
} }
stage('test_frontend_ct_editor_visual') { stage('test_frontend_ct_editor_visual') {
steps { steps {
script { script {
waitUntil { waitUntil {
return action_test_frontend_ct_build return action_test_frontend_ct_build
} }
}
dir('services/web') {
sh "make test_frontend_ct_editor_visual"
}
} }
dir('services/web') {
sh "make test_frontend_ct_editor_visual"
}
}
} }
stage('test_frontend_ct_editor_other') { stage('test_frontend_ct_editor_other') {
steps { steps {
script { script {
waitUntil { waitUntil {
return action_test_frontend_ct_build return action_test_frontend_ct_build
} }
}
dir('services/web') {
sh "make test_frontend_ct_editor_other"
}
} }
dir('services/web') {
sh "make test_frontend_ct_editor_other"
}
}
} }
stage('Test Unit ESM') { stage('Test Unit ESM') {
steps { steps {
script { script {
waitUntil { waitUntil {
return action_build_dev return action_build_dev
} }
}
dir('services/web') {
sh "make test_unit_esm"
}
} }
dir('services/web') {
sh "make test_unit_esm"
}
}
} }
stage('Test Unit Mocha') { stage('Test Unit Mocha') {
steps { steps {
script { script {
waitUntil { waitUntil {
return action_build_dev return action_build_dev
} }
}
dir('services/web') {
sh "make test_unit_mocha"
}
} }
dir('services/web') {
sh "make test_unit_mocha"
}
}
} }
stage('Build Webpack'){ stage('Build Webpack') {
steps { steps {
script { script {
waitUntil { waitUntil {
@@ -440,7 +437,7 @@ pipeline {
} }
} }
} }
stage('Build Production'){ stage('Build Production') {
steps { steps {
script { script {
waitUntil { waitUntil {
@@ -496,4 +493,4 @@ pipeline {
} }
} }
// vim: set ft=groovy : // vim: set ft=groovy :

View File

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

View File

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