-
Notifications
You must be signed in to change notification settings - Fork 2.2k
feat: Add artifact and log retention period API support #3664
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
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 GitHub API support for setting artifact and log retention periods across repositories, organizations, and enterprises. This is part 1 of 4 APIs mentioned in issue #3660.
- Introduces new types
ArtifactPeriod
andArtifactPeriodOpt
for handling retention period data - Adds GET and PUT methods for each scope (repository, organization, enterprise) to retrieve and update retention settings
- Includes comprehensive test coverage for all new API methods
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
github/actions_artifacts.go | Defines new types ArtifactPeriod and ArtifactPeriodOpt for retention period data structures |
github/repos_actions_permissions.go | Adds repository-level GET/PUT methods for artifact and log retention periods |
github/actions_permissions_orgs.go | Adds organization-level GET/PUT methods for artifact and log retention periods |
github/actions_permissions_enterprise.go | Adds enterprise-level GET/PUT methods for artifact and log retention periods |
github/repos_actions_permissions_test.go | Test coverage for repository-level retention period methods |
github/actions_permissions_orgs_test.go | Test coverage for organization-level retention period methods |
github/actions_permissions_enterprise_test.go | Test coverage for enterprise-level retention period methods |
github/github-accessors.go | Generated getter methods for the new types |
github/github-accessors_test.go | Generated tests for the accessor methods |
github/github-stringify_test.go | Test for the String() method implementation |
I got a little confused by the namespaces of the client. For example: go-github/github/orgs_actions_permissions.go Lines 12 to 22 in d08bec9
The "get (as well as edit) actions permissions" api for organizations is defined at If I'm correct, I'll then open new prs to implement the rest of 3 apis. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3664 +/- ##
==========================================
+ Coverage 91.20% 91.23% +0.03%
==========================================
Files 185 185
Lines 16360 16421 +61
==========================================
+ Hits 14921 14982 +61
Misses 1254 1254
Partials 185 185 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Thank you, @zyfy29!
Just a couple godoc comments needed, otherwise LGTM.
After providing those, we should be ready for a second LGTM+Approval from any other contributor to this repo before merging.
Thank you for the review, fixed. |
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.
Thank you, @zyfy29!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.
@alexandear or @stevehipwell - might one of you have time for a code review? Thank you!
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.
LGTM
Thank you, @stevehipwell! |
1 of 4 apis in #3660
The "Setting artifact and log retention periods" api for each of repos, organizations and enterprises.