Skip to content

Commit 7d5268b

Browse files
committed
Merge branch 'develop' into backend-esm-vitest
Brings 150 commits of develop work into the backend ESM + vitest migration branch (v2.7.3 → v3.0.0 release prep). 41 conflicts resolved, preserving this branch's ESM structure while layering in develop's new functionality. Conflict resolution highlights: - CHANGELOG.md: ESM/vitest plugin-author breaking changes folded into the v3.0.0 entry as a new "Breaking changes for plugin authors" section. - src/package.json: kept vitest-only test scripts, dropped mocha/mocha-froth devDeps, took newer @types/node and etherpad-cli-client versions. - src/node/db/{API,AuthorManager,DB,GroupManager,Pad}.ts: ESM exports preserved, develop's new GDPR anonymize/search APIs, deletion-token flow, ueberdb2 v6, and SYSTEM_AUTHOR_ID added as ESM exports. - src/node/handler/{APIHandler,PadMessageHandler,RestAPI,SocketIORouter}.ts: v1.3.1 API surface with compactPad/anonymizeAuthor, prometheus instrument hooks, anonymizeIp + isAcceptingConnections imports, socketioServer rename preserved. - src/node/hooks/express/*: ESM imports, anonymizeIp/ensureAuthorTokenCookie/ socialMeta wired in for v3 features. - src/node/utils/{Settings,UpdateCheck,ImportEtherpad}.ts: createHash for randomVersionString determinism, axios dropped in favour of native fetch / undici, dynamic ueberdb2 import removed (static import works under ESM). - src/node/server.ts: undici ProxyAgent (axios removal from develop), pkg.json import with `with { type: 'json' }` ESM attributes. - src/static/js/{ace,pad,pad_editor,pad_userlist,timeslider}.ts + pluginfw/installer.ts: full require()→import conversion preserved, develop's pad_mode/showPrivacyBannerIfEnabled/pad_version_badge/ pluginCatalogGuard/pluginEngineCheck/installerTasks imports added, pad_editor's focusOnLine settle-loop refactor kept. - Backend test specs: ESM imports + .js extensions preserved, vitest harness in src/tests/backend/common.ts kept (with develop's diagnostic loggers layered in), Settings CJS-compat tests dropped (no longer applicable under ESM), randomVersionString + padOptions tests converted to ESM. - Frontend specs: import unions resolved with .js extensions. - fuzzImportTest.ts: kept deleted (removed earlier in this branch with mocha-froth). - .github/workflows/backend-tests.yml: unified single `pnpm test` (vitest) with develop's Node diagnostic-report capture. - pnpm-lock.yaml: taken from develop; will need `pnpm install` to reconcile against the merged package.json (drops mocha/mocha-froth lockfile entries).
2 parents 327a541 + b96e262 commit 7d5268b

412 files changed

Lines changed: 57732 additions & 3595 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/backend-tests.yml

Lines changed: 70 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ jobs:
2727
strategy:
2828
fail-fast: false
2929
matrix:
30-
# PRs: test on latest Node only. Push to develop: full matrix.
31-
node: ${{ github.event_name == 'pull_request' && fromJSON('[24]') || fromJSON('[20, 22, 24]') }}
30+
# Etherpad requires Node >= 24 (see package.json engines.node).
31+
node: ${{ fromJSON('[24]') }}
3232
steps:
3333
-
3434
name: Checkout repository
@@ -43,7 +43,6 @@ jobs:
4343
- uses: pnpm/action-setup@v6
4444
name: Install pnpm
4545
with:
46-
version: 10.33.2
4746
run_install: false
4847
- name: Use Node.js
4948
uses: actions/setup-node@v6
@@ -67,7 +66,24 @@ jobs:
6766
run: pnpm build
6867
-
6968
name: Run the backend tests
70-
run: pnpm test
69+
env:
70+
# --report-on-fatalerror and friends write a Node diagnostic report
71+
# (V8 stack, libuv handles, OS info) on fatal errors that bypass JS
72+
# handlers — the failure mode we've been chasing on Windows + Node
73+
# 24 since PR #7663. Reports land in node-report/ and are uploaded
74+
# as an artifact if the step fails.
75+
NODE_OPTIONS: "--report-on-fatalerror --report-uncaught-exception --report-on-signal --report-compact --report-directory=${{ github.workspace }}/node-report"
76+
run: |
77+
mkdir -p "${{ github.workspace }}/node-report"
78+
pnpm test
79+
- name: Upload Node diagnostic reports on failure
80+
if: ${{ failure() }}
81+
uses: actions/upload-artifact@v7
82+
with:
83+
name: node-diagnostic-report-${{ runner.os }}-node${{ matrix.node }}-${{ github.job }}
84+
path: node-report/
85+
if-no-files-found: ignore
86+
retention-days: 7
7187

