Commit Graph

45 Commits

Author SHA1 Message Date
Anna Claire Fields
0d64a88a46 Yarn 4 Migration (#32253)
Migrates the Overleaf monorepo package manager from npm (v11) to Yarn 4 (v4.9.1) using node-modules linker mode.

GitOrigin-RevId: 50d32ab01955c15e29679eff9e9e9cfb897fab2d
2026-04-28 08:52:37 +00:00
Jakob Ackermann
dbf6401f22 [monorepo] move retries from the outside to the per-test level (#31528)
* [monorepo] move retries from the outside to the per-test level

* [web] increase hookTimeout in CI

* [monorepo] consolidate test retries

- do not retry unit tests
- only retry in ci, optionally locally with "RETRIES=3 make test..."
- add retries for web

Co-authored-by: Eric Mc Sween <eric.mcsween@overleaf.com>

---------

Co-authored-by: Eric Mc Sween <eric.mcsween@overleaf.com>
GitOrigin-RevId: 86e45edcfb087d18e0e957ad6df9a6105dcd5770
2026-02-16 09:06:48 +00:00
Jakob Ackermann
fd647002f5 [monorepo] enable caching for eslint and prettier (#30967)
* [monorepo] enable caching for eslint/prettier/stylelint

* [monorepo] speed up prettier by swapping --list-different for --check

--list-different will print each file that it processes. We have a lot
of files in the monorepo. Using --check only prints mismatching files.

Co-authored-by: Rebeka <rebeka.dekany@overleaf.com>

* [monorepo] explicitly configure prettier cache-location

This is the default location. Prettier will only discover that location
if the top level node_modules folder is writable, which is not the case
in CI. We create the .cache folder outside of docker, writable to node
inside docker.

The proper fix would be in prettier, to only check for write access in
the cache folder. Something to raise/upstream another day.

* [monorepo] run top-level format/format_fix in a single container

With the cache in place, it is much faster to use a single container.
As there is a single shared cache file, concurrent processes may see a
partially (re-)written cache file and bail out.

- all in a single container: 24s
- previous with -j4: 41s
- previous with -j8: failed due to corrupted cache file

---------

Co-authored-by: Rebeka <rebeka.dekany@overleaf.com>
GitOrigin-RevId: 7850a3a980ae6c836393d97fe56a6316ffc3fa18
2026-02-06 09:05:44 +00:00
Rebeka Dekany
a648015db8 Centralize prettier configuration to root level (#30501)
* Merge all .prettierignore files into top-level config

* Merge all .prettierrc files into top-level config

* Replace service-specific glob patterns in package.json format scripts with `prettier .`

* Add template files with Jinja2, Go template, envsubst, and Handlebars syntax to .prettierignore

* Ignore GitHub templates

* Ignore PUG templates to format them separately with `format:pug`

* Encourage double quotes for YAML, YML files

* Move prettier for PUG source format script to the root

* Move prettier for styles source format script to the root

* Remove prettier for jenkins files from web

* Remove prettier source format script from all services

* Make .prettierrc more readable

* Update format scripts by file type

* Organise `.prettierignore`

* Add `--cache` flag to prettier scripts for faster runs

* Format all files with prettier

* Format all or format services

* Remove `format`/`format:fix` scripts from services since now it runs from root `package.json`

* Avoid conlficts with yamllint configuration

* Remove `--cache` flag from prettier scripts

* Update all service Makefiles to use root-level prettier configuration

* Update all Jenkinsfile to use root-level prettier configuration

* Ignore auto-generated files by build_scripts

* Update package-lock.json

* Update root Makefile format targets

* Update SP Jenkinsfile format target

* Update E2E Makefile format script

* Udpate `format_js` to work in both local and CI env

* Add docker-mailtrap to .prettierignore

docker-mailtrap is a third-party git-ignored directory used for testing

* Added Docker env detection to prevent nested Docker spawning

* Ignore handlebars templates

* Add cryptographic files and test output to `.prettierignore`

* Add terraform modules to `.gitignore`

* Remove prettier-plugin-groovy

* Use npx directly instead of Docker for local formatting for faster formatting

* Auto-generate Makefiles

* Revert "Remove prettier-plugin-groovy"

This reverts commit 194a33589a2e1e4d2225d10c67e9f025e4222025.

* Mount monorepo root in RUN_LINT_FORMAT for prettier config access

* Prettier ignores all `node_modules` by default regardless of location

* Show only changed files in format output

* Ignore LICENSE files

* Enable prettier on rendered build_scripts outputs

* Ignoring all the template folders by prettier

* Remove the public/minjs entry since it does not exist

* Remove all non-existent paths

* Sync `.prettierignore` with ignored files by `.gitignore` and `.dockerignore` files

* Revert "Auto-generate Makefiles"

This reverts commit c0233e490de1bc95fe437219d65e0b66e0331ec9.

* Revert "Use npx directly instead of Docker for local formatting for faster formatting"

This reverts commit 1d2b2cf1a6c6974c76885852a90dd55e84167e41.

* Ignore dashboard JSON files

* Ignore files generated by bin/update_build_scripts

* Remove unsupported file types from `.prettierignore`

* Ignore test fixture generated files

* Ignore README file types by prettier

* Ignore generate snapshots by prettier

* Allow to format generated bin/update_build_scripts by prettier

* Ensure build script outputs prettier-compatible tsconfig.json

* Fix build script output to match prettier formatting
- Fix Jinja2 whitespace in docker-compose templates
- Change YAML quotes from single to double

* Don't read cryptographic files by prettier

* Ignore google verification files by prettier

* Revert npx prettier formatting

* Ignore domain verification files

* Show only changed files in format output

* Make `.github` prettier

* Allow all files to be formatted in jobs by prettier

* Allow server-ce/server-pro files to be formatted by prettier

* Ignore more folders in clsi, filestory, git-bridge by prettier

* Update build script with `RUN_LINTING_CI_MONOREPO`

* Ignore docker-mailtrap and downloads in server-ce by prettier

* Restore prettier configs and prettierignore for V1 since it has its own prettier (an older version)

* Source format

GitOrigin-RevId: 637adc3cc422d1f20c86d6ebc8ec514d60758287
2026-02-04 09:08:22 +00:00
Andrew Rumble
4271744bfd Merge pull request #30606 from overleaf/ar/bump-qs-to-6.14.1
[monorepo] bump qs to 6.14.1

GitOrigin-RevId: 4b1f8b1cf739c3c0195392fa6707fc233d036b70
2026-01-15 14:20:06 +00:00
Anna Claire Fields
06a0cf2391 Merge pull request #30339 from overleaf/acf-migration5-cleanup
(5) Remove swagger dependencies from history-v1

GitOrigin-RevId: d3d79dd9d3c8ccb59d6a59aeede7186daf18bdb0
2025-12-18 09:05:37 +00:00
Andrew Rumble
f3c9b2f2f0 Merge pull request #30182 from overleaf/ar/update-jws-to-3.2.3_or_4.0.1
[monorepo] update jws to 4.0.1

GitOrigin-RevId: b3e778b26b2860112fe80220d6e7354520994082
2025-12-10 09:05:25 +00:00
Anna Claire Fields
c25e49782f Merge pull request #29965 from overleaf/acf-migration1-validation
Add Zod validation (replaces swagger-validator + swagger-metadata)

GitOrigin-RevId: 2e4ed742e401bdfe49c6f7dc9d0fceeba20cfc7f
2025-12-03 09:06:15 +00:00
Brian Gough
729e0f5ac9 move migrations to shared location (#28306)
* fix: correct typedef for Document in helpers.mjs

* add move-migrations codemod

* update migration paths to use shared migrations directory

* move migrations to shared location

* fix: update Dockerfile and docker-compose.ci.yml to include migrations directory

* feat: add migrations tool to workspaces in package.json

* [monorepo] Fix order of docker ignore rules

* [web] remove unused docker ignore file

* [monorepo] replace old references to migrations folder

* [server-ce] copy migrations from new place

* [migrations] Inline web scripts

Co-authored-by: Brian Gough <brian.gough@overleaf.com>

* [migrations] move three web scripts over

Co-authored-by: Brian Gough <brian.gough@overleaf.com>

* [migrations] add missing collection

Co-authored-by: Brian Gough <brian.gough@overleaf.com>

* [migrations] remove lodash dependency

Co-authored-by: Brian Gough <brian.gough@overleaf.com>

* [migrations] avoid mongodb-legacy dependency

Co-authored-by: Brian Gough <brian.gough@overleaf.com>

* [monorepo] run migrations from tools/migrations

Co-authored-by: Brian Gough <brian.gough@overleaf.com>

* [migrations] simplify migration for adding gitBridge feature to users

* [monorepo] run migrations from tests in all the services

* [migrations] add Jenkins pipeline for linting/formatting

* [monorepo] fixup running web migrations everywhere

* [monorepo] trigger Jenkins builds on changes to mongo migrations

* [migrations] add Jenkins pipeline for linting/formatting

* [monorepo] build scripts: update devDependencies before deps scanning

* [monorepo] build scripts: formerly depend on tools/migrations

* [monorepo] run eslint on .mjs files

* [migrations] enable more eslint rules and fix all the errors

* [rake] fix migrations:list task

---------

Co-authored-by: Jakob Ackermann <jakob.ackermann@overleaf.com>
GitOrigin-RevId: 14cf69cc1b9405bbc75adbb9a000e555500e0614
2025-10-16 08:07:37 +00:00
Jakob Ackermann
fd0d21fbbd [monorepo] migrate build scripts to Jenkins (#29019)
* [monorepo] migrate build scripts to Jenkins

* [fraud-dash] fix integration with monorepo

GitOrigin-RevId: 6a30ec5ea68a1eae9b663faf9ccdc741ec7f9cf8
2025-10-13 08:07:11 +00:00
Jakob Ackermann
5fe9d3d6e9 [monorepo] migrate monorepo checks to Jenkins (#28765)
GitOrigin-RevId: ebc3db95cebe99226f8de0f66c1830eb5d78e26c
2025-10-01 08:06:28 +00:00
Andrew Rumble
0200ad7515 [monorepo] format ts files (#28678)
* Add ts files to format package script

* Apply changes to service package.json files

* [monorepo] only support plain .ts files in all the services

---------

Co-authored-by: Jakob Ackermann <jakob.ackermann@overleaf.com>
GitOrigin-RevId: 882cf274da86a0dbe1fff395441f6f2458c1405c
2025-09-25 08:05:30 +00:00
Jakob Ackermann
a6e9a5c7e9 [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
2025-09-19 08:07:49 +00:00
Eric Mc Sween
8f0913fafe Merge pull request #27936 from overleaf/em-unit-tests-mongo
Make Mongo available to unit tests in all services

GitOrigin-RevId: b65bbb69883d5bba31d09802b89f35bdc523fe4d
2025-08-25 08:05:19 +00:00
Eric Mc Sween
9cb4ef4d7d Merge pull request #26353 from overleaf/bg-history-redis-extend-persist-worker
extend persist worker to make parallel requests

GitOrigin-RevId: 8def7d5a8b5c9fcbe5fe45ac8f3ace503d31877a
2025-06-17 08:05:55 +00:00
Antoine Clausse
eddeca2942 [history-v1] Update config from 1.31.0 to 3.3.12 (#25077)
This removes some DeprecationWarnings in history-v1

The update should be safe:
```
  3.0.0 / 2018-11-20
  Ensure config array items and objects are sealed @fgheorghe
  This required a major version bump in case someone
  relied on the ability to mutate non-sealed data.

  2.0.0 / 2018-07-26
  Potential for backward incompatibility requiring a major version bump.

  Safe to upgrade to major version 2 if you're using a recent NodeJS version and you're not trying to mutate config arrays.

  Added array immutability - jacobemerick
  Removed Node V.4 support
```

https://github.com/node-config/node-config/blob/master/History.md

GitOrigin-RevId: 8384247d1ad2cd659703b4ba50edf7212076dcf3
2025-05-07 08:07:56 +00:00
Andrew Rumble
767591973c Merge pull request #23905 from overleaf/ar-mocha-11
[all] Bump mocha everywhere

GitOrigin-RevId: bf5587047f9ceb88872cbd356c2029717bb8ca9d
2025-02-28 09:05:40 +00:00
Brian Gough
763e5ba82c Merge pull request #23920 from overleaf/bg-backup-queue
initial history backup queue worker app

GitOrigin-RevId: e9647a2ec3caeb1fff843cead12164ba89fdb1f8
2025-02-28 09:04:46 +00:00
Miguel Serrano
2e72aa8a47 Merge pull request #23652 from overleaf/msm-update-path-to-regexp
[monorepo] Update express to 4.1.2

GitOrigin-RevId: b3db75257e1edc1a25a1a657def352ecca926920
2025-02-21 09:05:26 +00:00
Brian Gough
d2738fda73 Merge pull request #23565 from overleaf/bg-fix-history-metadata-in-projects-collection
fix history metadata in projects collection

GitOrigin-RevId: 18c821ef5966a8470b24dfa60313b09bdda9707d
2025-02-14 09:03:33 +00:00
Brian Gough
25d9ef33c5 Merge pull request #23420 from overleaf/bg-add-plimit-to-history
add plimit to history-v1

GitOrigin-RevId: bae1b12b2031100144afc797094dba95524a8a3e
2025-02-06 09:04:48 +00:00
Andrew Rumble
47db5c1236 Merge pull request #23039 from overleaf/ar-bump-mongo-6.12
[many] Bump mongodb to 6.12.0 universally

GitOrigin-RevId: 6df934518e95217b6157ca5a41cf8acf4beb7689
2025-01-23 09:06:13 +00:00
Rebeka Dekany
7493936bad Merge pull request #22310 from overleaf/ar-bump-mongoose-8.8.3
[web] Upgrade mongoose to 8.8.3

GitOrigin-RevId: 5540f7384b74daafa01522c23633587fc56a7faa
2024-12-06 09:05:25 +00:00
Jakob Ackermann
73aea01f37 Merge pull request #21996 from overleaf/jpa-stream-pg-result
[history-v1] postgres: getProjectBlobsBatch: stream records

GitOrigin-RevId: 94ed6dfc4a263fd9369cd380e6cc25c7bbf6decc
2024-11-21 09:04:38 +00:00
Jakob Ackermann
97b39ef98f Merge pull request #21681 from overleaf/jpa-back-fill-file-hash
[history-v1] add script for back filling hash into project file-tree

GitOrigin-RevId: 70ab8c72f3eea1062708e4471b4ad1c60317ad26
2024-11-18 09:05:39 +00:00
Jakob Ackermann
805c4f8321 Merge pull request #21764 from overleaf/jpa-esm-build-scripts
[misc] prepare linting for ESM files in services

GitOrigin-RevId: 468983ebff40617158bac28514381a6aaf725893
2024-11-12 09:05:50 +00:00
Jakob Ackermann
5bb90dc6cb Merge pull request #21442 from overleaf/jpa-align-mongo-version
[misc] align all the mongodb dependency versions

GitOrigin-RevId: 1194fe57601af98bb61250a285bfc85b4b8179dd
2024-11-01 09:05:23 +00:00
Antoine Clausse
6c2cf20125 Merge pull request #20552 from overleaf/ac-update-node-fetch-2
Reapply "Upgrade node-fetch to 2.7.0", Fix fetch-utils tests

GitOrigin-RevId: b42a2d2c50ce73f474e39755845e4df065f30b48
2024-10-01 08:05:18 +00:00
Liangjun Song
cfd0b39b96 Merge pull request #20557 from overleaf/ls-bump-express
update express and other dependencies

GitOrigin-RevId: 22107eab0fa95d534ab07360548ae2b2123776db
2024-09-27 08:04:18 +00:00
Antoine Clausse
2179d62d74 Merge pull request #20549 from overleaf/revert-20165-ac-update-node-fetch
Revert "Upgrade node-fetch to 2.7.0"

GitOrigin-RevId: 928df97c6fbc81f21097aaf9c331b0c70eeac002
2024-09-24 08:04:44 +00:00
Antoine Clausse
da3553d800 Upgrade node-fetch to 2.7.0 (#20165)
* Set `node-fetch` to `^2.7.0`

* Update package-lock.json

```
# root
bin/npm update node-fetch
bin/npm update cross-fetch

# in other path in docker
npm update node-fetch
```

* Update node-fetch patch

* [fetch-utils] Skip the test: destroys the request body if it doesn't get consumed

```
  1) fetch-utils
       fetchJson
         destroys the request body if it doesn't get consumed:
     FetchError: Invalid response body while trying to fetch http://example.com:30001/json/ignore-request: write EPIPE
      at PassThrough.<anonymous> (/overleaf/node_modules/node-fetch/lib/index.js:400:12)
      at PassThrough.emit (node:events:529:35)
      at emitErrorNT (node:internal/streams/destroy:151:8)
      at emitErrorCloseNT (node:internal/streams/destroy:116:3)
      at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
```

* [fetch-utils] Delete the test: destroys the request body if it doesn't get consumed

* Remove the `setTimeout` in the node-fetch patch

Fixes a test and doesn't break filestore acceptance tests

* Update node-fetch patch again: bring changes from https://github.com/node-fetch/node-fetch/blob/e87b093/src/index.js

* Update node-fetch patch again: bring changes from https://github.com/node-fetch/node-fetch/blob/e87b093/src/index.js

* Update node-fetch patches back to single lines

Per https://github.com/overleaf/internal/pull/20165#discussion_r1739035513

GitOrigin-RevId: 945e5a12e838673b7bc87b588b7aca1bcd9109e2
2024-09-24 08:04:39 +00:00
Brian Gough
344b4d0fa0 Merge pull request #18088 from overleaf/ab-session-secret-rotation
[web/realtime/history-v1] Support session secret rotation

GitOrigin-RevId: 3c2fa27b1b3e0a8e0c9d1af2e616ce873d54aedf
2024-05-27 10:23:33 +00:00
Eric Mc Sween
b8195f537d Merge pull request #18065 from overleaf/em-doc-versions-recovery-fix
Doc versions recovery for Server Pro 5.0.3

GitOrigin-RevId: 226b09383f9499c7eb1c20bf9e8e8e549bdbccb0
2024-04-25 08:04:50 +00:00
roo hutton
d75024a7a1 Merge pull request #17974 from overleaf/rh-express-4192
Upgrade express to 4.19.2

GitOrigin-RevId: 383877c39670093033d802af0fae54ec578ba327
2024-04-23 08:05:01 +00:00
Eric Mc Sween
b92d1a0251 Merge pull request #16524 from overleaf/em-fix-typescript-backend
Fix typescript config in the backend

GitOrigin-RevId: fb292968bc14da6d7c17bee1da00803a74901899
2024-01-17 09:03:42 +00:00
Eric Mc Sween
f1b460ecea Merge pull request #16385 from overleaf/em-typescript-other-services
Add type checking to all services

GitOrigin-RevId: f328a811fca7a783e9aff7d015ea73756acededd
2024-01-12 09:03:22 +00:00
Mathias Jakobsen
4763cfd59e Merge pull request #16058 from overleaf/jpa-faster-restart
[misc] faster service shutdown in dev-env

GitOrigin-RevId: c5589844aefe3ca097756b188e02354ab518b94d
2023-12-08 09:04:01 +00:00
Christopher Hoskin
0ae174a47b Merge pull request #15382 from overleaf/csh-issue-11625-mongo-ug-5-history-v1
Upgrade mongodb module for history-v1 from 4.11.0 to 6.2.0

GitOrigin-RevId: 2f0a8c07f2797ac23d202858613715b177b41e15
2023-10-26 08:03:38 +00:00
Alf Eaton
e5d4f3287f Remove istanbul (#15123)
GitOrigin-RevId: 08526efd53a4b0f115727b1215bd46e40ceb2b4e
2023-10-06 08:04:02 +00:00
Jakob Ackermann
efb36b7193 Merge pull request #14698 from overleaf/bg-sg-use-node-watch
[misc] replace nodemon with "node --watch"

GitOrigin-RevId: 8b34861887b39ffe1c64d9e4679f8ebef09302bd
2023-10-03 08:04:36 +00:00
Eric Mc Sween
12e7471213 Merge pull request #12916 from overleaf/bg-move-stream-buffer-code-to-library
move stream-related code to separate  `@overleaf/stream-utils` library

GitOrigin-RevId: a79a873109b927b4fc0ae36f47d5c67e0df58041
2023-06-02 08:05:57 +00:00
Jakob Ackermann
8541dc08fb Merge pull request #11210 from overleaf/em-upgrade-jsonwebtoken
Upgrade jsonwebtoken to 9.0.0

GitOrigin-RevId: 9d16fe64418c3c27e4380382f805a567bb68352e
2023-01-27 09:04:34 +00:00
Eric Mc Sween
c59b28d315 Merge pull request #11207 from overleaf/em-upgrade-express
Upgrade express to 4.18.2

GitOrigin-RevId: 07c450f31d3324429ac06719aa2bddb53ddce4b5
2023-01-25 09:06:11 +00:00
Eric Mc Sween
d01e83b453 Merge pull request #11170 from overleaf/em-upgrade-mocha
Upgrade mocha to 10.2.0

GitOrigin-RevId: e49606c73e813904d9b794792a838a951a814585
2023-01-17 09:06:28 +00:00
Alf Eaton
ee85d948e2 Avoid duplicating a math-closing dollar sign (#11227)
GitOrigin-RevId: ef2ef77e26df59d1af3df6dc664e284d3c70102d
2023-01-16 08:41:42 +00:00