chore: Remove unnecessary logging
Migrate pre-commit tasks to local
This commit is contained in:
@@ -6,8 +6,15 @@ repos:
|
|||||||
- id: commitizen-branch
|
- id: commitizen-branch
|
||||||
stages:
|
stages:
|
||||||
- pre-push
|
- pre-push
|
||||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
- repo: local
|
||||||
rev: v0.12.5
|
|
||||||
hooks:
|
hooks:
|
||||||
- id: ruff-check
|
- id: ruff-check
|
||||||
|
name: ruff-check
|
||||||
|
entry: uv run ruff check
|
||||||
|
language: system
|
||||||
|
types: [python]
|
||||||
- id: ruff-format
|
- id: ruff-format
|
||||||
|
name: ruff-format
|
||||||
|
entry: uv run ruff format
|
||||||
|
language: system
|
||||||
|
types: [python]
|
||||||
|
|||||||
@@ -38,6 +38,9 @@ mcp run --transport sse nextcloud_mcp_server.app:mcp
|
|||||||
# Docker development environment with Nextcloud instance
|
# Docker development environment with Nextcloud instance
|
||||||
docker-compose up
|
docker-compose up
|
||||||
|
|
||||||
|
# After code changes, rebuild and restart only the MCP server container
|
||||||
|
docker-compose up --build -d mcp
|
||||||
|
|
||||||
# Build Docker image
|
# Build Docker image
|
||||||
docker build -t nextcloud-mcp-server .
|
docker build -t nextcloud-mcp-server .
|
||||||
```
|
```
|
||||||
@@ -96,6 +99,7 @@ Each Nextcloud app has a corresponding server module that:
|
|||||||
- **Integration tests** in `tests/integration/` - Test real Nextcloud API interactions
|
- **Integration tests** in `tests/integration/` - Test real Nextcloud API interactions
|
||||||
- **Fixtures** in `tests/conftest.py` - Shared test setup and utilities
|
- **Fixtures** in `tests/conftest.py` - Shared test setup and utilities
|
||||||
- Tests are marked with `@pytest.mark.integration` for selective running
|
- Tests are marked with `@pytest.mark.integration` for selective running
|
||||||
|
- **Important**: Integration tests run against live Docker containers. After making code changes to the MCP server, rebuild only the MCP container with `docker-compose up --build -d mcp` before running tests
|
||||||
|
|
||||||
### Configuration Files
|
### Configuration Files
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,13 @@ def retry_on_429(func):
|
|||||||
f"429 Client Error: Too Many Requests, Number of attempts: {retries}"
|
f"429 Client Error: Too Many Requests, Number of attempts: {retries}"
|
||||||
)
|
)
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
|
elif e.response.status_code == 404:
|
||||||
|
# 404 errors are often expected (e.g., checking if attachments exist)
|
||||||
|
# Log as debug instead of warning
|
||||||
|
logger.debug(
|
||||||
|
f"HTTPStatusError {e.response.status_code}: {e}, Number of attempts: {retries}"
|
||||||
|
)
|
||||||
|
raise
|
||||||
else:
|
else:
|
||||||
logger.warning(
|
logger.warning(
|
||||||
f"HTTPStatusError {e.response.status_code}: {e}, Number of attempts: {retries}"
|
f"HTTPStatusError {e.response.status_code}: {e}, Number of attempts: {retries}"
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class WebDAVClient(BaseNextcloudClient):
|
|||||||
# First try a PROPFIND to verify resource exists
|
# First try a PROPFIND to verify resource exists
|
||||||
propfind_headers = {"Depth": "0", "OCS-APIRequest": "true"}
|
propfind_headers = {"Depth": "0", "OCS-APIRequest": "true"}
|
||||||
try:
|
try:
|
||||||
propfind_resp = await self._client.request(
|
propfind_resp = await self._make_request(
|
||||||
"PROPFIND", webdav_path, headers=propfind_headers
|
"PROPFIND", webdav_path, headers=propfind_headers
|
||||||
)
|
)
|
||||||
logger.debug(
|
logger.debug(
|
||||||
@@ -44,8 +44,7 @@ class WebDAVClient(BaseNextcloudClient):
|
|||||||
# For other errors, continue with deletion attempt
|
# For other errors, continue with deletion attempt
|
||||||
|
|
||||||
# Proceed with deletion
|
# Proceed with deletion
|
||||||
response = await self._client.delete(webdav_path, headers=headers)
|
response = await self._make_request("DELETE", webdav_path, headers=headers)
|
||||||
response.raise_for_status()
|
|
||||||
logger.debug(f"Successfully deleted WebDAV resource '{path}'")
|
logger.debug(f"Successfully deleted WebDAV resource '{path}'")
|
||||||
return {"status_code": response.status_code}
|
return {"status_code": response.status_code}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user