7288
withpluginsLinux:
7389
env:
@@ -82,7 +98,7 @@ jobs:
8298
strategy:
8399
fail-fast: false
84100
matrix:
85-
node: ${{ github.event_name == 'pull_request' && fromJSON('[24]') || fromJSON('[20, 22, 24]') }}
101+
node: ${{ fromJSON('[24]') }}
86102
steps:
87103
-
88104
name: Checkout repository
@@ -97,7 +113,6 @@ jobs:
97113
- uses: pnpm/action-setup@v6
98114
name: Install pnpm
99115
with:
100-
version: 10.33.2
101116
run_install: false
102117
- name: Use Node.js
103118
uses: actions/setup-node@v6
@@ -123,7 +138,9 @@ jobs:
123138
ep_align
124139
ep_author_hover
125140
ep_cursortrace
141+
ep_font_color
126142
ep_font_size
143+
ep_hash_auth
127144
ep_headings2
128145
ep_markdown
129146
ep_readonly_guest
@@ -133,7 +150,19 @@ jobs:
133150
ep_table_of_contents
134151
-
135152
name: Run the backend tests
136-
run: pnpm test
153+
env:
154+
NODE_OPTIONS: "--report-on-fatalerror --report-uncaught-exception --report-on-signal --report-compact --report-directory=${{ github.workspace }}/node-report"
155+
run: |
156+
mkdir -p "${{ github.workspace }}/node-report"
157+
pnpm test
158+
- name: Upload Node diagnostic reports on failure
159+
if: ${{ failure() }}
160+
uses: actions/upload-artifact@v7
161+
with:
162+
name: node-diagnostic-report-${{ runner.os }}-node${{ matrix.node }}-${{ github.job }}
163+
path: node-report/
164+
if-no-files-found: ignore
165+
retention-days: 7
137166

138167
# Windows tests only run on push to develop/master, not on PRs
139168
withoutpluginsWindows:
@@ -144,7 +173,8 @@ jobs:
144173
strategy:
145174
fail-fast: false
146175
matrix:
147-
node: [20, 22, 24]
176+
# Etherpad requires Node >= 24 (see package.json engines.node).
177+
node: ${{ fromJSON('[24]') }}
148178
name: Windows without plugins
149179
runs-on: windows-latest
150180
steps:
@@ -161,7 +191,6 @@ jobs:
161191
- uses: pnpm/action-setup@v6
162192
name: Install pnpm
163193
with:
164-
version: 10.33.2
165194
run_install: false
166195
- name: Use Node.js
167196
uses: actions/setup-node@v6
@@ -181,8 +210,21 @@ jobs:
181210
powershell -Command "(gc settings.json.holder) -replace '\"points\": 10', '\"points\": 1000' | Out-File -encoding ASCII settings.json"
182211
-
183212
name: Run the backend tests
213+
shell: bash
184214
working-directory: src
185-
run: pnpm test
215+
env:
216+
NODE_OPTIONS: "--report-on-fatalerror --report-uncaught-exception --report-on-signal --report-compact --report-directory=${{ github.workspace }}/node-report"
217+
run: |
218+
mkdir -p "${{ github.workspace }}/node-report"
219+
pnpm test
220+
- name: Upload Node diagnostic reports on failure
221+
if: ${{ failure() }}
222+
uses: actions/upload-artifact@v7
223+
with:
224+
name: node-diagnostic-report-${{ runner.os }}-node${{ matrix.node }}-${{ github.job }}
225+
path: node-report/
226+
if-no-files-found: ignore
227+
retention-days: 7
186228

187229
withpluginsWindows:
188230
env:
@@ -192,7 +234,8 @@ jobs:
192234
strategy:
193235
fail-fast: false
194236
matrix:
195-
node: [20, 22, 24]
237+
# Etherpad requires Node >= 24 (see package.json engines.node).
238+
node: ${{ fromJSON('[24]') }}
196239
name: Windows with Plugins
197240
runs-on: windows-latest
198241

