feat: implement issue time tracking and stopwatches #5

Open
opened 2026-06-02 06:56:55 +00:00 by a-limasov · 0 comments
Owner

Context

Time tracking allows developers to log time spent on issues directly in Gitea.
Stopwatches provide a live timer that can be started/stopped and then converted to
a time entry. Both are used in project management and billing workflows.

Endpoints to implement

Method Path Tool name Description
GET /repos/{owner}/{repo}/issues/{index}/times list_issue_times List time entries on issue
POST /repos/{owner}/{repo}/issues/{index}/times add_issue_time Add manual time entry
DELETE /repos/{owner}/{repo}/issues/{index}/times reset_issue_time Delete all time entries
DELETE /repos/{owner}/{repo}/issues/{index}/times/{id} delete_issue_time Delete single time entry
POST /repos/{owner}/{repo}/issues/{index}/stopwatch/start start_stopwatch Start stopwatch on issue
POST /repos/{owner}/{repo}/issues/{index}/stopwatch/stop stop_stopwatch Stop stopwatch (creates entry)
DELETE /repos/{owner}/{repo}/issues/{index}/stopwatch/delete cancel_stopwatch Cancel stopwatch without saving
GET /user/stopwatches list_my_stopwatches List all active stopwatches

Acceptance Criteria

  • add_issue_time(owner, repo, index, time, user_name, created)time is seconds (int)
  • list_issue_times returns list with user, time (seconds), created fields
  • start_stopwatch / stop_stopwatch / cancel_stopwatch return {"success": true} on 204
  • reset_issue_time deletes ALL time entries for the issue
  • list_my_stopwatches returns active stopwatches across all repos

Technical Notes

  • POST /times body: {"time": 3600, "user_name": "alice", "created": "2024-01-01T10:00:00Z"}
  • time field is in seconds (not minutes or hours)
  • Only one active stopwatch per user per issue at a time
  • stop_stopwatch automatically creates a time entry from elapsed time
## Context Time tracking allows developers to log time spent on issues directly in Gitea. Stopwatches provide a live timer that can be started/stopped and then converted to a time entry. Both are used in project management and billing workflows. ## Endpoints to implement | Method | Path | Tool name | Description | |--------|------|-----------|-------------| | GET | `/repos/{owner}/{repo}/issues/{index}/times` | `list_issue_times` | List time entries on issue | | POST | `/repos/{owner}/{repo}/issues/{index}/times` | `add_issue_time` | Add manual time entry | | DELETE | `/repos/{owner}/{repo}/issues/{index}/times` | `reset_issue_time` | Delete all time entries | | DELETE | `/repos/{owner}/{repo}/issues/{index}/times/{id}` | `delete_issue_time` | Delete single time entry | | POST | `/repos/{owner}/{repo}/issues/{index}/stopwatch/start` | `start_stopwatch` | Start stopwatch on issue | | POST | `/repos/{owner}/{repo}/issues/{index}/stopwatch/stop` | `stop_stopwatch` | Stop stopwatch (creates entry) | | DELETE | `/repos/{owner}/{repo}/issues/{index}/stopwatch/delete` | `cancel_stopwatch` | Cancel stopwatch without saving | | GET | `/user/stopwatches` | `list_my_stopwatches` | List all active stopwatches | ## Acceptance Criteria - [ ] `add_issue_time(owner, repo, index, time, user_name, created)` — `time` is seconds (int) - [ ] `list_issue_times` returns list with `user`, `time` (seconds), `created` fields - [ ] `start_stopwatch` / `stop_stopwatch` / `cancel_stopwatch` return `{"success": true}` on 204 - [ ] `reset_issue_time` deletes ALL time entries for the issue - [ ] `list_my_stopwatches` returns active stopwatches across all repos ## Technical Notes - `POST /times` body: `{"time": 3600, "user_name": "alice", "created": "2024-01-01T10:00:00Z"}` - `time` field is in **seconds** (not minutes or hours) - Only one active stopwatch per user per issue at a time - `stop_stopwatch` automatically creates a time entry from elapsed time
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: a-limasov/gitea-platform-mcp#5