Validate edit_pr no-fields before authentication #43
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
tests/test_mcp_server.py::TestEditPR::test_edit_pr_no_fields_raisescan fail in environments without Gitea credentials becausegitea_edit_prcalls_auth(...)before checking whether any editable field was provided. A validation-only failure (no fields) then surfaces as aRuntimeError(no credentials) instead of the intendedValueError.Expected behavior
When
gitea_edit_pris called with no editable fields (title/body/state/baseallNone), it raises the intended validation error before attempting authentication, profile resolution, or any Gitea/API call.Why
Validation-only failures must not depend on credentials, network, or environment configuration.
Scope
_auth/URL setup ingitea_edit_pr(mcp_server.py).Tests
ValueError.api_request.Acceptance