@@ -210,7 +253,6 @@ jobs:
210253
- uses: pnpm/action-setup@v6
211254
name: Install pnpm
212255
with:
213-
version: 10.33.2
214256
run_install: false
215257
- name: Use Node.js
216258
uses: actions/setup-node@v6
@@ -229,7 +271,9 @@ jobs:
229271
ep_align
230272
ep_author_hover
231273
ep_cursortrace
274+
ep_font_color
232275
ep_font_size
276+
ep_hash_auth
233277
ep_headings2
234278
ep_markdown
235279
ep_readonly_guest
@@ -256,5 +300,18 @@ jobs:
256300
powershell -Command "(gc settings.json.holder) -replace '\"points\": 10', '\"points\": 1000' | Out-File -encoding ASCII settings.json"
257301
-
258302
name: Run the backend tests
303+
shell: bash
259304
working-directory: src
260-
run: pnpm test
305+
env:
306+
NODE_OPTIONS: "--report-on-fatalerror --report-uncaught-exception --report-on-signal --report-compact --report-directory=${{ github.workspace }}/node-report"
307+
run: |
308+
mkdir -p "${{ github.workspace }}/node-report"
309+
pnpm test
310+
- name: Upload Node diagnostic reports on failure
311+
if: ${{ failure() }}
312+
uses: actions/upload-artifact@v7
313+
with:
314+
name: node-diagnostic-report-${{ runner.os }}-node${{ matrix.node }}-${{ github.job }}
315+
path: node-report/
316+
if-no-files-found: ignore
317+
retention-days: 7
Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,38 @@
1-
# Workflow for deploying static content to GitHub Pages
1+
# Workflow for building and deploying the VitePress site to GitHub Pages.
2+
# Build runs on every push to develop and on every PR that touches docs (so
3+
# a build regression is caught at review time instead of breaking develop
4+
# after merge — see #7640). Deploy runs only on push: the github-pages
5+
# environment has protection rules that reject PR refs, and a PR build
6+
# never produced an artifact to deploy anyway.
27
name: Deploy Docs to GitHub Pages
38

49
on:
5-
# Runs on pushes targeting the default branch
610
push:
711
branches: ["develop"]
812
paths:
9-
- doc/** # Only run workflow when changes are made to the doc directory
10-
# Allows you to run this workflow manually from the Actions tab
13+
- doc/**
14+
- .github/workflows/build-and-deploy-docs.yml
15+
pull_request:
16+
paths:
17+
- doc/**
18+
- .github/workflows/build-and-deploy-docs.yml
1119
workflow_dispatch:
1220

13-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
1421
permissions:
1522
contents: read
1623
pages: write
1724
id-token: write
1825
packages: read
1926

20-
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
21-
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
27+
# Allow only one concurrent deployment, skipping runs queued between the run
28+
# in-progress and latest queued. Do NOT cancel in-progress runs — production
29+
# deployments are allowed to complete.
2230
concurrency:
2331
group: "pages"
2432
cancel-in-progress: false
2533

2634
jobs:
27-
# Single deploy job since we're just deploying
28-
deploy:
29-
environment:
30-
name: github-pages
31-
url: ${{ steps.deployment.outputs.page_url }}
35+
build:
3236
runs-on: ubuntu-latest
3337
steps:
3438
- name: Checkout
@@ -50,22 +54,43 @@ jobs:
5054
- uses: pnpm/action-setup@v6
5155
name: Install pnpm
5256
with:
53-
version: 10.33.2
5457
run_install: false
58+
# Pin Node so the build does not silently fall back to whatever the
59+
# runner image ships with. The repo declares engines.node >=24.0.0.
60+
- name: Use Node.js
61+
uses: actions/setup-node@v6
62+
with:
63+
node-version: 24
64+
cache: pnpm
5565
- name: Setup Pages
66+
if: github.event_name == 'push'
5667
uses: actions/configure-pages@v6
5768
- name: Install dependencies
5869
run: pnpm install --frozen-lockfile
5970
- name: Build app
6071
working-directory: doc
6172
run: pnpm run docs:build
6273
env:
74+
GITHUB_PAGES: ${{ github.event_name == 'push' && 'true' || '' }}
6375
COMMIT_REF: ${{ github.sha }}
6476
- name: Upload artifact
77+
if: github.event_name == 'push'
6578
uses: actions/upload-pages-artifact@v5
6679
with:
67-
# Upload entire repository
6880
path: './doc/.vitepress/dist'
81+
82+
# Deploy to GitHub Pages on push to develop only. Kept as a separate job
83+
# because the github-pages environment's protection rules reject any
84+
# non-develop ref (including PR merge refs), which used to fail the entire
85+
# workflow at job-creation time before any build step could run.
86+
deploy:
87+
needs: build
88+
if: github.event_name == 'push'
89+
environment:
90+
name: github-pages
91+
url: ${{ steps.deployment.outputs.page_url }}
92+
runs-on: ubuntu-latest
93+
steps:
6994
- name: Deploy to GitHub Pages
7095
id: deployment
7196
uses: actions/deploy-pages@v5

0 commit comments

Comments
 (0)