Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
lunny merged 8 commits intogo-gitea:mainfromappleboy:api
May 20, 2025

Conversation

@appleboy
Copy link
Member

  • 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" valuesSigned-off-by: appleboy <appleboy.tw@gmail.com>
@GiteaBotGiteaBot added the lgtm/need 2This PR needs two approvals by maintainers to be considered for merging. labelMay 18, 2025
@github-actionsgithub-actionsbot added modifies/apiThis PR adds API routes or modifies them modifies/goPull requests that update Go code labelsMay 18, 2025
@appleboyappleboy added modifies/goPull requests that update Go code and removed modifies/goPull requests that update Go code labelsMay 18, 2025
@appleboyappleboy requested a review fromCopilotMay 18, 2025 15:09
Copy link

CopilotAI left a 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
FileDescription
templates/swagger/v1_json.tmplAdded "since" and "until" query parameter definitions for ISO 8601 date-time filtering.
routers/web/repo/commit.goUpdated commit retrieval to include empty "since" and "until" parameters by default.
routers/web/feed/branch.goUpdated branch feed logic to include new date filters with default empty values.
routers/api/v1/repo/commits.goExtracted new query parameters and passed them through the API commits retrieval logic.
modules/git/repo_commit.goIntroduced commitsByRangeWithTime to support filtering by date range in Git commands.
modules/git/commit.goUpdated 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 charactersSigned-off-by: appleboy <appleboy.tw@gmail.com>
@lunny
Copy link
Member

The time parameters needs to be validated and it's better to have some tests.

techknowlogick reacted with thumbs up emoji

- Add validation for 'since' and 'until' parameters to ensure they follow ISO 8601 (RFC3339) format, returning an error if invalidSigned-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
@appleboy
Copy link
MemberAuthor

@lunny See9deef2d to validate the parameter.

@GiteaBotGiteaBot added lgtm/need 1This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2This PR needs two approvals by maintainers to be considered for merging. labelsMay 19, 2025
- 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 fileSigned-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Remove single quotes from the --since and --until git command options to fix date formatting.Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
@GiteaBotGiteaBot added lgtm/doneThis PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1This PR needs approval from one additional maintainer to be merged. labelsMay 20, 2025
@lunnylunny merged commitd06eb8d intogo-gitea:mainMay 20, 2025
26 checks passed
@GiteaBotGiteaBot added this to the1.25.0 milestoneMay 20, 2025
@appleboyappleboy deleted the api branchMay 20, 2025 02:15
zjjhot added a commit to zjjhot/gitea that referenced this pull requestMay 21, 2025
* 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)
@go-giteago-gitea locked asresolvedand limited conversation to collaboratorsAug 18, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@wxiaoguangwxiaoguangwxiaoguang left review comments

Copilot code reviewCopilotCopilot left review comments

@lunnylunnylunny approved these changes

+1 more reviewer

@hiifonghiifonghiifong approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

lgtm/doneThis PR has enough approvals to get merged. There are no important open reservations anymore.modifies/apiThis PR adds API routes or modifies themmodifies/goPull requests that update Go code

Projects

None yet

Milestone

1.25.0

Development

Successfully merging this pull request may close these issues.

5 participants

@appleboy@lunny@wxiaoguang@hiifong@GiteaBot

[8]ページ先頭

©2009-2025 Movatter.jp