Skip to content

Commit b7d9edf

Browse files
committed
Deprecate old endpoints
1 parent 3e81846 commit b7d9edf

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

openhands-agent-server/openhands/agent_server/git_router.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from openhands.sdk.git.git_changes import get_git_changes
1111
from openhands.sdk.git.git_diff import get_git_diff
1212
from openhands.sdk.git.models import GitChange, GitDiff
13+
from openhands.sdk.utils.deprecation import deprecated
1314

1415

1516
git_router = APIRouter(prefix="/git", tags=["Git"])
@@ -39,6 +40,15 @@ async def git_changes_query(
3940

4041

4142
@git_router.get("/changes/{path:path}")
43+
@deprecated(
44+
deprecated_in="1.15.0",
45+
removed_in="1.20.0",
46+
details=(
47+
"Use the /git/changes endpoint with a query parameter for the path "
48+
"instead of a path parameter. This allows for better handling of "
49+
"complex paths and is more consistent with other endpoints."
50+
),
51+
)
4252
async def git_changes_path(path: str) -> list[GitChange]:
4353
"""Get git changes using path parameter (legacy, for backwards compatibility)."""
4454
return await _get_git_changes(path)
@@ -53,6 +63,15 @@ async def git_diff_query(
5363

5464

5565
@git_router.get("/diff/{path:path}")
66+
@deprecated(
67+
deprecated_in="1.15.0",
68+
removed_in="1.20.0",
69+
details=(
70+
"Use the /git/changes endpoint with a query parameter for the path "
71+
"instead of a path parameter. This allows for better handling of "
72+
"complex paths and is more consistent with other endpoints."
73+
),
74+
)
5675
async def git_diff_path(path: str) -> GitDiff:
5776
"""Get git diff using path parameter (legacy, for backwards compatibility)."""
5877
return await _get_git_diff(path)

0 commit comments

Comments
 (0)