Skip to content

Support Fess 15.7 unified /api/v2 health endpoint#31

Merged
marevol merged 2 commits into
mainfrom
feat/support-api-v2-15.7
Jun 25, 2026
Merged

Support Fess 15.7 unified /api/v2 health endpoint#31
marevol merged 2 commits into
mainfrom
feat/support-api-v2-15.7

Conversation

@marevol

@marevol marevol commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Fess 15.7 unified its public API under /api/v2 and removed the legacy /api/v1 (and /api/chat) surface. The admin API (/api/admin/*) is unchanged, so the only call in fessctl affected by this is the health check used by ping, which moved from /api/v1/health to /api/v2/health and now returns the v2 response envelope.

This PR makes fessctl work correctly against any supported Fess version (14.x and 15.x), gated by FESS_VERSION.

Changes

  • is_api_v2 version gate: add FessAPIClient.is_api_v2 ((major, minor) >= (15, 7)) and route ping() to /api/v2/health on 15.7+, /api/v1/health on older versions.
  • v2 envelope parsing: parse the v2 health response in the ping command — cluster status is read from response.engine (success) or response.error.details.engine (red cluster, HTTP 503) — while keeping the v1 {"data": ...} handling for older servers.
  • Default version: change the default FESS_VERSION from 15.6.1 to 15.7.0. Fess 14.x and 15.x remain supported through the existing version-gated behavior (CRUD HTTP method selection and the health endpoint).
  • Integration tests: make the health-wait URL in conftest.py version-aware and bump the compose-fess15.yaml default image tag.
  • Docs: clarify the FESS_VERSION behavior in the README.

Version behavior matrix

FESS_VERSION CRUD HTTP methods Health endpoint
14.x create=PUT / edit=POST / start,stop=POST /api/v1/health
15.0–15.6 create=POST / edit=PUT / start,stop=PUT /api/v1/health
15.7+ (default) same as 15.x /api/v2/health (v2 envelope)

Tests

  • Added unit tests: v2 ping endpoint/headers, is_api_v2 boundary across 14.x/15.x/16.x, default-version uses v2, v2 ping output (green/yellow/red/json), and a send_request case asserting a non-2xx JSON body (red-cluster 503) is parsed rather than raised.
  • Existing v1 ping tests pin is_api_v2 = False to keep covering the pre-15.7 path.
  • All 120 unit tests pass (uv run pytest tests/unit/).

marevol added 2 commits June 25, 2026 15:37
Fess 15.7 unified its public API under /api/v2 and removed the legacy
/api/v1 (and /api/chat) surface. The admin API (/api/admin/*) is
unchanged, so the only fessctl call affected is the health check used by
`ping`, which moved from /api/v1/health to /api/v2/health and now returns
the v2 response envelope.

- Add FessAPIClient.is_api_v2 ((major, minor) >= (15, 7)) and route ping
  to /api/v2/health on 15.7+, /api/v1/health on older versions.
- Parse the v2 health envelope in the ping command (cluster status under
  response.engine, or response.error.details.engine for a red cluster),
  while keeping the v1 {"data": ...} handling for older servers.
- Change the default FESS_VERSION from 15.6.1 to 15.7.0. Fess 14.x and
  15.x remain supported via the existing version-gated behavior.
- Make the integration test health wait version-aware and bump the
  compose default image tag.
- Update unit tests (v2 ping, version gate, default version, non-2xx
  JSON body) and the README.
Exercise the new /api/v2 health path in integration tests. Fess 15.7.0
pairs with OpenSearch 3.7.0; the existing 15.6.1 entry keeps coverage of
the /api/v1 health path on a 15.x server. The compose-fess15.yaml image
tag is parameterized by FESS_VERSION, so no extra compose file is needed.
@marevol marevol merged commit ec97fb6 into main Jun 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant