Skip to content

feat: Add Agents secrets API - #4533

Merged
gmlewis merged 3 commits into
google:masterfrom
adamcrews:feat/agents-secrets
Sep 11, 2026
Merged

feat: Add Agents secrets API#4533
gmlewis merged 3 commits into
google:masterfrom
adamcrews:feat/agents-secrets

Conversation

@adamcrews

Copy link
Copy Markdown
Contributor

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.56%. Comparing base (4340312) to head (b417461).
⚠️ Report is 8 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4533      +/-   ##
==========================================
+ Coverage   98.53%   98.56%   +0.02%     
==========================================
  Files         195      197       +2     
  Lines       17851    18172     +321     
==========================================
+ Hits        17590    17911     +321     
  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

Comment thread github/agents_secrets.go
Comment thread github/agents_secrets.go
Comment thread github/agents_secrets_test.go Outdated
Comment thread github/agents_secrets_test.go Outdated
Comment thread github/agents_secrets_test.go Outdated
Comment thread github/agents_secrets_test.go Outdated
Use referenceTimeStr/referenceTimestamp and pass input directly to
testJSONBody for create-or-update secret assertions.
Add id, url, title, and created_at to the shared PublicKey type used by
Actions, Agents, Codespaces, Dependabot, and private registries, with
field docs and updated unmarshaling/tests.

@Not-Dhananjay-Mishra Not-Dhananjay-Mishra left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@gmlewis

gmlewis commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Thank you, @Not-Dhananjay-Mishra!
Merging.

@gmlewis gmlewis removed the NeedsReview PR is awaiting a review before merging. label Sep 11, 2026
@gmlewis
gmlewis merged commit 5af93d1 into google:master Sep 11, 2026
15 checks passed
Sign up for free to 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.

3 participants