ci: swap deprecated ep_readonly_guest for ep_guest in plugin matrix#7808
Conversation
ep_readonly_guest is archived (read-only on GitHub) and its authenticate hook unconditionally swaps req.session.user with a read-only guest, even when the request carries an HTTP Authorization header. That silently demoted admin login attempts and stalled the anonymizeAuthorSocket tests for 14 min/run on every with-plugins CI matrix (ether#7795). The pre-fix theory blamed ep_hash_auth.handleMessage; the actual hook trace is a red herring — handleMessage only fires on the /pad namespace and never on /settings. ep_guest is the maintained successor (same authors, same purpose). 1.0.72 on npm already includes the "defer to basic auth / admin paths" fix backported to ep_readonly_guest by intent here. Swapping the matrix unblocks the anonymizeAuthorSocket suite on Linux, Windows, and the upgrade-from-latest-release workflow. The runtime probe added in ether#7796 stays — it still catches any other authenticate-hook plugin that rejects the test's plain-text credentials (e.g. a future ep_hash_auth-style hashed-only plugin). Reattribute its comment so future readers don't chase ep_hash_auth. Closes ether#7795. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
Review Summary by QodoReplace deprecated ep_readonly_guest with ep_guest in CI workflows
WalkthroughsDescription• Replace archived ep_readonly_guest with maintained ep_guest plugin • Fixes anonymizeAuthorSocket tests stalling 14 min/run in CI • ep_guest properly defers to basic auth and admin paths • Clarify probe comment to reference actual offender ep_readonly_guest Diagramflowchart LR
A["ep_readonly_guest<br/>archived plugin"] -->|"swap for"| B["ep_guest<br/>maintained successor"]
B -->|"defers to"| C["Basic auth &<br/>admin paths"]
C -->|"unblocks"| D["anonymizeAuthorSocket<br/>tests pass"]
File Changes1. .github/workflows/backend-tests.yml
|
Code Review by Qodo
Context used 1. Suite still skips on failure
|
| if (!probe.ok) { | ||
| console.warn( | ||
| `[anonymizeAuthorSocket] admin socket probe failed (${probe.reason}); ` + | ||
| 'skipping suite — likely an authenticate-hook plugin (e.g. ep_hash_auth) ' + | ||
| 'rejecting the test\'s plain-text admin credentials. Tracked in #7795.'); | ||
| 'skipping suite — an authenticate-hook plugin (e.g. ep_readonly_guest, ' + | ||
| 'or an ep_hash_auth-style plugin requiring hashed credentials) is ' + | ||
| 'rejecting the test\'s plain-text admin credentials.'); | ||
| this.skip(); | ||
| return; |
There was a problem hiding this comment.
1. Suite still skips on failure 📎 Requirement gap ☼ Reliability
The anonymizeAuthorSocket suite still calls this.skip() when the admin socket probe fails, which can let plugin-enabled CI go green without exercising the 7 /settings socket tests. This also means the PR does not provide a failing regression signal if the authenticate-hook interaction regresses in the future.
Agent Prompt
## Issue description
`src/tests/backend/specs/admin/anonymizeAuthorSocket.ts` currently skips the entire suite when the admin socket probe fails. Per the compliance checklist, this mitigation should be removed once the underlying issue is addressed, and bug fixes should be backed by a regression test that fails when the issue reappears.
## Issue Context
The probe is intended to prevent long CI hangs, but `this.skip()` allows CI to pass without validating `/settings` emit/reply behavior under plugins.
## Fix Focus Areas
- src/tests/backend/specs/admin/anonymizeAuthorSocket.ts[139-146]
## Implementation notes
- Replace `this.skip()` with a failing assertion (e.g., `assert.fail(...)`) or `throw new Error(...)` so CI fails fast (within the probe budget) instead of silently skipping.
- Ensure the failure message clearly identifies that an authenticate-hook plugin prevented admin session establishment and caused missing `/settings` handlers.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Summary
ep_readonly_guestis archived (read-only on GitHub) and itsauthenticatehook unconditionally swapsreq.session.userwith a read-only guest, even when the request carries an HTTPAuthorizationheader. That silently demoted admin login attempts and stalled theanonymizeAuthorSockettests for 14 min/run on every with-plugins CI matrix (#7795).The pre-fix theory in #7795 blamed
ep_hash_auth.handleMessage— that's a red herring. The hook is only invoked byPadMessageHandler.ts:559and never fires on the/settingsnamespace. The deprecation warning in the issue trace came from an unrelated earlier test (rate-limited bywarnDeprecated's 10-min stack dedupe inpad_utils.ts:141).Root cause
ep_readonly_guest/index.js:31-39:Plus it
sorts itself to run first inexpressCreateServer. So when the test doesGET /admin/withAuthorization: Basic …,ep_readonly_guestruns first, ignores the header, sets the guest session, returns[true]. The Set-Cookie returned to the test is for a guest. Socket connects to/settings;adminsettings.ts:25checksis_admin→ false → handler bails without bindingsocket.on('authorLoad', …). Every subsequentemit()has no listener → mocha 60s timeout × 7.Fix
ep_guest@1.0.72(the maintained successor by the same authors) already defers when the request targets/admin*or carries anAuthorizationheader — see itsindex.js:50-51, added in response to its own issue #85. Swappingep_readonly_guest→ep_guestin the plugin matrix unblocksanonymizeAuthorSocketon Linux, Windows, and the upgrade-from-latest-release workflow.The runtime probe added in #7796 stays in place — it still catches any other authenticate-hook plugin that rejects the test's plain-text credentials (e.g. a future
ep_hash_auth-style hashed-only plugin). Its comment is reattributed so future readers don't chase theep_hash_authred herring.Verification
Reproduced in a worktree off
develop@f6ab8561a(Node 24) with the exact CI plugin list:anonymizeAuthorSockettests skip via the probe (Successful authentication … for user guestin logs).tests/backend/specs/admin+tests/backend/specs/apiunder the swapped matrix: 321 passing, 13 pending, 0 failing.Files
.github/workflows/backend-tests.yml— Linux + Windows with-plugins matrices.github/workflows/frontend-tests.yml— UI + admin with-plugins matrices.github/workflows/upgrade-from-latest-release.yml.github/workflows/load-test.ymlsrc/tests/backend/specs/admin/anonymizeAuthorSocket.ts— reattribute the probe-skip warning so it points atep_readonly_guest(the historical offender) instead ofep_hash_auth.Closes #7795.
Test plan
🤖 Generated with Claude Code