Skip to content

Review and update Fess management API calls#22

Merged
marevol merged 3 commits intomainfrom
claude/review-fess-api-calls-011CV49DXmsY3X7VCuSTGrNc
Nov 13, 2025
Merged

Review and update Fess management API calls#22
marevol merged 3 commits intomainfrom
claude/review-fess-api-calls-011CV49DXmsY3X7VCuSTGrNc

Conversation

@marevol
Copy link
Contributor

@marevol marevol commented Nov 13, 2025

…3.3.2

This commit improves the robustness of Fess API calls and updates all version references to the latest stable releases.

API Improvements:

  • Add explicit HTTP status code checking (400+ errors)
  • Make timeout configurable via FessAPIClient constructor (default: 5.0s)
  • Enhance error messages for better debugging:
    • Network errors clearly identified
    • HTTP errors include status code and API response message
    • JSON parse errors show the invalid response

Version Updates:

  • Update Fess from 15.1.0 to 15.3.2
  • Update OpenSearch from 3.1.0 to 3.3.2
  • Update default version in settings.py from 14.19.0 to 15.3.2
  • Update all documentation and test configurations

The previous implementation had response.raise_for_status() commented out, which could allow HTTP errors to pass through silently if they returned valid JSON. This is now properly handled with explicit status code checks.

…3.3.2

This commit improves the robustness of Fess API calls and updates all version
references to the latest stable releases.

API Improvements:
- Add explicit HTTP status code checking (400+ errors)
- Make timeout configurable via FessAPIClient constructor (default: 5.0s)
- Enhance error messages for better debugging:
  - Network errors clearly identified
  - HTTP errors include status code and API response message
  - JSON parse errors show the invalid response

Version Updates:
- Update Fess from 15.1.0 to 15.3.2
- Update OpenSearch from 3.1.0 to 3.3.2
- Update default version in settings.py from 14.19.0 to 15.3.2
- Update all documentation and test configurations

The previous implementation had response.raise_for_status() commented out,
which could allow HTTP errors to pass through silently if they returned
valid JSON. This is now properly handled with explicit status code checks.
The previous commit incorrectly raised exceptions for all HTTP 400+ status codes.
However, Fess API returns valid JSON responses even for errors (like "resource not found"),
with error details in the response.status field.

Changes:
- Remove HTTP 400+ status code check that was raising exceptions
- Allow JSON parsing for all HTTP status codes
- Commands can now check response.status field and display appropriate error messages
- Keep improved error messages for network errors and JSON parsing failures

This fixes test failures where commands expected to handle 400 errors gracefully
by checking the JSON response status field.
These commands were missing exception handling in their get operations,
causing exit code 2 errors when exceptions occurred.

Changes:
- Add try-except blocks to get_fileauth, get_fileconfig, and get_keymatch
- Properly catch and display error messages for API failures
- Match the error handling pattern used in other commands (e.g., user.py)
- Change exit code from hardcoded 1 to status for consistency

This fixes test failures in:
- test_fileauth_crud_flow
- test_fileconfig_crud_flow
- test_keymatch_crud_flow
@marevol marevol merged commit 3614b1f into main Nov 13, 2025
2 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.

2 participants