feat: Add agent tasks API support#4225
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4225 +/- ##
=======================================
Coverage 97.75% 97.75%
=======================================
Files 189 190 +1
Lines 19035 19132 +97
=======================================
+ Hits 18608 18703 +95
- Misses 231 232 +1
- Partials 196 197 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
gmlewis
left a comment
There was a problem hiding this comment.
Thank you, @danyalahmed1995!
Just a couple tweaks/questions, then we should be ready for a second LGTM+Approval from any other contributor to this repo before merging.
cc: @stevehipwell - @alexandear - @zyfy29 - @Not-Dhananjay-Mishra - @munlicode
Co-authored-by: Glenn Lewis <[email protected]>
|
@gmlewis Thanks, sounds good. I’ll address the review comments and push an update shortly. |
gmlewis
left a comment
There was a problem hiding this comment.
Thank you, @danyalahmed1995!
LGTM.
cc: @stevehipwell - @alexandear - @zyfy29 - @Not-Dhananjay-Mishra - @munlicode
stevehipwell
left a comment
There was a problem hiding this comment.
Thanks for the PR @danyalahmed1995, I've added a couple of comments.
Co-authored-by: Oleksandr Redko <[email protected]>
|
@stevehipwell @alexandear updated, thanks for the reviews. Changes in the latest update:
Validation:
|
|
|
||
| // ListByRepo lists tasks for a repository. | ||
| // | ||
| // GitHub API docs: https://docs.github.com/rest/agent-tasks/agent-tasks?apiVersion=2022-11-28#list-tasks-for-repository |
There was a problem hiding this comment.
It looks like the generator might be overwriting the API version?
There was a problem hiding this comment.
Oh yeah good catch it's possible. I’ll check whether the generator is rewriting those doc comment URLs and update the source of that version instead of just manually editing the generated comments.
Summary
Adds typed client support for GitHub's Agent Tasks REST API.
This implements the documented public-preview Agent Tasks endpoints:
GET /agents/repos/{owner}/{repo}/tasksPOST /agents/repos/{owner}/{repo}/tasksGET /agents/repos/{owner}/{repo}/tasks/{task_id}GET /agents/tasksGET /agents/tasks/{task_id}Closes #4213.
Changes
AgentTasksServiceand registered it onClient.Notes
The Agent Tasks API is currently in public preview, so this PR keeps the implementation scoped to the fields and endpoints currently documented by GitHub.
Validation
Ran the repository validation flow from
CONTRIBUTING.md:script/fmt.shscript/test.sh ./...script/lint.shscript/generate.shgit diff --checkscript/test.shwith the default race configuration could not run on this Windows machine becausecgo/gccwas not available. I reran the full test script with the non-race fallback across all modules, and it passed.