Skip to content

feat: Implement List Repository Activities endpoint - #3651

Merged
gmlewis merged 6 commits into
google:masterfrom
AbhishekAg:gh_repo_activities
Jul 29, 2025
Merged

feat: Implement List Repository Activities endpoint#3651
gmlewis merged 6 commits into
google:masterfrom
AbhishekAg:gh_repo_activities

Conversation

@AbhishekAg

@AbhishekAgAbhishekAg commented Jul 26, 2025

Copy link
Copy Markdown
Contributor

Fixes: #3649.

This PR implements support for the "List repository activities" REST API endpoint introduced in GitHub API v2022-11-28. This functionality allows go-github users to retrieve detailed activity information for repositories.

Implementation Details

  • Added RepositoryActivity struct to represent activity data returned by the API
  • Created ListRepositoryActivitiesOptions for pagination and filtering options (direction, before/after timestamps)
  • Implemented ListActivities method in the RepositoriesService
  • Added comprehensive tests for the new functionality
  • Updated documentation with usage examples

API Reference
This implementation follows the GitHub REST API specification documented at:
https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#list-repository-activities
Example Usage

opts := &github.ListRepositoryActivitiesOptions{
Direction: "desc",
After: "2023-01-01T00:00:00Z",
ListOptions: github.ListOptions{
Page: 1,
PerPage: 30,
},
}
activities, resp, err := client.Repositories.ListActivities(ctx, "owner", "repo", opts)

Testing

The implementation includes unit tests that verify:

  • Correct URL formatting and parameter handling
  • Proper deserialization of API responses
  • Edge cases (empty results, error handling)

Adds support for the /repos/{owner}/{repo}/activity REST API endpoint.
This implements the List Repository Activities functionality introduced
in GitHub API v2022-11-28, allowing clients to retrieve detailed
activity data for repositories.
Includes:
- New RepositoryActivity struct and related types
- ListRepositoryActivitiesOptions for pagination and filtering
- Implementation in RepositoriesService with tests
- Documentation with examples
Ref: google#3649
Signed-off-by: abhishek <abhishek@exaforce.com>

@gmlewisgmlewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @AbhishekAg.
Please address these items, then we should be ready for a second LGTM+Approval from any other contributor to this repo before merging.

Comment threadgithub/repos.go Outdated
Comment threadgithub/repos.go Outdated
Comment threadgithub/repos.go
@gmlewisgmlewis added the NeedsReview PR is awaiting a review before merging. label Jul 26, 2025
Signed-off-by: abhishek <abhishek@exaforce.com>
@AbhishekAg
AbhishekAg requested a review from gmlewisJuly 27, 2025 11:52
@codecov

codecovBot commented Jul 27, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.25%. Comparing base (9f2b91b) to head (a90671a).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@ Coverage Diff @@## master #3651 +/- ##
=======================================
Coverage 91.25% 91.25% =======================================
Files 184 184 Lines 16311 16327 +16 =======================================
+ Hits 14884 14900 +16 
Misses 1245 1245 Partials 182 182 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gmlewisgmlewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @AbhishekAg!
LGTM.

Awaiting second LGTM+Approval from any other contributor to this repo before merging.

@stevehipwell or @alexandear - might one of you have time for a code review? Thank you!

Comment threadopenapi_operations.yaml
Comment threadgithub/repos.go Outdated
Comment threadgithub/repos.go Outdated
Comment threadgithub/repos.go
Comment threadgithub/repos.go Outdated
Signed-off-by: abhishek <abhishek@exaforce.com>
@AbhishekAg

Copy link
Copy Markdown
ContributorAuthor

@alexandear Please review the PR when you get time.

Comment threadgithub/repos.go Outdated
Signed-off-by: abhishek <abhishek@exaforce.com>
@AbhishekAg

Copy link
Copy Markdown
ContributorAuthor

@gmlewis@alexandear Can you please push these changes to the protected branch? I am not allowed to perform the push.

@gmlewisgmlewis removed the NeedsReview PR is awaiting a review before merging. label Jul 29, 2025
@gmlewis

Copy link
Copy Markdown
Collaborator

Thank you, @alexandear!
Merging.

@gmlewis
gmlewis merged commit f46ce36 into google:masterJul 29, 2025
7 checks passed
jlaportebot added a commit to jlaportebot/go-github that referenced this pull request Jun 28, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement REST API Endpoint for List Repository Activities

3 participants

@AbhishekAg@gmlewis@alexandear