* Update shellcheck files to include non ".sh" files having the sh shebang
* Add shellcheck to root Makefile
* `make shellcheck_fix`
* Add shellcheck to server-ce and server-pro
* Exclude SC1091 (Not following) in SP/CE
* Fix errors in SP
* Fix errors in CE
* Update root shellcheck to ignore all failing rules. We can later remove rules one by one.
* Add shellcheck to web
* Add shellcheck step for server-ce and server-pro in cloudbuild.yaml
* Revert "Add shellcheck to root Makefile"
This reverts commit e0fa56f2
* Revert "`make shellcheck_fix`"
This reverts commit eb179245c109a9e742a7fdeeb75a4bdd03963587.
* `make shellcheck_fix` in server-ce
* Fix: Use $(...) notation instead of legacy backticked
```
In init_scripts/100_set_docker_host_ipaddress.sh line 5:
echo "`route -n | awk '/UG[ \t]/{print $2}'` dockerhost" >> /etc/hosts
^-- SC2006 (style): Use $(...) notation instead of legacy backticks `...`.
Did you mean:
echo "$(route -n | awk '/UG[ \t]/{print $2}') dockerhost" >> /etc/hosts
For more information:
https://www.shellcheck.net/wiki/SC2006 -- Use $(...) notation instead of le...
```
* `make shellcheck_fix` in web
* Manual corrections on autofix
* Update SHELLCHECK_FILES to Perl regex so it matches at start of file
GitOrigin-RevId: 815d53f319a3792efa22703beb75570de5977450
* [misc] silence logger when running tests
* [misc] re-enable logging in some tests for scripts
* [misc] make it easy to turn on verbose logging for tests
```
LOG_LEVEL=debug make test_unit
LOG_LEVEL=debug make test_acceptance
```
GitOrigin-RevId: 219bc6d1f9cbdb89ddd7d94742920913ddde4514
* Add a default 30s timeout for `delayShutdownMs`
`settings.delayShutdownMs` doesn't seem to be defined anywhere
Logs typically often this pair of entries:
```
INFO 2024-11-21T15:51:42.115Z [resource.labels.containerName: filestore] received interrupt, cleaning up
INFO 2024-11-21T15:51:42.120Z [resource.labels.containerName: filestore] shutdown timed out, exiting
```
This indicates that there is no delay between the interrupt signal and the shutdown. The 100ms delay also doesn't happen. We believe that the `server.close` callback is called after `server.closeAllConnections()`, and the `server closed` log is usually lost because of the process exiting immediately.
See: https://cloudlogging.app.goo.gl/WJQ6mc3gWwotVQya7
* Add timeout before exiting
* Replace `delayShutdownMs` by `gracefulShutdownDelayInMs`.
Looks like the error came from a wrong merge in https://github.com/overleaf/internal/pull/18756
We don't want a default 30s timeout for the shutdown, per https://github.com/overleaf/internal/pull/16888
GitOrigin-RevId: c1bdc8986f78a6e18e8b8b1fe60b33aa6ffef909
* Add `unicorn/prefer-node-protocol`
* Fix `unicorn/prefer-node-protocol` ESLint errors
* Run `npm run format:fix`
* Add sandboxed-module sourceTransformers in mocha setups
Fix `no such file or directory, open 'node:fs'` in `sandboxed-module`
* Remove `node:` in the SandboxedModule requires
* Fix new linting errors with `node:`
GitOrigin-RevId: 68f6e31e2191fcff4cb8058dd0a6914c14f59926
* 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
* Update `@google-cloud/storage` and remove its patches
* Re-add patch on `@google-cloud/storage/retry-request`
Replace mentions of `.pipe()` and run `patch-package @google-cloud/storage/retry-request`
It was very hard to test whether the package could still cause bugs, so I'd rather put the patch back
GitOrigin-RevId: be83b54b6d55849995ac131bfcf3c9acd9b6dd8e