Files
web-app-launcher/plans/service-integrations/phase-6-gitea.md
T
alexei.dolgolyov 50e8519220 feat(service-integrations): phase 2 — integration widget & app form UI
- Add 6 renderer components: StatCard, Gauge, List, Progress, AlertBanner, Chart
- Add IntegrationWidget container with auto-refresh, loading, error states
- Add IntegrationAlertOverlay for layout-level critical alerts
- Add IntegrationConfigFields for dynamic form generation from Zod schemas
- Register integration type in WidgetRenderer
- Extend WidgetCreationForm with integration app/endpoint pickers
- Extend AppForm with integration config section and test connection button
- Add /api/integrations/alerts endpoint
2026-03-25 22:07:51 +03:00

46 lines
2.4 KiB
Markdown

# Phase 6: Gitea Integration
**Status:** ⬜ Not Started
**Parent plan:** [PLAN.md](./PLAN.md)
**Domain:** backend
## Objective
Implement Gitea integration to display recent commits, open pull requests, CI/CD status, and releases from Gitea instances.
## Tasks
- [ ] Task 1: Create `src/lib/server/integrations/gitea/schema.ts` — Zod schemas for auth config (`{ apiToken: string, repos?: string[] }`) and endpoint responses.
- [ ] Task 2: Create `src/lib/server/integrations/gitea/client.ts` — HTTP client for Gitea API v1. Auth via `Authorization: token <apiToken>` header. Endpoints: `/api/v1/repos/search`, `/api/v1/repos/{owner}/{repo}/commits`, `/api/v1/repos/{owner}/{repo}/pulls`, `/api/v1/repos/{owner}/{repo}/releases`, `/api/v1/repos/{owner}/{repo}/actions/runners`.
- [ ] Task 3: Create `src/lib/server/integrations/gitea/transform.ts` — Transform: commits → list with author/message/date, PRs → stat-card (open count) + list, CI → list with pass/fail badges, releases → list with tag/date.
- [ ] Task 4: Create `src/lib/server/integrations/gitea/index.ts` — Integration implementation. Endpoints: `recent-commits` (list), `open-prs` (stat-card), `ci-status` (list), `releases` (list). testConnection: fetch authenticated user.
- [ ] Task 5: Register Gitea integration in registry.
## Files to Modify/Create
- `src/lib/server/integrations/gitea/schema.ts` — new
- `src/lib/server/integrations/gitea/client.ts` — new
- `src/lib/server/integrations/gitea/transform.ts` — new
- `src/lib/server/integrations/gitea/index.ts` — new
- `src/lib/server/integrations/registry.ts` — modify: register Gitea
## Acceptance Criteria
- Recent commits across repos with author, message, timestamp
- Open PR count as stat-card, PR list with title/author/repo
- CI/CD status with workflow name and pass/fail badge
- Releases list with tag, name, and date
- Optional repo filter (if configured, only show data from those repos)
- Test connection validates API token
## Notes
- If `repos` config is empty, auto-discover all accessible repos
- Limit commits/PRs to last N per repo for performance
- CI status depends on Gitea Actions being enabled (act-runner)
- API pagination: use `?limit=N&page=1` parameters
## Review Checklist
- [ ] All tasks completed
- [ ] Handles empty repos list (auto-discovery)
- [ ] Code follows project conventions
## Handoff to Next Phase
<!-- Filled in after completion -->