-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
feat(api): add date range filtering to commit retrieval endpoints #34497
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
appleboy
commented
May 18, 2025
- Add support for filtering commits by date range via new "since" and "until" parameters
- Update API endpoints and command logic to handle the new parameters for fetching commits within given dates
- Extend API documentation and Swagger specs to describe the new "since" and "until" query parameters
- Refactor related function signatures and implementations to accept and pass "since" and "until" values
- Add support for filtering commits by date range via new "since" and "until" parameters - Update API endpoints and command logic to handle the new parameters for fetching commits within given dates - Extend API documentation and Swagger specs to describe the new "since" and "until" query parameters - Refactor related function signatures and implementations to accept and pass "since" and "until" values Signed-off-by: appleboy <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds date range filtering to commit retrieval endpoints by introducing new "since" and "until" query parameters. Key changes include updates to the Swagger documentation, modifications to web and API route handlers for commit retrieval, and adjustments in the Git module functions to support the new parameters.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
templates/swagger/v1_json.tmpl | Added "since" and "until" query parameter definitions for ISO 8601 date-time filtering. |
routers/web/repo/commit.go | Updated commit retrieval to include empty "since" and "until" parameters by default. |
routers/web/feed/branch.go | Updated branch feed logic to include new date filters with default empty values. |
routers/api/v1/repo/commits.go | Extracted new query parameters and passed them through the API commits retrieval logic. |
modules/git/repo_commit.go | Introduced commitsByRangeWithTime to support filtering by date range in Git commands. |
modules/git/commit.go | Updated CommitsByRange to call the new commitsByRangeWithTime function with date filters. |
- Quote the values for --since and --until options to handle arguments containing spaces or special characters Signed-off-by: appleboy <[email protected]>
The time parameters needs to be validated and it's better to have some tests. |
- Add validation for 'since' and 'until' parameters to ensure they follow ISO 8601 (RFC3339) format, returning an error if invalid Signed-off-by: Bo-Yi Wu <[email protected]>
- Remove single quotes from the --since and --until options in git command invocations - Refactor command chaining for improved readability in repo_stats.go - Remove an unused TODO comment from the commits test file Signed-off-by: Bo-Yi Wu <[email protected]>
- Remove single quotes from the --since and --until git command options to fix date formatting. Signed-off-by: Bo-Yi Wu <[email protected]>
* giteaofficial/main: [skip ci] Updated translations via Crowdin Fix ephemeral runner deletion (go-gitea#34447) ui: add a default tab on repo header when migrating (go-gitea#34503) Use run-name and evaluate workflow variables (go-gitea#34301) feat(api): add date range filtering to commit retrieval endpoints (go-gitea#34497) Export repo's manual merge settings (go-gitea#34502)