#0030 Action Record Mapping #135

Merged
fuzzy merged 1 commit from feature/0030-action-record-mapping into main 2026-07-06 05:48:58 +00:00
Owner

Implements Action Record Mapping for Forgejo heatmap SQL generation.

Changes:

  • src/hottea/action.pyActionRecord dataclass + build_action() function
  • tests/test_action.py — 9 tests covering op_type, user IDs, repo ID, visibility scope, timestamps

Mapping logic:

  • op_type = 2 (push)
  • Public repos → user_id = 0 (visible to all)
  • Private repos → user_id = act_user_id (actor only)
  • act_user_id from Forgejo user ID
  • created_unix from commit's author date

Closes: #0030, #0023, #0024, #0025, #0026, #0027, #0028, #0029

Implements Action Record Mapping for Forgejo heatmap SQL generation. **Changes:** - `src/hottea/action.py` — `ActionRecord` dataclass + `build_action()` function - `tests/test_action.py` — 9 tests covering op_type, user IDs, repo ID, visibility scope, timestamps **Mapping logic:** - `op_type` = 2 (push) - Public repos → `user_id` = 0 (visible to all) - Private repos → `user_id` = `act_user_id` (actor only) - `act_user_id` from Forgejo user ID - `created_unix` from commit's author date **Closes:** #0030, #0023, #0024, #0025, #0026, #0027, #0028, #0029
Add ActionRecord dataclass and build_action() to map git
commits to Forgejo action records for heatmap injection.

- OP_TYPE_PUSH = 2
- build_action(): maps CommitInfo → ActionRecord
- Public repos: UserID = 0 (visible to all)
- Private repos: UserID = ActUserID (actor only)
- CreatedUnix from commit.author_date

Closes #23, #24, #25, #26, #27, #28, #29, #30
the.auditor left a comment

Audit Review — PR #135

Clean Action Record Mapping implementation. All 7 issues (#0023-#0029) addressed correctly. Good use of keyword-only is_public parameter, proper public/private scope logic, and correct timestamp extraction from author date.

No suggestions — this PR is clean and complete.

Summary

Result: COMMENT — no issues found.

## Audit Review — PR #135 Clean Action Record Mapping implementation. All 7 issues (#0023-#0029) addressed correctly. Good use of keyword-only `is_public` parameter, proper public/private scope logic, and correct timestamp extraction from author date. No suggestions — this PR is clean and complete. ## Summary **Result:** COMMENT — no issues found.
the.auditor left a comment

APPROVED. Clean implementation, correct scope logic, good tests. Merge when ready.

APPROVED. Clean implementation, correct scope logic, good tests. Merge when ready.
fuzzy merged commit 41b069c882 into main 2026-07-06 05:48:58 +00:00
fuzzy deleted branch feature/0030-action-record-mapping 2026-07-06 05:48:58 +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!135
No description provided.