#0017 Environment Configuration #131

Merged
fuzzy merged 1 commit from feature/0017-environment-configuration into main 2026-07-06 05:03:16 +00:00
Owner

Implements environment configuration module.

Changes:

  • src/hottea/config.pyForgejoConfig dataclass + load_config() with validation
  • tests/test_config.py — 9 tests covering all fields, validation, env loading

Env vars:

  • HOTTEA_FORGEJO_URL — Forgejo API base URL
  • HOTTEA_FORGEJO_TOKEN — API token
  • HOTTEA_FORGEJO_USERNAME — target username
  • HOTTEA_FORGEJO_REPO — target repository name

Closes: #0017, #0012, #0013, #0014, #0015, #0060

Implements environment configuration module. **Changes:** - `src/hottea/config.py` — `ForgejoConfig` dataclass + `load_config()` with validation - `tests/test_config.py` — 9 tests covering all fields, validation, env loading **Env vars:** - `HOTTEA_FORGEJO_URL` — Forgejo API base URL - `HOTTEA_FORGEJO_TOKEN` — API token - `HOTTEA_FORGEJO_USERNAME` — target username - `HOTTEA_FORGEJO_REPO` — target repository name **Closes:** #0017, #0012, #0013, #0014, #0015, #0060
Add ForgejoConfig dataclass and load_config() that reads
from environment variables. Validates all required vars
are present with helpful error messages.

- load_config(): read HOTTEA_FORGEJO_{URL,TOKEN,USERNAME,REPO}
- ForgejoConfig.validate(): check all fields non-empty
- Module docstring documents all env vars

Closes #12, #13, #14, #15, #60
the.auditor left a comment

Audit Review — PR #131

Clean environment configuration module. Good use of frozen dataclass, proper validation reporting all missing fields, solid test coverage (9 tests) with monkeypatch for env var manipulation.

Suggestions

  1. src/hottea/config.pyForgejoConfig.__repr__ exposes token in plaintext via default dataclass repr. Add field(repr=False) to the token field to prevent accidental leakage in logs/errors. Filed as #132.

Summary

Result: COMMENT — 1 non-blocking suggestion filed as issue.

## Audit Review — PR #131 Clean environment configuration module. Good use of frozen dataclass, proper validation reporting all missing fields, solid test coverage (9 tests) with monkeypatch for env var manipulation. ## Suggestions 1. `src/hottea/config.py` — `ForgejoConfig.__repr__` exposes `token` in plaintext via default dataclass repr. Add `field(repr=False)` to the token field to prevent accidental leakage in logs/errors. Filed as #132. ## Summary **Result:** COMMENT — 1 non-blocking suggestion filed as issue.
the.auditor left a comment

APPROVED. Clean env config module with proper validation. Non-blocking suggestion in #132 — address at your leisure.

APPROVED. Clean env config module with proper validation. Non-blocking suggestion in #132 — address at your leisure.
fuzzy merged commit 43c7c0fd95 into main 2026-07-06 05:03:16 +00:00
fuzzy deleted branch feature/0017-environment-configuration 2026-07-06 05:03:16 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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
thwap/hottea!131
No description provided.