mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 06:03:45 +01:00
Merge pull request #30018 from overleaf/msm-fix-esm-import
[web] Fix ESM import GitOrigin-RevId: 887f4927248241cb3d237e0bdad36b05928657ef
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
# Autogenerated by build scripts. Do not edit.
|
||||
.eslint*
|
||||
.prettier*
|
||||
libraries/access-token-encryptor/**
|
||||
libraries/eslint-plugin/**
|
||||
libraries/fetch-utils/**
|
||||
libraries/logger/**
|
||||
libraries/metrics/**
|
||||
libraries/mongo-utils/**
|
||||
libraries/o-error/**
|
||||
libraries/object-persistor/**
|
||||
libraries/overleaf-editor-core/**
|
||||
libraries/promise-utils/**
|
||||
libraries/ranges-tracker/**
|
||||
libraries/redis-wrapper/**
|
||||
libraries/settings/**
|
||||
libraries/stream-utils/**
|
||||
libraries/validation-tools/**
|
||||
package-lock.json
|
||||
package.json
|
||||
patches/**
|
||||
services/web/**
|
||||
tools/migrations/**
|
||||
@@ -1,50 +0,0 @@
|
||||
services/web/Makefile
|
||||
services/web/.storybook/**
|
||||
services/web/config/settings.webpack.js
|
||||
services/web/frontend/**
|
||||
services/web/locales/en.json
|
||||
services/web/public/**
|
||||
|
||||
# echo services/web/modules/*/frontend | xargs -n1 | grep -v writefull | xargs -I% echo '%/**' | sort
|
||||
# BEGIN GENERATED
|
||||
services/web/modules/admin-panel/frontend/**
|
||||
services/web/modules/ai/frontend/**
|
||||
services/web/modules/algolia-search/frontend/**
|
||||
services/web/modules/cms/frontend/**
|
||||
services/web/modules/dropbox/frontend/**
|
||||
services/web/modules/full-project-search/frontend/**
|
||||
services/web/modules/git-bridge/frontend/**
|
||||
services/web/modules/github-sync/frontend/**
|
||||
services/web/modules/group-audit-log/frontend/**
|
||||
services/web/modules/group-settings/frontend/**
|
||||
services/web/modules/institutions/frontend/**
|
||||
services/web/modules/labs/frontend/**
|
||||
services/web/modules/launchpad/frontend/**
|
||||
services/web/modules/learn/frontend/**
|
||||
services/web/modules/metrics/frontend/**
|
||||
services/web/modules/oauth2-server/frontend/**
|
||||
services/web/modules/offline-mode/frontend/**
|
||||
services/web/modules/onboarding/frontend/**
|
||||
services/web/modules/open-in-overleaf/frontend/**
|
||||
services/web/modules/portals/frontend/**
|
||||
services/web/modules/publish-modal/frontend/**
|
||||
services/web/modules/references-search/frontend/**
|
||||
services/web/modules/split-test/frontend/**
|
||||
services/web/modules/subscriptions/frontend/**
|
||||
services/web/modules/support/frontend/**
|
||||
services/web/modules/survey/frontend/**
|
||||
services/web/modules/symbol-palette/frontend/**
|
||||
services/web/modules/templates/frontend/**
|
||||
services/web/modules/tpr-webmodule/frontend/**
|
||||
services/web/modules/two-factor-authentication/frontend/**
|
||||
services/web/modules/user-activate/frontend/**
|
||||
services/web/modules/v1-projects/frontend/**
|
||||
services/web/modules/v2-templates/frontend/**
|
||||
# END GENERATED
|
||||
|
||||
# Do not include the Writefull integration.
|
||||
services/web/modules/writefull/frontend/components/**
|
||||
services/web/modules/writefull/frontend/shared/**
|
||||
|
||||
package.json
|
||||
package-lock.json
|
||||
Vendored
-65
@@ -1,65 +0,0 @@
|
||||
pipeline {
|
||||
agent {
|
||||
node {
|
||||
// Select a VM with the given tabel.
|
||||
label 'jenkins-agent-web'
|
||||
// Use the monorepo checkout in /workspace.
|
||||
customWorkspace '/workspace'
|
||||
}
|
||||
}
|
||||
options {
|
||||
// Print timestamp next to each log line.
|
||||
timestamps()
|
||||
timeout(time: 15, unit: 'MINUTES')
|
||||
}
|
||||
environment {
|
||||
BRANCH_NAME = "${env.CHANGE_BRANCH ? env.CHANGE_BRANCH : env.BRANCH_NAME}"
|
||||
BUCKET = "gs://overleaf-dev-storybook"
|
||||
}
|
||||
stages {
|
||||
stage('Install') {
|
||||
steps {
|
||||
retry(count: 3) {
|
||||
sh 'make monorepo_setup'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Build') {
|
||||
steps {
|
||||
sh 'bin/run -e BRANCH_NAME -w /overleaf/services/web monorepo make build_storybook'
|
||||
}
|
||||
}
|
||||
stage('Copy stories') {
|
||||
steps {
|
||||
sh 'gsutil -m copy -r services/web/data/storybook/* "${BUCKET}/"'
|
||||
}
|
||||
}
|
||||
stage('Generate index') {
|
||||
steps {
|
||||
dir('services/web') {
|
||||
sh 'make storybook_index'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Copy index') {
|
||||
steps {
|
||||
sh 'gsutil copy services/web/data/storybook/index.html "${BUCKET}/index.html"'
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
failure {
|
||||
script {
|
||||
if (env.BRANCH_NAME == 'main') {
|
||||
node('built-in') {
|
||||
sh '/usr/local/bin/open-gh-failure-issue --project="🚉 Platform"'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
cleanup {
|
||||
sh 'rm -rf services/web/data/storybook/'
|
||||
sh 'make clean_jenkins -j10'
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
-396
@@ -1,396 +0,0 @@
|
||||
pipeline {
|
||||
agent {
|
||||
node {
|
||||
// Select a VM with the given tabel.
|
||||
label 'jenkins-agent-web'
|
||||
// Use the monorepo checkout in /workspace.
|
||||
customWorkspace '/workspace'
|
||||
}
|
||||
}
|
||||
options {
|
||||
// Print timestamp next to each log line.
|
||||
timestamps()
|
||||
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
|
||||
CDN_STAG = "gs://ol-stag-web-assets-1"
|
||||
CDN_PROD = "gs://mgcp-1117973-ol-prod-web-assets-1"
|
||||
}
|
||||
stages {
|
||||
stage('Set Build Variables') {
|
||||
steps {
|
||||
script {
|
||||
def relevantCommitHash
|
||||
if (env.CHANGE_BRANCH) {
|
||||
def commitExistsOnRemote = sh(script: "git branch --remotes --contains ${GIT_COMMIT}", returnStdout: true).trim()
|
||||
if (commitExistsOnRemote) {
|
||||
echo "PR build detected, but commit exists on remote. Using ${GIT_COMMIT}"
|
||||
relevantCommitHash = "${GIT_COMMIT}"
|
||||
} else {
|
||||
def parentCommits = sh(script: 'git rev-parse HEAD^@', returnStdout: true).trim().split('\n')
|
||||
if (parentCommits.size() >= 2) {
|
||||
echo "PR build detected. Jenkins checked out a merge commit: ${GIT_COMMIT} (parents: ${parentCommits.join(', ')})"
|
||||
relevantCommitHash = parentCommits[0]
|
||||
echo "Using first parent (branch commit): ${relevantCommitHash}"
|
||||
} else {
|
||||
echo "WARN: PR build detected, but ${GIT_COMMIT} is neither a merge commit, nor does it exist on the remote."
|
||||
relevantCommitHash = "${GIT_COMMIT}"
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo "Branch build detected. Using commit: ${GIT_COMMIT}"
|
||||
relevantCommitHash = "${GIT_COMMIT}"
|
||||
}
|
||||
env.COMMIT_SHA = relevantCommitHash
|
||||
env.SHORT_SHA = relevantCommitHash.take(7)
|
||||
env.BUILD_NUMBER = "${env.SHORT_SHA}_${env.JENKINS_BUILD_NUMBER}"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Stage 1') {
|
||||
parallel {
|
||||
stage('Prefetch Tests Images') {
|
||||
steps {
|
||||
dir('services/web') {
|
||||
sh 'docker compose -f docker-compose.ci.yml pull --quiet test_frontend_ct mongo redis_test ldap saml'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Build') {
|
||||
steps {
|
||||
dir('services/web') {
|
||||
sh 'bin/copy_external_pages'
|
||||
retry(count: 3) {
|
||||
sh 'make build_deps'
|
||||
}
|
||||
retry(count: 3) {
|
||||
sh 'make build_dev'
|
||||
}
|
||||
sh 'make build_test_frontend_ct'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Stage 2') {
|
||||
parallel {
|
||||
stage('Push Deps') {
|
||||
steps {
|
||||
dir('services/web') {
|
||||
sh 'make push_branch'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Format') {
|
||||
steps {
|
||||
dir('services/web') {
|
||||
sh 'make format_in_docker'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Lint') {
|
||||
steps {
|
||||
dir('services/web') {
|
||||
sh 'make lint_in_docker'
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
recordIssues checksAnnotationScope: 'ALL', enabledForFailure: true, failOnError: true, id: 'web-eslint', name: 'Web eslint', qualityGates: [[integerThreshold: 1, threshold: 1.0, type: 'TOTAL']], sourceCodeRetention: 'LAST_BUILD', tools: [esLint(pattern: 'services/web/data/reports/eslint.json')]
|
||||
recordIssues checksAnnotationScope: 'ALL', enabledForFailure: true, failOnError: true, id: 'web-stylelint', name: 'Web stylelint', qualityGates: [[integerThreshold: 1, threshold: 1.0, type: 'TOTAL']], sourceCodeRetention: 'LAST_BUILD', tools: [styleLint(pattern: 'services/web/data/reports/stylelint.json')]
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Shellcheck') {
|
||||
steps {
|
||||
dir('services/web') {
|
||||
sh 'make shellcheck'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Acceptance SaaS') {
|
||||
steps {
|
||||
dir('services/web') {
|
||||
retry(count: 3) {
|
||||
sh 'make test_acceptance_app_saas'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Acceptance Server CE') {
|
||||
steps {
|
||||
dir('services/web') {
|
||||
retry(count: 3) {
|
||||
sh "make test_acceptance_app_server_ce"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Acceptance Server Pro') {
|
||||
steps {
|
||||
dir('services/web') {
|
||||
retry(count: 3) {
|
||||
sh "make test_acceptance_app_server_pro"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('test_acceptance_modules_merged_saas_1') {
|
||||
steps {
|
||||
dir('services/web') {
|
||||
retry(count: 3) {
|
||||
sh "make test_acceptance_modules_merged_saas_1"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('test_acceptance_modules_merged_saas_2') {
|
||||
steps {
|
||||
dir('services/web') {
|
||||
retry(count: 3) {
|
||||
sh "make test_acceptance_modules_merged_saas_2"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('test_acceptance_modules_merged_saas_3') {
|
||||
steps {
|
||||
dir('services/web') {
|
||||
retry(count: 3) {
|
||||
sh "make test_acceptance_modules_merged_saas_3"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('test_acceptance_modules_merged_saas_4') {
|
||||
steps {
|
||||
dir('services/web') {
|
||||
retry(count: 3) {
|
||||
sh "make test_acceptance_modules_merged_saas_4"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('test_acceptance_modules_merged_server_ce') {
|
||||
steps {
|
||||
dir('services/web') {
|
||||
retry(count: 3) {
|
||||
sh "make test_acceptance_modules_merged_server_ce"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('test_acceptance_modules_merged_server_pro') {
|
||||
steps {
|
||||
dir('services/web') {
|
||||
retry(count: 3) {
|
||||
sh "make test_acceptance_modules_merged_server_pro"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('test_frontend') {
|
||||
steps {
|
||||
dir('services/web') {
|
||||
retry(count: 3) {
|
||||
sh "make test_frontend"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('test_writefull') {
|
||||
steps {
|
||||
dir('services/web') {
|
||||
retry(count: 3) {
|
||||
sh "make test_writefull"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('test_frontend_ct_core_other') {
|
||||
environment {
|
||||
CYPRESS_INTERNAL_BROWSER_CONNECT_TIMEOUT = '120000'
|
||||
}
|
||||
steps {
|
||||
dir('services/web') {
|
||||
retry(count: 3) {
|
||||
sh "make test_frontend_ct_core_other"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('test_frontend_ct_core_features') {
|
||||
environment {
|
||||
CYPRESS_INTERNAL_BROWSER_CONNECT_TIMEOUT = '120000'
|
||||
}
|
||||
steps {
|
||||
dir('services/web') {
|
||||
retry(count: 3) {
|
||||
sh "make test_frontend_ct_core_features"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('test_frontend_ct_modules') {
|
||||
environment {
|
||||
CYPRESS_INTERNAL_BROWSER_CONNECT_TIMEOUT = '120000'
|
||||
}
|
||||
steps {
|
||||
dir('services/web') {
|
||||
retry(count: 3) {
|
||||
sh "make test_frontend_ct_modules"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('test_frontend_ct_editor_visual') {
|
||||
steps {
|
||||
dir('services/web') {
|
||||
retry(count: 3) {
|
||||
sh "make test_frontend_ct_editor_visual"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('test_frontend_ct_editor_other') {
|
||||
steps {
|
||||
dir('services/web') {
|
||||
retry(count: 3) {
|
||||
sh "make test_frontend_ct_editor_other"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Test Unit ESM - Parallel') {
|
||||
steps {
|
||||
dir('services/web') {
|
||||
retry(count: 3) {
|
||||
sh "make test_unit_esm_parallel"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Test Unit ESM - Sequential') {
|
||||
steps {
|
||||
dir('services/web') {
|
||||
retry(count: 3) {
|
||||
sh "make test_unit_esm_sequential"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Test Unit Mocha') {
|
||||
steps {
|
||||
dir('services/web') {
|
||||
retry(count: 3) {
|
||||
sh "make test_unit_mocha"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Build webpack + production + cdn upload + sentry upload') {
|
||||
stages {
|
||||
stage('Wait a bit to give tests all the CPU capacity') {
|
||||
steps {
|
||||
sh 'sleep 60'
|
||||
}
|
||||
}
|
||||
stage('Build Webpack') {
|
||||
steps {
|
||||
dir('services/web') {
|
||||
sh 'make build_webpack'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Build Pug') {
|
||||
steps {
|
||||
dir('services/web') {
|
||||
sh 'make build_pug'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('CDN Upload Image') {
|
||||
steps {
|
||||
dir('services/web') {
|
||||
sh 'make tar'
|
||||
retry(count: 3) {
|
||||
sh 'bin/cdn_upload'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Build Production') {
|
||||
steps {
|
||||
dir('services/web') {
|
||||
sh 'make build'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Sentry Upload') {
|
||||
steps {
|
||||
dir('services/web') {
|
||||
sh 'gcloud secrets versions access latest --secret=web-sentryclirc > .sentryclirc'
|
||||
retry(count: 3) {
|
||||
sh 'make sentry_upload'
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
cleanup {
|
||||
dir('services/web') {
|
||||
sh 'rm -f .sentryclirc'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Push Production image early') {
|
||||
steps {
|
||||
dir('services/web') {
|
||||
sh 'make push_scratch'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Push Production') {
|
||||
steps {
|
||||
dir('services/web') {
|
||||
sh 'make publish'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
junit checksName: 'Web test results', testResults: 'services/web/data/reports/junit-*.xml,services/web/data/reports/junit-*/**/*.xml'
|
||||
}
|
||||
failure {
|
||||
script {
|
||||
if (env.BRANCH_NAME == 'main') {
|
||||
node('built-in') {
|
||||
sh '/usr/local/bin/open-gh-failure-issue --project="🚉 Platform"'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Ensure tear down of test containers, then run general Jenkins VM cleanup.
|
||||
cleanup {
|
||||
dir('services/web') {
|
||||
sh 'make clean -j10'
|
||||
}
|
||||
sh 'make clean_jenkins -j10'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// vim: set ft=groovy :
|
||||
Reference in New Issue
Block a user