Backend Issue 4: Add Forgejo API Client Service #5

Closed
opened 2026-05-19 02:27:59 -05:00 by null · 0 comments
Owner

Goal

Create a small internal service for Forgejo REST calls.

Scope

  • Add a service wrapper around Forgejo issue APIs.
  • Use httpx.AsyncClient.
  • Support configured base URL and token auth.
  • Normalize Forgejo API errors into Pipeline service exceptions.
  • Support issue list and close issue operations.

Suggested Service API

  • list_issues(owner, repo, state, page, limit)
  • close_issue(owner, repo, issue_number)
  • get_repository(owner, repo)

Acceptance Criteria

  • Client sends Authorization: token <token>.
  • Client sets a short connect/read timeout.
  • Client sends a Pipeline-specific user agent.
  • Client can list issues for owner/repo with state, page, and limit.
  • Client excludes pull requests from issue sync.
  • Client can close one issue using PATCH /api/v1/repos/{owner}/{repo}/issues/{index} with {"state": "closed"}.
  • Client can fetch repository metadata.
  • Client handles non-2xx responses with clear error messages.
  • Tests mock HTTP responses and do not require a real Forgejo server.

Out Of Scope

  • Database models, API routes, Frontend UI.
## Goal Create a small internal service for Forgejo REST calls. ## Scope - Add a service wrapper around Forgejo issue APIs. - Use `httpx.AsyncClient`. - Support configured base URL and token auth. - Normalize Forgejo API errors into Pipeline service exceptions. - Support issue list and close issue operations. ## Suggested Service API - `list_issues(owner, repo, state, page, limit)` - `close_issue(owner, repo, issue_number)` - `get_repository(owner, repo)` ## Acceptance Criteria - Client sends `Authorization: token <token>`. - Client sets a short connect/read timeout. - Client sends a Pipeline-specific user agent. - Client can list issues for `owner/repo` with state, page, and limit. - Client excludes pull requests from issue sync. - Client can close one issue using `PATCH /api/v1/repos/{owner}/{repo}/issues/{index}` with `{"state": "closed"}`. - Client can fetch repository metadata. - Client handles non-2xx responses with clear error messages. - Tests mock HTTP responses and do not require a real Forgejo server. ## Out Of Scope - Database models, API routes, Frontend UI.
null closed this issue 2026-05-19 03:17:08 -05:00
null added the
api
backend
forgejo
validation
labels 2026-05-19 03:31:59 -05:00
Sign in to join this conversation.
No description provided.