Support Fess 15.7 unified /api/v2 health endpoint#31
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fess 15.7 unified its public API under
/api/v2and 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 byping, which moved from/api/v1/healthto/api/v2/healthand 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_v2version gate: addFessAPIClient.is_api_v2((major, minor) >= (15, 7)) and routeping()to/api/v2/healthon 15.7+,/api/v1/healthon older versions.pingcommand — cluster status is read fromresponse.engine(success) orresponse.error.details.engine(red cluster, HTTP 503) — while keeping the v1{"data": ...}handling for older servers.FESS_VERSIONfrom15.6.1to15.7.0. Fess 14.x and 15.x remain supported through the existing version-gated behavior (CRUD HTTP method selection and the health endpoint).conftest.pyversion-aware and bump thecompose-fess15.yamldefault image tag.FESS_VERSIONbehavior in the README.Version behavior matrix
FESS_VERSION/api/v1/health/api/v1/health/api/v2/health(v2 envelope)Tests
is_api_v2boundary across 14.x/15.x/16.x, default-version uses v2, v2 ping output (green/yellow/red/json), and asend_requestcase asserting a non-2xx JSON body (red-cluster 503) is parsed rather than raised.is_api_v2 = Falseto keep covering the pre-15.7 path.uv run pytest tests/unit/).