9 Commits

Author SHA1 Message Date
sylvain
e02e211d86 fix(audit): correct v1.4.0 findings (6 items)
- FINDING-001: add activity column rendering in render_dashboard loop
- FINDING-002: map YAML 'token' key to 'auth' in _resolve_config
- FINDING-003/SEC-001: reject tokens containing unresolved ${...} refs
- FINDING-004: add tests for activity column rendering
- FINDING-006: strengthen test_main_columns_help assertions
- SEC-002: enrich timeout warning with collected items count

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 03:58:38 +01:00
sylvain
60c6aaede3 feat(dashboard): add milestone view and configurable columns
fixes #16, fixes #19

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 03:50:45 +01:00
sylvain
ebf72c9a56 test(v1.4.0-p2): add failing tests for milestones and columns
RED phase: 5 tests in test_collector.py (collect_milestones),
10 tests in test_display.py (render_milestones, parse_columns),
2 tests in test_exporter.py (milestones JSON), 7 tests in
test_cli.py (--milestones, --columns).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 03:46:09 +01:00
sylvain
16344bbb3f fix(client): validate Retry-After header (cap, fallback, edge cases)
- Ajoute try/except autour du float() pour gérer les dates HTTP RFC 7231
- Cap à 30s pour éviter un blocage indéfini sur valeur énorme
- Plancher à _RETRY_DELAY pour Retry-After: 0 ou négatif (FINDING-R2)
- 4 nouveaux tests : date HTTP, valeur zéro, valeur énorme, health check partiel

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 19:44:39 +01:00
sylvain
1b33cd36f9 feat(cli,display): add --health check and repo description column
Add --health option to verify Gitea connectivity and display version.
Add Description column (truncated at 40 chars) with --no-desc to hide
it. Add get_version() method to GiteaClient.

fixes #14
fixes #15

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 19:18:03 +01:00
sylvain
4c66fbe98d feat(v1.2.0): retry API, dernier commit, tri, coloration, export JSON
- client.py: _get_with_retry (max 2 retries, backoff lineaire), get_latest_commit
- collector.py: champ last_commit_date dans RepoData
- display.py: colonne "Dernier commit", _sort_repos (name/issues/release/activity),
  _colorize_milestone_due (rouge/jaune/vert selon echeance)
- cli.py: options --sort/-s et --format/-f (table/json)
- exporter.py: nouveau module, repos_to_dicts + export_json
- 88 tests (35 nouveaux), ruff clean

fixes #8, fixes #7, fixes #10, fixes #9, fixes #6

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 03:58:45 +01:00
sylvain
2232260821 feat(cli): add --repo and --exclude filtering (fixes #5)
Add argparse-based CLI parsing with repeatable --repo/-r (include) and
--exclude/-x (exclude) options. Filtering is case-insensitive substring
matching, applied post-fetch in collect_all() per ADR-005.

- parse_args() separated from main() for testability
- main(argv=None) accepts argv for test injection
- collect_all() gains optional include/exclude parameters
- 14 new tests (8 filtering + 6 CLI parsing/integration)
- All 51 tests pass, backward compatible (no args = v1.0.0 behavior)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 04:35:42 +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