[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-19 08:07:49 +00:00
committed by Copybot
parent 66934586b1
commit a6e9a5c7e9
24 changed files with 310 additions and 276 deletions
+2 -2
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"
},
+2 -2
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"
},
+92 -98
View File
@@ -1,110 +1,104 @@
pipeline {
agent {
node {
label 'jenkins-agent-web'
customWorkspace '/workspace'
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'
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'
}
}
}
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') {
parallel {
stage ('Push Branch Image') {
steps {
dir ('services/contacts') {
sh 'docker push ${AR_URL}/${IMAGE_NAME}:${BRANCH_NAME}'
}
}
}
stage ('Tests') {
parallel {
stage ('Push Branch Image') {
steps {
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 ('Shellcheck') {
steps {
dir ('services/contacts') {
sh 'make shellcheck'
}
}
}
stage('Push Production') {
steps {
dir('services/contacts') {
sh 'docker push ${AR_URL}/${IMAGE_NAME}:${BRANCH_NAME}-${BUILD_NUMBER}'
}
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'
}
}
}
}
}
post {
cleanup {
dir('services/contacts') {
sh 'make clean'
}
sh 'make clean_jenkins'
stage('Push Production') {
steps {
dir('services/contacts') {
sh 'docker push ${AR_URL}/${IMAGE_NAME}:${BRANCH_NAME}-${BUILD_NUMBER}'
}
}
}
}
}
post {
cleanup {
dir('services/contacts') {
sh 'make clean'
}
sh 'make clean_jenkins'
}
}
}
+2 -2
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"
},
+2 -2
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"
},
+2 -2
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"
},
+2 -2
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 .",
+2 -2
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",
+2 -2
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"
},
+2 -2
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"
},
+2 -2
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"
},
+1 -1
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",
+86 -89
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,23 +29,21 @@ pipeline {
retry(3)
timeout(time: 15, unit: 'MINUTES')
}
environment {
IMAGE_NAME = 'web'
PROJECT_NAME = 'web'
IMAGE_REPO = 'us-east1-docker.pkg.dev/overleaf-ops/ol-docker/web'
AR_REPO_LOCATION = 'us-east1'
AR_URL = 'us-east1-docker.pkg.dev/overleaf-ops/ol-docker'
DOCKER_COMPOSE_FLAGS = '-f docker-compose.ci.yml'
BRANCH_NAME = "${env.CHANGE_BRANCH ? env.CHANGE_BRANCH : env.BRANCH_NAME}"
JENKINS_BUILD_NUMBER = "${BUILD_NUMBER}" // preserve original BUILD_NUMBER
BUILD_NUMBER = "${SHORT_SHA}_${BUILD_NUMBER}" // mimic the format used for Cloud Build
COMMIT_SHA = "${GIT_COMMIT}"
SHORT_SHA = "${GIT_COMMIT.take(7)}"
CDN_STAG = "gs://ol-stag-web-assets-1"
CDN_PROD = "gs://mgcp-1117973-ol-prod-web-assets-1"
IMAGE_NAME = 'web'
PROJECT_NAME = 'web'
IMAGE_REPO = 'us-east1-docker.pkg.dev/overleaf-ops/ol-docker/web'
AR_REPO_LOCATION = 'us-east1'
AR_URL = 'us-east1-docker.pkg.dev/overleaf-ops/ol-docker'
DOCKER_COMPOSE_FLAGS = '-f docker-compose.ci.yml'
BRANCH_NAME = "${env.CHANGE_BRANCH ? env.CHANGE_BRANCH : env.BRANCH_NAME}"
JENKINS_BUILD_NUMBER = "${BUILD_NUMBER}" // preserve original BUILD_NUMBER
BUILD_NUMBER = "${SHORT_SHA}_${BUILD_NUMBER}" // mimic the format used for Cloud Build
COMMIT_SHA = "${GIT_COMMIT}"
SHORT_SHA = "${GIT_COMMIT.take(7)}"
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') {
@@ -305,99 +302,99 @@ pipeline {
}
}
stage('test_frontend_ct_core_other') {
environment {
CYPRESS_INTERNAL_BROWSER_CONNECT_TIMEOUT = '120000'
environment {
CYPRESS_INTERNAL_BROWSER_CONNECT_TIMEOUT = '120000'
}
steps {
script {
waitUntil {
return action_test_frontend_ct_build
}
}
steps {
script {
waitUntil {
return action_test_frontend_ct_build
}
}
dir('services/web') {
sh "make test_frontend_ct_core_other"
}
dir('services/web') {
sh "make test_frontend_ct_core_other"
}
}
}
stage('test_frontend_ct_core_features') {
environment {
CYPRESS_INTERNAL_BROWSER_CONNECT_TIMEOUT = '120000'
environment {
CYPRESS_INTERNAL_BROWSER_CONNECT_TIMEOUT = '120000'
}
steps {
script {
waitUntil {
return action_test_frontend_ct_build
}
}
steps {
script {
waitUntil {
return action_test_frontend_ct_build
}
}
dir('services/web') {
sh "make test_frontend_ct_core_features"
}
dir('services/web') {
sh "make test_frontend_ct_core_features"
}
}
}
stage('test_frontend_ct_modules') {
environment {
CYPRESS_INTERNAL_BROWSER_CONNECT_TIMEOUT = '120000'
environment {
CYPRESS_INTERNAL_BROWSER_CONNECT_TIMEOUT = '120000'
}
steps {
script {
waitUntil {
return action_test_frontend_ct_build
}
}
steps {
script {
waitUntil {
return action_test_frontend_ct_build
}
}
dir('services/web') {
sh "make test_frontend_ct_modules"
}
dir('services/web') {
sh "make test_frontend_ct_modules"
}
}
}
stage('test_frontend_ct_editor_visual') {
steps {
script {
waitUntil {
return action_test_frontend_ct_build
}
}
dir('services/web') {
sh "make test_frontend_ct_editor_visual"
}
steps {
script {
waitUntil {
return action_test_frontend_ct_build
}
}
dir('services/web') {
sh "make test_frontend_ct_editor_visual"
}
}
}
stage('test_frontend_ct_editor_other') {
steps {
script {
waitUntil {
return action_test_frontend_ct_build
}
}
dir('services/web') {
sh "make test_frontend_ct_editor_other"
}
steps {
script {
waitUntil {
return action_test_frontend_ct_build
}
}
dir('services/web') {
sh "make test_frontend_ct_editor_other"
}
}
}
stage('Test Unit ESM') {
steps {
script {
waitUntil {
return action_build_dev
}
}
dir('services/web') {
sh "make test_unit_esm"
}
steps {
script {
waitUntil {
return action_build_dev
}
}
dir('services/web') {
sh "make test_unit_esm"
}
}
}
stage('Test Unit Mocha') {
steps {
script {
waitUntil {
return action_build_dev
}
}
dir('services/web') {
sh "make test_unit_mocha"
}
steps {
script {
waitUntil {
return action_build_dev
}
}
dir('services/web') {
sh "make test_unit_mocha"
}
}
}
stage('Build Webpack'){
stage('Build Webpack') {
steps {
script {
waitUntil {
@@ -440,7 +437,7 @@ pipeline {
}
}
}
stage('Build Production'){
stage('Build Production') {
steps {
script {
waitUntil {
@@ -496,4 +493,4 @@ pipeline {
}
}
// vim: set ft=groovy :
// vim: set ft=groovy :
+7
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
+2
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'",