Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 76 additions & 70 deletions .github/workflows/backend-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,28 @@ jobs:
fail-fast: false
matrix:
# PRs: test on latest Node only. Push to develop: full matrix.
node: ${{ github.event_name == 'pull_request' && fromJSON('[">=24.0.0 <25.0.0"]') || fromJSON('[">=20.0.0 <21.0.0", ">=22.0.0 <23.0.0", ">=24.0.0 <25.0.0"]') }}
node: ${{ github.event_name == 'pull_request' && fromJSON('[24]') || fromJSON('[20, 22, 24]') }}
steps:
-
name: Checkout repository
uses: actions/checkout@v6
- uses: actions/cache@v5
name: Setup gnpm cache
if: always()
name: Cache pnpm store
with:
path: |
${{ env.PNPM_HOME }}
~/.local/share/gnpm
/usr/local/bin/gnpm
/usr/local/bin/gnpm-0.0.12
key: ${{ runner.os }}-gnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
path: ${{ env.PNPM_HOME }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-gnpm-store-
- name: Setup gnpm
uses: SamTV12345/gnpm-setup@main
${{ runner.os }}-pnpm-store-
- uses: pnpm/action-setup@v6
name: Install pnpm
with:
version: 0.0.12
version: 10.33.2
run_install: false
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
cache: pnpm
-
name: Install libreoffice
uses: awalsh128/cache-apt-pkgs-action@v1.6.0
Expand All @@ -57,19 +58,19 @@ jobs:
version: 1.0
-
name: Install all dependencies and symlink for ep_etherpad-lite
run: gnpm i --frozen-lockfile --runtimeVersion="${{ matrix.node }}"
run: pnpm i --frozen-lockfile
- name: Install admin ui
working-directory: admin
run: gnpm install --runtimeVersion="${{ matrix.node }}"
run: pnpm install
- name: Build admin ui
working-directory: admin
run: gnpm build --runtimeVersion="${{ matrix.node }}"
run: pnpm build
-
name: Run the backend tests
run: gnpm test --runtimeVersion="${{ matrix.node }}"
run: pnpm test
- name: Run the new vitest tests
working-directory: src
run: gnpm run test:vitest --runtimeVersion="${{ matrix.node }}"
run: pnpm run test:vitest

withpluginsLinux:
env:
Expand All @@ -84,27 +85,28 @@ jobs:
strategy:
fail-fast: false
matrix:
node: ${{ github.event_name == 'pull_request' && fromJSON('[">=24.0.0 <25.0.0"]') || fromJSON('[">=20.0.0 <21.0.0", ">=22.0.0 <23.0.0", ">=24.0.0 <25.0.0"]') }}
node: ${{ github.event_name == 'pull_request' && fromJSON('[24]') || fromJSON('[20, 22, 24]') }}
steps:
-
name: Checkout repository
uses: actions/checkout@v6
- uses: actions/cache@v5
name: Setup pnpm cache
if: always()
name: Cache pnpm store
with:
path: |
${{ env.PNPM_HOME }}
~/.local/share/gnpm
/usr/local/bin/gnpm
/usr/local/bin/gnpm-0.0.12
key: ${{ runner.os }}-gnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
path: ${{ env.PNPM_HOME }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-gnpm-store-
- name: Setup gnpm
uses: SamTV12345/gnpm-setup@main
${{ runner.os }}-pnpm-store-
- uses: pnpm/action-setup@v6
name: Install pnpm
with:
version: 10.33.2
run_install: false
- name: Use Node.js
uses: actions/setup-node@v6
with:
version: 0.0.12
node-version: ${{ matrix.node }}
cache: pnpm
-
name: Install libreoffice
uses: awalsh128/cache-apt-pkgs-action@v1.6.0
Expand All @@ -113,14 +115,14 @@ jobs:
version: 1.0
-
name: Install all dependencies and symlink for ep_etherpad-lite
run: gnpm install --frozen-lockfile --runtimeVersion="${{ matrix.node }}"
run: pnpm install --frozen-lockfile
- name: Build admin ui
working-directory: admin
run: gnpm build --runtimeVersion="${{ matrix.node }}"
run: pnpm build
-
name: Install Etherpad plugins
run: >
gnpm install --workspace-root
pnpm add -w
ep_align
ep_author_hover
Comment on lines 123 to 127
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Plugin cache key mismatch 🐞 Bug ☼ Reliability

Workflows install plugins via pnpm add -w (changing the runtime dependency set) but the
restored/saved node_modules cache key is still derived only from the pre-step pnpm-lock.yaml
hash, so with-plugins jobs can save a cache that later restores into jobs that were intended to run
without plugins. Etherpad enumerates installed plugins on startup (and will migrate plugins found in
node_modules), so restoring a cache with unexpected plugin packages can change test behavior and
cause flakiness.
Agent Prompt
### Issue description
CI caches `node_modules` using a key that does not encode the plugin set, but plugin jobs change dependencies at runtime via `pnpm add -w`. This can cause caches produced by with-plugins jobs to be restored in jobs intended to run without plugins, changing which plugins Etherpad loads during tests.

### Issue Context
Etherpad migrates plugins from `node_modules` and logs installed plugins at startup, so unexpected plugin packages present in `node_modules` can affect test execution.

### Fix Focus Areas
- Replace `pnpm add -w ...` with the repo-supported plugin installer (does not mutate workspace deps/lockfile in the same way):
  - .github/workflows/backend-tests.yml[149-163]
  - .github/workflows/load-test.yml[104-118]
  - .github/workflows/frontend-admin-tests.yml[85-105] (if plugins are added similarly elsewhere)
- And/or ensure caches cannot be shared between with-plugins and without-plugins jobs by making cache keys job-variant-specific:
  - .github/workflows/backend-tests.yml[43-56]
  - .github/workflows/backend-tests.yml[113-126]

(Option examples: use `pnpm run install-plugins <list>`; or add a `-withplugins` suffix to cache keys for plugin jobs; or drop `node_modules` caching and rely on pnpm store caching.)

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

ep_cursortrace
Expand All @@ -134,10 +136,10 @@ jobs:
ep_table_of_contents
-
name: Run the backend tests
run: gnpm test --runtimeVersion="${{ matrix.node }}"
run: pnpm test
- name: Run the new vitest tests
working-directory: src
run: gnpm run test:vitest --runtimeVersion="${{ matrix.node }}"
run: pnpm run test:vitest

# Windows tests only run on push to develop/master, not on PRs
withoutpluginsWindows:
Expand All @@ -148,34 +150,36 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [">=20.0.0 <21.0.0", ">=22.0.0 <23.0.0", ">=24.0.0 <25.0.0"]
node: [20, 22, 24]
name: Windows without plugins
runs-on: windows-latest
steps:
-
name: Checkout repository
uses: actions/checkout@v6
- uses: actions/cache@v5
name: Setup pnpm cache
if: always()
name: Cache pnpm store
with:
path: |
${{ env.PNPM_HOME }}
C:\gnpm\
C:\Users\runneradmin\AppData\Roaming\gnpm\
key: ${{ runner.os }}-gnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
path: ${{ env.PNPM_HOME }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-gnpm-store-
- name: Setup gnpm
uses: SamTV12345/gnpm-setup@main
${{ runner.os }}-pnpm-store-
- uses: pnpm/action-setup@v6
name: Install pnpm
with:
version: 0.0.12
version: 10.33.2
run_install: false
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
cache: pnpm
-
name: Install all dependencies and symlink for ep_etherpad-lite
run: gnpm install --frozen-lockfile --runtimeVersion="${{ matrix.node }}"
run: pnpm install --frozen-lockfile
- name: Build admin ui
working-directory: admin
run: gnpm build --runtimeVersion="${{ matrix.node }}"
run: pnpm build
-
name: Fix up the settings.json
run: |
Expand All @@ -184,10 +188,10 @@ jobs:
-
name: Run the backend tests
working-directory: src
run: gnpm test --runtimeVersion="${{ matrix.node }}"
run: pnpm test
- name: Run the new vitest tests
working-directory: src
run: gnpm run test:vitest --runtimeVersion="${{ matrix.node }}"
run: pnpm run test:vitest

withpluginsWindows:
env:
Expand All @@ -197,7 +201,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [">=20.0.0 <21.0.0", ">=22.0.0 <23.0.0", ">=24.0.0 <25.0.0"]
node: [20, 22, 24]
name: Windows with Plugins
runs-on: windows-latest

Expand All @@ -206,29 +210,31 @@ jobs:
name: Checkout repository
uses: actions/checkout@v6
- uses: actions/cache@v5
name: Setup pnpm cache
if: always()
name: Cache pnpm store
with:
path: |
${{ env.PNPM_HOME }}
C:\gnpm\
C:\Users\runneradmin\AppData\Roaming\gnpm\
key: ${{ runner.os }}-gnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
path: ${{ env.PNPM_HOME }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-gnpm-store-
- name: Setup gnpm
uses: SamTV12345/gnpm-setup@main
${{ runner.os }}-pnpm-store-
- uses: pnpm/action-setup@v6
name: Install pnpm
with:
version: 10.33.2
run_install: false
- name: Use Node.js
uses: actions/setup-node@v6
with:
version: 0.0.12
node-version: ${{ matrix.node }}
cache: pnpm
- name: Install dependencies
run: gnpm install --runtimeVersion="${{ matrix.node }}"
run: pnpm install
- name: Build admin ui
working-directory: admin
run: gnpm build --runtimeVersion="${{ matrix.node }}"
run: pnpm build
-
name: Install Etherpad plugins
run: >
gnpm install --workspace-root
pnpm add -w
ep_align
ep_author_hover
ep_cursortrace
Expand All @@ -251,7 +257,7 @@ jobs:
# rules.
-
name: Install all dependencies and symlink for ep_etherpad-lite
run: gnpm install --frozen-lockfile --runtimeVersion="${{ matrix.node }}"
run: pnpm install --frozen-lockfile
-
name: Fix up the settings.json
run: |
Expand All @@ -260,7 +266,7 @@ jobs:
-
name: Run the backend tests
working-directory: src
run: gnpm test --runtimeVersion="${{ matrix.node }}"
run: pnpm test
- name: Run the new vitest tests
working-directory: src
run: gnpm run test:vitest --runtimeVersion="${{ matrix.node }}"
run: pnpm run test:vitest
31 changes: 17 additions & 14 deletions .github/workflows/build-and-deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,31 @@ jobs:
- name: Checkout
uses: actions/checkout@v6
- uses: actions/cache@v5
name: Setup gnpm cache
if: always()
name: Cache pnpm store
with:
path: |
${{ env.STORE_PATH }}
~/.local/share/gnpm
/usr/local/bin/gnpm
/usr/local/bin/gnpm-0.0.12
key: ${{ runner.os }}-gnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-gnpm-store-
- name: Setup gnpm
uses: SamTV12345/gnpm-setup@main
${{ runner.os }}-pnpm-store-
- uses: actions/cache@v5
name: Cache vitepress build
with:
path: doc/.vitepress/cache
key: ${{ runner.os }}-vitepress-${{ hashFiles('doc/**/*.md', 'doc/.vitepress/config.*') }}
restore-keys: |
${{ runner.os }}-vitepress-
- uses: pnpm/action-setup@v6
name: Install pnpm
with:
version: 0.0.12
version: 10.33.2
run_install: false
- name: Setup Pages
uses: actions/configure-pages@v6
- name: Install dependencies
run: gnpm install
run: pnpm install --frozen-lockfile
- name: Build app
working-directory: doc
run: gnpm run docs:build
run: pnpm run docs:build
env:
COMMIT_REF: ${{ github.sha }}
- name: Upload artifact
Expand Down
22 changes: 9 additions & 13 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,17 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max
- uses: actions/cache@v5
name: Setup gnpm cache
if: always()
name: Cache pnpm store
with:
path: |
${{ env.PNPM_HOME }}
~/.local/share/gnpm
/usr/local/bin/gnpm
/usr/local/bin/gnpm-0.0.12
key: ${{ runner.os }}-gnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
path: ${{ env.PNPM_HOME }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-gnpm-store-
- name: Setup gnpm
uses: SamTV12345/gnpm-setup@main
${{ runner.os }}-pnpm-store-
- uses: pnpm/action-setup@v6
name: Install pnpm
with:
version: 0.0.12
version: 10.33.2
run_install: false
-
name: Test
working-directory: etherpad
Expand All @@ -74,7 +70,7 @@ jobs:
*) printf %s\\n "unexpected status: ${status}" >&2; exit 1;;
esac
done
(cd src && gnpm run test-container)
(cd src && pnpm run test-container)
git clean -dxf .

build-test-db-drivers:
Expand Down
Loading
Loading