## Summary
Add targeted debug logging around the `get_issue` flow to make issue parsing failures easier to diagnose.
## Context
A valid `get_issue` request currently fails with:
```
'NoneType' object is not iterable
```
The related bug is tracked in #13.
## Goal
Improve observability so that future failures clearly show:
- the upstream Gitea response status
- which optional fields are present, null, or missing
- the exact parsing step that failed
- enough structured context to reproduce without leaking sensitive data
## Suggested Logging
Add debug logs for:
- request parameters (`owner`, `repo`, `issue_number`)
- upstream response status code
- top-level keys returned by the Gitea API
- nullable fields before iteration or transformation
- exception type and stack trace when parsing fails
## Safety Considerations
- Avoid logging tokens, authorization headers, or secrets
- Avoid logging full issue bodies by default if not needed
- Prefer structured logs over ad-hoc strings
## Acceptance Criteria
- [ ] `get_issue` emits useful debug logs when parsing starts
- [ ] null / missing optional fields are logged safely
- [ ] parse failures include exception type and stack trace
- [ ] logs avoid secrets and unnecessary issue content
- [ ] logs are sufficient to identify which field caused the failure
## Nice to Have
- Add a debug log toggle or log level guard if not already present
- Add a small regression test that asserts failure paths produce actionable diagnostics
Related: #13
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Add targeted debug logging around the
get_issueflow to make issue parsing failures easier to diagnose.Context
A valid
get_issuerequest currently fails with:The related bug is tracked in #13.
Goal
Improve observability so that future failures clearly show:
Suggested Logging
Add debug logs for:
owner,repo,issue_number)Safety Considerations
Acceptance Criteria
get_issueemits useful debug logs when parsing startsNice to Have
Related: #13
Implementation suggestion: introduce a small reusable logging helper pattern instead of adding ad-hoc debug logging inline.
Proposed Helper Pattern
Create a small module for consistent structured logging across MCP endpoints.
Suggested helpers:
Example Usage in
get_issueWhy this helps
None/ nullable field failures obviousSuggested Scope
This can start as part of #14 for
get_issue, then be reused later for:get_pull_requestlist_issuesget_commit_diff