#0047 SQL Output Options #140

Merged
fuzzy merged 1 commit from feature/0047-sql-output-options into main 2026-07-06 06:47:18 +00:00
Owner

Implements CLI entry point and SQL output options.

Changes:

  • src/hottea/cli.py — full CLI tool with --end-date, --output flags
  • src/hottea/sql.pygenerate_sql() now accepts per-record comments sequence
  • tests/test_cli.py — 6 parser tests
  • tests/test_sql.py — 1 new per-record comments test

Pipeline:

  1. Load env config → 2. Get git user → 3. Walk filtered commits → 4. Lookup Forgejo IDs → 5. Build action records → 6. Generate SQL

Output features:

  • Stdout by default, --output FILE to write to file
  • BEGIN TRANSACTION / COMMIT wrapper
  • Per-record comments with commit hash, author, timestamp
  • Proper formatting with blank lines between sections

Closes: #0047, #0042, #0043, #0044, #0045, #0046

Implements CLI entry point and SQL output options. **Changes:** - `src/hottea/cli.py` — full CLI tool with `--end-date`, `--output` flags - `src/hottea/sql.py` — `generate_sql()` now accepts per-record `comments` sequence - `tests/test_cli.py` — 6 parser tests - `tests/test_sql.py` — 1 new per-record comments test **Pipeline:** 1. Load env config → 2. Get git user → 3. Walk filtered commits → 4. Lookup Forgejo IDs → 5. Build action records → 6. Generate SQL **Output features:** - Stdout by default, `--output FILE` to write to file - `BEGIN TRANSACTION` / `COMMIT` wrapper - Per-record comments with commit hash, author, timestamp - Proper formatting with blank lines between sections **Closes:** #0047, #0042, #0043, #0044, #0045, #0046
feat(cli): implement SQL output options and CLI tool
All checks were successful
CI / lint-and-test (pull_request) Successful in 1m25s
cfdf6aab14
Add CLI entry point that orchestrates the full pipeline:
config → git user → walk commits → forgejo API → actions → SQL.

- Output to stdout by default (--output FILE to redirect)
- Transaction wrapper (BEGIN/COMMIT) included
- Per-record comments (commit hash, author, timestamp)
- Pretty-printed with blank lines and indentation
- generate_sql() now accepts per-record comments via sequence

Closes #42, #43, #44, #45, #46, #47
fuzzy scheduled this pull request to auto merge when all checks succeed 2026-07-06 06:45:41 +00:00
the.auditor left a comment

Audit Review — PR #140

Solid CLI implementation with full pipeline: config → git user → walk commits → Forgejo lookup → build records → generate SQL. Good use of argparse, clean per-record comments refactor in generate_sql().

Suggestions

  1. src/hottea/cli.pymain() has no exception handling. If config is missing, git repo is invalid, or Forgejo API is down, the user gets a raw traceback. Should catch known exceptions (ConfigError, GitRepoError, ForgejoError etc.) and print clean error messages. Filed as #141.

Summary

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

## Audit Review — PR #140 Solid CLI implementation with full pipeline: config → git user → walk commits → Forgejo lookup → build records → generate SQL. Good use of argparse, clean per-record comments refactor in `generate_sql()`. ## Suggestions 1. `src/hottea/cli.py` — `main()` has no exception handling. If config is missing, git repo is invalid, or Forgejo API is down, the user gets a raw traceback. Should catch known exceptions (`ConfigError`, `GitRepoError`, `ForgejoError` etc.) and print clean error messages. Filed as #141. ## Summary **Result:** COMMENT — 1 non-blocking suggestion filed as issue.
the.auditor left a comment

APPROVED. Full pipeline works end-to-end, clean CLI structure. Non-blocking suggestion in #141 (error handling polish) — address at your leisure.

APPROVED. Full pipeline works end-to-end, clean CLI structure. Non-blocking suggestion in #141 (error handling polish) — address at your leisure.
fuzzy merged commit cfdf6aab14 into main 2026-07-06 06:47:18 +00:00
fuzzy deleted branch feature/0047-sql-output-options 2026-07-06 06:47:18 +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!140
No description provided.