From 723a30ae2393934857c481b563f803d0790519de Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 25 Feb 2026 03:28:59 +0000 Subject: [PATCH] fix: replace deprecated SDK calls in timetracking (#136) ## Summary - Replace `client.GetMyStopwatches()` with `client.ListMyStopwatches(ListStopwatchesOptions{})` - Replace `client.GetMyTrackedTimes()` with `client.ListMyTrackedTimes(ListTrackedTimesOptions{})` - Fixes staticcheck SA1019 lint errors for deprecated API usage ## Test plan - [x] `make lint` passes with 0 issues - [x] `go test ./...` passes *Created by Claude on behalf of @silverwind* Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/136 Reviewed-by: Lunny Xiao Co-authored-by: silverwind Co-committed-by: silverwind --- operation/timetracking/timetracking.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/operation/timetracking/timetracking.go b/operation/timetracking/timetracking.go index 38c797a..c35e80f 100644 --- a/operation/timetracking/timetracking.go +++ b/operation/timetracking/timetracking.go @@ -207,7 +207,7 @@ func GetMyStopwatchesFn(ctx context.Context, req mcp.CallToolRequest) (*mcp.Call if err != nil { return to.ErrorResult(fmt.Errorf("get gitea client err: %v", err)) } - stopwatches, _, err := client.GetMyStopwatches() + stopwatches, _, err := client.ListMyStopwatches(gitea_sdk.ListStopwatchesOptions{}) if err != nil { return to.ErrorResult(fmt.Errorf("get stopwatches err: %v", err)) } @@ -367,7 +367,7 @@ func GetMyTimesFn(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolRe if err != nil { return to.ErrorResult(fmt.Errorf("get gitea client err: %v", err)) } - times, _, err := client.GetMyTrackedTimes() + times, _, err := client.ListMyTrackedTimes(gitea_sdk.ListTrackedTimesOptions{}) if err != nil { return to.ErrorResult(fmt.Errorf("get tracked times err: %v", err)) }