Skip to content

feat: Add Agents secrets API - #4533

Open
adamcrews wants to merge 1 commit into
google:masterfrom
adamcrews:feat/agents-secrets
Open

feat: Add Agents secrets API#4533
adamcrews wants to merge 1 commit into
google:masterfrom
adamcrews:feat/agents-secrets

Conversation

@adamcrews

Copy link
Copy Markdown

Summary

Adds AgentsService with repository and organization secret support (public key, list/get/create-or-update/delete secrets, and selected-repository management), modeled on the existing ActionsService secrets client.

The Agents endpoints are only served by the 2026-03-10 API version, so each request sends it explicitly via WithVersion. openapi_operations.yaml pins the documentation links for these operations through operation_overrides, scoped only to the new Agents operations — the rest of the client stays on 2022-11-28.

GitHub API docs: https://docs.github.com/rest/agents/secrets

Testing

gofmt, go vet, go generate ./..., and go test ./... all pass.

AI assistance disclosure

Cursor was used to draft the implementation & tests, but all code has been human reviewed and used locally to configure our github org.

Add AgentsService with the repository and organization secret methods,
selected-repository management, and generated list iterators, modeled on
the Actions secrets client.

The Agents endpoints are only served by the 2026-03-10 API version, so
each request sends it with WithVersion and openapi_operations.yaml pins
the documentation links through operation_overrides. Both are scoped to
the new Agents operations, leaving the rest of the client on 2022-11-28.
@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label Sep 9, 2026
@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.55%. Comparing base (4340312) to head (dc1abb4).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4533      +/-   ##
==========================================
+ Coverage   98.53%   98.55%   +0.01%     
==========================================
  Files         195      196       +1     
  Lines       17851    18045     +194     
==========================================
+ Hits        17590    17784     +194     
  Misses        261      261              

☔ View full report in Codecov by Harness.
📢 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.

@gmlewis gmlewis 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, @adamcrews!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.

cc: @stevehipwell - @alexandear - @Not-Dhananjay-Mishra

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NeedsReview PR is awaiting a review before merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants