feat: add haskytech-forgejo shared client package #10

Merged
john merged 1 commit from feat/forgejo-client into dev 2026-06-04 16:14:23 +00:00
Owner

Summary

Async Forgejo API client for HaskyTech infrastructure. Consolidates scattered Forgejo API calls from smeos (12 files, 3 HTTP client patterns, 18 API endpoints) into a single typed package.

Modules

Module Purpose
client.py ForgejoClient (async httpx) — PR ops, CI status, branches, branch protection, collaborators, repos, webhooks
models.py Pydantic response models (PR, CommitStatus, Branch, CIRun, etc.)
ci_logs.py SSH-based CI log retrieval (disk zst + DBFS fallback)
utils.py URL parsing, repo slug resolution, PR URL extraction
config.py ForgejoConfig (Pydantic Settings, FORGEJO_URL/TOKEN env vars)

Design Principles

  • Async-first — all API methods are async (httpx.AsyncClient)
  • Typed responses — Pydantic models, not raw dicts
  • Bounded pagination — default 20, max 50
  • Token-optimized — smart lookups (branch names, PR numbers, repo slugs)

Consumers

  1. forgejo-mcp (hosted MCP server) — wraps as MCP tools for AI agents (Phase 2)
  2. smeos/orch-watch — direct Python import, replaces scattered code (Phase 3)

Publish

Tag forgejo-v0.1.0 triggers CI publish to Forgejo PyPI registry.

## Summary Async Forgejo API client for HaskyTech infrastructure. Consolidates scattered Forgejo API calls from smeos (12 files, 3 HTTP client patterns, 18 API endpoints) into a single typed package. ## Modules | Module | Purpose | |--------|---------| | `client.py` | ForgejoClient (async httpx) — PR ops, CI status, branches, branch protection, collaborators, repos, webhooks | | `models.py` | Pydantic response models (PR, CommitStatus, Branch, CIRun, etc.) | | `ci_logs.py` | SSH-based CI log retrieval (disk zst + DBFS fallback) | | `utils.py` | URL parsing, repo slug resolution, PR URL extraction | | `config.py` | ForgejoConfig (Pydantic Settings, FORGEJO_URL/TOKEN env vars) | ## Design Principles - **Async-first** — all API methods are async (httpx.AsyncClient) - **Typed responses** — Pydantic models, not raw dicts - **Bounded pagination** — default 20, max 50 - **Token-optimized** — smart lookups (branch names, PR numbers, repo slugs) ## Consumers 1. **forgejo-mcp** (hosted MCP server) — wraps as MCP tools for AI agents (Phase 2) 2. **smeos/orch-watch** — direct Python import, replaces scattered code (Phase 3) ## Publish Tag `forgejo-v0.1.0` triggers CI publish to Forgejo PyPI registry.
feat: add haskytech-forgejo shared client package
All checks were successful
CI / detect-changes (pull_request) Successful in 4s
CI / Lint & Format (pull_request) Successful in 22s
CI / Unit Tests (pull_request) Successful in 24s
3f4652ea40
Async Forgejo API client for HaskyTech infrastructure. Consolidates
scattered Forgejo API calls from smeos (12 files, 3 HTTP patterns)
into a single typed package.

Modules:
- client.py: ForgejoClient (async httpx) — PR ops, CI status, branches,
  branch protection, collaborators, repos, webhooks
- models.py: Pydantic response models (PR, CommitStatus, Branch, etc.)
- ci_logs.py: SSH-based CI log retrieval (disk zst + DBFS fallback)
- utils.py: URL parsing, repo slug resolution, PR URL extraction
- config.py: ForgejoConfig (Pydantic Settings)

Shared by:
- forgejo-mcp (hosted MCP server for AI agents) — Phase 2
- smeos/orch-watch (direct import, no HTTP hop) — Phase 3

Also updates publish.yml with forgejo-v* tag trigger.
john merged commit d5821a5302 into dev 2026-06-04 16:14:23 +00:00
john deleted branch feat/forgejo-client 2026-06-04 16:14:23 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
haskytech/haskytech-modules-py!10
No description provided.