Commit Graph

7 Commits

Author SHA1 Message Date
sylvain
b15ba9eea8 fix(cli): add __main__.py for python -m gitea_dashboard
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 19:08:25 +01:00
sylvain
01f88a0eca fix(audit): correct findings from review round 1
- client: add raise_for_status() in get_latest_release() for non-404 errors (FINDING-001)
- client: add timeout parameter (default 30s) passed to all session.get() calls (FINDING-004/SEC-002)
- cli: replace return with sys.exit(1) in all except blocks (FINDING-002)
- test_cli: remove duplicate test_exits_when_token_missing, assert GITEA_TOKEN in stderr (FINDING-006)
- test_cli: update connection error tests to expect SystemExit(1) after exit code fix
- test_cli: rework token masking test to inject token into exception message (FINDING-007)
- test_client: add test_raises_on_server_error for HTTP 500 path (FINDING-001)
- test_client: add tests for default and custom timeout values (FINDING-004)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-10 19:00:57 +01:00
sylvain
4aa648fa8c feat(cli): add main entry point with error handling (fixes #4)
Read GITEA_TOKEN (required) and GITEA_URL (default) from env vars,
orchestrate client/collect/render pipeline, handle connection and
timeout errors gracefully. Never expose token in error messages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 18:54:29 +01:00
sylvain
8fbdfcafd4 feat(display): add Rich dashboard rendering (fixes #3)
Render repos in a Rich table with [F]ork/[A]rchive/[M]irror indicators,
color-coded issue counts, relative release dates, and a milestones section.
Handles empty repo lists gracefully.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 18:54:25 +01:00
sylvain
b52bc72ce8 feat(collector): add RepoData dataclass and collect_all (fixes #2)
- RepoData dataclass with all repo fields
- collect_all enriches each repo with release and milestones
- Computes open_issues = open_issues_count - open_pr_counter
- 6 unit tests with mocked GiteaClient

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 18:51:17 +01:00
sylvain
4d66aea6ed feat(client): add GiteaClient with auth and pagination (fixes #1)
- GiteaClient with requests.Session and token auth header
- _get_paginated for automatic pagination (limit=50)
- get_repos, get_latest_release (None on 404), get_milestones
- 9 unit tests with mocked requests.Session
- Fix setuptools build backend in pyproject.toml

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 18:50:28 +01:00
sylvain
4e72ddc32f chore: init project structure
Discovery synthesis, docs tree, Python src layout, CLAUDE.md, pyproject.toml.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 18:21:33 +01:00