Skip to content

Remove all Java code, de-mavenize, adapt to exist-core WebSocket#367

Merged
line-o merged 6 commits into
eXist-db:masterfrom
joewiz:feature/websocket-simplify
May 18, 2026
Merged

Remove all Java code, de-mavenize, adapt to exist-core WebSocket#367
line-o merged 6 commits into
eXist-db:masterfrom
joewiz:feature/websocket-simplify

Conversation

@joewiz
Copy link
Copy Markdown
Member

@joewiz joewiz commented Mar 17, 2026

[This response was co-authored with Claude Code. -Joe]

Summary

The Java code that previously provided monex's own WebSocket endpoint (/exist/rconsole) is removed in favor of the WebSocket support added to eXist-db core in eXist-db/exist#6145. This enables all Java code to be removed from monex and replaces the Maven build system with Node.js/Gulp, following the pattern established in eXist-db/semver.xq#69. Monex becomes a pure XQuery/XAR application with fully automated releases.

Depends on: eXist-db/exist#6145 (Jetty 12, WebSocket module) — merged.

Java Removal

The entire src/main/java/ tree (6 files) is removed and replaced by the WebSocket support now in eXist-db core (#6145):

File Now provided by
RemoteConsoleEndpoint exist-core WebSocketEndpoint (/exist/ws)
RemoteConsoleAdapter exist-core WebSocketAdapter
ConsoleAdapter exist-core ConsoleAdapter interface
ConsoleModule exist-core ConsoleCompatModule
Log exist-core ConsoleCompatFunctions
JMXToken Pure XQuery monex:jmx-token() (modules/monex.xqm)

Client-side adaptation: console.js (and console_spec.cy.js) connect to /exist/ws instead of the removed /exist/rconsole.

De-mavenization (modeled on semver.xq#69)

Build system: Maven → Node.js/Gulp

Removed Added
pom.xml package.json (version, metadata, scripts, deps)
xar-assembly.xml gulpfile.js (template → copy → zip pipeline)
xquery-license-style.xml expath-pkg.xml.tmpl + repo.xml.tmpl
Maven CI workflow Node.js CI workflow

Automated releases: semantic-release

File Purpose
.releaserc Commit analyzer → changelog → git commit → GitHub release with XAR
scripts/update-repo-changelog.js Parses conventional commits, inserts <change> into repo.xml.tmpl
commitlint.config.js Enforces Conventional Commits spec
.husky/commit-msg Git hook runs commitlint on commit
.github/workflows/commitlint.yml CI checks PR commits

Build commands

npm run build    # Build XAR to dist/
npm run deploy   # Build + deploy to local eXist
npm run develop  # Build + deploy + watch
npm test         # Cypress tests

Test infrastructure

console_spec.cy.js is updated so the suite runs against whatever Cypress.config('baseUrl') is configured for (was hardcoded to localhost:8080), and the cy.request calls that trigger server-side console:log now include Basic auth (eXist 7.0+ rejects guest access to the console module via REST with 403).

Test Results

Latest run against existdb/existdb:latest (eXist 7.0-SNAPSHOT, with #6145 merged):

  ✔  console_spec.cy.js         00:01   3  3  -  -  -
  ✔  indexes_spec.cy.js         00:01   1  1  -  -  -
  ✔  login_spec.cy.js           …       2  2  -  -  -
  ✔  monitoring_spec.cy.js      00:01   1  1  -  -  -
  ✔  profiling_spec.cy.js       00:01   1  1  -  -  -
  ✔  remote_spec.cy.js          00:01   1  1  -  -  -

🤖 Generated with Claude Code

@joewiz joewiz force-pushed the feature/websocket-simplify branch from 66688ef to dfff072 Compare March 17, 2026 06:11
@joewiz joewiz changed the title Remove all Java code — monex is now pure XQuery Remove all Java code and de-mavenize — monex is now pure XQuery Mar 17, 2026
@joewiz joewiz force-pushed the feature/websocket-simplify branch 3 times, most recently from 9c1c013 to bb50079 Compare March 22, 2026 15:28
BREAKING CHANGE: monex is now a pure XQuery app. Requires eXist-db 7.0+
with WebSocket support (exist-core PR #6145).

- Remove all Java code (6 files), replaced by exist-core WebSocket module
- Replace Maven build with Node.js/Gulp (modeled on semver.xq#69)
- Add automated releases via semantic-release

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@joewiz joewiz force-pushed the feature/websocket-simplify branch from bb50079 to af9a5f1 Compare March 22, 2026 15:29
@joewiz joewiz changed the title Remove all Java code and de-mavenize — monex is now pure XQuery Remove all Java code, de-mavenize, add query console with cursor pagination Mar 22, 2026
@line-o line-o added this to v7.0.0 Mar 23, 2026
@duncdrum duncdrum added this to the v7-beta milestone May 13, 2026
@joewiz joewiz force-pushed the feature/websocket-simplify branch from 3db8575 to 314974e Compare May 17, 2026 02:22
joewiz and others added 2 commits May 17, 2026 01:54
…implify

# Conflicts:
#	package-lock.json
#	package.json
#	pom.xml
Two issues prevented the console_spec from running outside of a default
localhost:8080 setup or against eXist 7.0+:

1. Hardcoded localhost:8080 URLs in cy.request and new WebSocket(...)
   collided with whatever was on port 8080 on the dev machine, causing
   the tests to silently hit the wrong server.

   Fix: derive existRoot and wsRoot from Cypress.config('baseUrl') so
   the tests follow whatever port the spec is configured for.

2. cy.request to /exist/rest/db with the console:log _query had no
   auth, which works against older eXist where guest can call the
   console module via REST. eXist 7.0+ rejects this with 403.

   Fix: include Basic admin: auth on the REST requests that trigger
   server-side console:log.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@joewiz joewiz force-pushed the feature/websocket-simplify branch from 57755c6 to 8c076ca Compare May 17, 2026 05:56
@joewiz joewiz changed the title Remove all Java code, de-mavenize, add query console with cursor pagination Remove all Java code, de-mavenize, adapt to exist-core WebSocket May 17, 2026
joewiz and others added 3 commits May 17, 2026 02:06
Two CI fixes for the new test job:

1. npm ci --ignore-scripts (used to skip husky's prepare) also skips
   Cypress's postinstall step that downloads the binary, so `npx cypress
   run` fails with "Cypress binary is missing". Add an explicit
   `npx cypress install` step right after `npm ci`.

2. Drop `release` from the eXist version matrix. This PR (de-mavenize +
   WebSocket adaptation) requires eXist 7.0+ for the /exist/ws endpoint
   from eXist-db/exist#6145, so the `release` (6.x) matrix entry is
   guaranteed to fail. Keep `latest` only.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The de-mavenize commit (aa11953) replaced the Java console:jmx-token()
with an XQuery monex:jmx-token() function and loaded it via:

    util:import-module(..., "modules/monex.xqm")

But app.xql itself lives in modules/, so the sibling import should be
"monex.xqm", not "modules/monex.xqm". The wrong path threw a
static-error which the try/catch wrapper swallowed → $app:jmx-token
resolved to false() → the rendered page got `token: "false"` →
silently broken JMX polling on the monitoring dashboard.

The catch-all wrapper exists for the legitimate case where the monex
module isn't loaded yet (during initial install). It also hides typos
like this one; the next commit adds a regression test.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Two cypress tests covering the JMX token chain that broke silently in
the previous commit:

1. app:instances-data renders a valid token for localhost — asserts
   window.JMX_INSTANCES[0].token matches a UUID format. Directly
   catches the "token serializes as 'false'" failure mode where
   app.xql's try/catch swallowed an error.

2. JMX endpoint accepts the rendered token — end-to-end check that
   the token in JMX_INSTANCES actually authorizes /exist/status.
   Catches subtler regressions (well-formed token, wrong endpoint
   or auth path).

URLs derive from Cypress.config('baseUrl') so the spec is
port-agnostic — same pattern as console_spec.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
dizzzz
dizzzz previously requested changes May 18, 2026
Copy link
Copy Markdown
Member

@dizzzz dizzzz left a comment

Choose a reason for hiding this comment

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

failing test

@dizzzz dizzzz requested review from a team, duncdrum, line-o and reinhapa May 18, 2026 15:57
@joewiz
Copy link
Copy Markdown
Member Author

joewiz commented May 18, 2026

[This response was co-authored with Claude Code. -Joe]

@dizzzz Re-ran the failed Test (eXist latest) job and it's now green — full 11/11 across all 7 specs. The original failure was the stale monitoring_spec.cy.js InstanceId test from before your #6380 merged; with that fix in existdb/existdb:latest (rebuilt 2026-05-18 07:37 UTC), the re-run picked up the corrected JMX bean exposure and passed. Thanks for the catch (and the upstream fix)!

@line-o line-o merged commit dedf303 into eXist-db:master May 18, 2026
6 of 7 checks passed
@github-project-automation github-project-automation Bot moved this from In progress to Done in App releases ahead of v7-beta May 18, 2026
@github-project-automation github-project-automation Bot moved this to Done in v7.0.0 May 18, 2026
duncdrum pushed a commit that referenced this pull request May 19, 2026
The Java code that previously lived in monex (RemoteConsoleEndpoint,
ConsoleModule, JMXToken, Log) was removed in #367. Those features are
now provided by eXist-db core 7.x as the WebSocket endpoint and the
ConsoleCompatModule. monex 7.x is therefore not installable against
eXist-db 6.x or earlier.

This commit exists to signal the breaking change to semantic-release,
which interprets the previous merge as non-breaking (no `!` marker or
BREAKING CHANGE footer on the squash/merge commit).

BREAKING CHANGE: monex no longer ships its own Java code. The WebSocket
endpoint and the `console` XQuery module are now provided by eXist-db
core 7.x. Earlier eXist-db versions are unsupported.
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 5.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants