Commit graph

5130 commits

Author SHA1 Message Date
Babak K. Shandiz
d06d0262e6
fix(agent-task view): use lower limit for fetching sessions
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-08 13:51:14 +01:00
Babak K. Shandiz
c1beeb5d53
fix(agent-task view): use CapiClient.GetPullRequestDatabaseID
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-08 13:50:47 +01:00
Babak K. Shandiz
f8f7b0e09b
fix(agent-task/capi): add GetPullRequestDatabaseID to CapiClient interface
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-08 13:50:09 +01:00
Babak K. Shandiz
abd2d8a06d
test(agent-task/capi): add tests for GetPullRequestDatabaseID
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-08 13:49:27 +01:00
Babak K. Shandiz
f57114accc
feat(agent-task/capi): add GetPullRequestDatabaseID method
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-08 13:48:56 +01:00
Babak K. Shandiz
d80b25fbf2
test(agent-task/capi): add tests for GetSessionByResourceID
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-08 11:27:40 +01:00
Babak K. Shandiz
8482e3d2a4
feat(agent-task view): support PR arg
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-05 17:03:59 +01:00
Babak K. Shandiz
e68e28ddf3
fix(agent-task/shared): add SessionSymbol func
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-05 17:02:45 +01:00
Babak K. Shandiz
09e1f2532d
test(agent-task/shared): add test for IsSessionID
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-05 17:02:15 +01:00
Babak K. Shandiz
5f6189be09
fix(agent-task/shared): add IsSessionID
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-05 16:58:25 +01:00
Babak K. Shandiz
a769175019
test(pr/shared): add test for ParseFullReference
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-05 16:57:44 +01:00
Babak K. Shandiz
fd11b1e8de
fix(pr/shared): add ParseFullReference func
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-05 16:57:21 +01:00
Babak K. Shandiz
9b2ecf4c0e
feat(agent-task/capi): add ListSessionsByResourceID method to CapiClient interface
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-05 16:55:46 +01:00
Babak K. Shandiz
a6dd9c1679
feat(agent-task/capi): add ListSessionsByResourceID
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-05 16:55:04 +01:00
Babak K. Shandiz
d3fa0a70bc
test(agent-task view): add tests for the view command
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-05 12:55:15 +01:00
Babak K. Shandiz
92c7a56b82
feat(agent-task view): add view command
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-05 12:45:51 +01:00
Babak K. Shandiz
476b636810
test(agent-task list): remove unused stubs
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-05 12:44:22 +01:00
Babak K. Shandiz
87b772dc83
feat(agent-task/capi): add GetSession method to CapiClient interface
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-05 12:44:21 +01:00
Babak K. Shandiz
ee8fc06077
test(agent-task/capi): add tests for GetSession
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-05 12:44:21 +01:00
Babak K. Shandiz
dcadeb75d4
feat(agent-task/capi): add GetSession method
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-05 12:44:21 +01:00
Babak K. Shandiz
4e1fcf1da9
refactor(agent-task/capi): populate PRs IsDraft
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-05 12:44:20 +01:00
Babak K. Shandiz
1e36e9f1e3
refactor(agent-task/capi): hydrate user data
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-05 12:44:11 +01:00
Babak K. Shandiz
004be9da20
test(agent-task create): quote file paths to pass CI on Windows
To keep the backslashes in Windows file paths and stop `shlex.Split`
from interpreting them as escape characters, we need to quote the paths.

Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-05 09:28:52 +01:00
Babak K. Shandiz
7824b43f8a
refactor(agent-task list): simplify cmd initialisation
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-04 21:06:38 +01:00
Babak K. Shandiz
844c0ab56e
refactor(agent-task create): remove redundant if
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-04 21:06:15 +01:00
Babak K. Shandiz
07ec8c629d
test(agent-task create): use CapiClientMock
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-04 21:01:56 +01:00
Babak K. Shandiz
28bb0f62bb
fix(agent-task create): simplify command initialisation
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-04 20:59:33 +01:00
Babak K. Shandiz
d17fdb3e8c
test(agent-task list): update TestNewCmdCreate
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-04 20:19:35 +01:00
Babak K. Shandiz
b0ac06e4f4
fix(agent-task create): allow no positional arg
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-04 20:17:43 +01:00
Babak K. Shandiz
3762d97894
test(agent-task list): apply test args anyway
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-04 20:12:57 +01:00
Babak K. Shandiz
c708e58f69
test(agent-task list): use CapiClientMock
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-04 20:12:57 +01:00
Babak K. Shandiz
27d9a0d5fc
test(agent-task list): update TestNewCmdList
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-04 20:12:57 +01:00
Babak K. Shandiz
19e17c54fd
refactor(agent-task/capi): drop embedding of unexported struct
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-04 20:12:56 +01:00
Babak K. Shandiz
585b639273
test(agent-task/capi): add CapiClientMock
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-04 20:12:56 +01:00
Babak K. Shandiz
ab99ee530a
test(agent-task/capi): add go:generate directive to gen mock
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-04 20:12:56 +01:00
Babak K. Shandiz
be8e6f6491
test(agent-task/capi): add tests for job-related methods
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-04 20:12:55 +01:00
Babak K. Shandiz
79602d3334
test(agent-task/capi): add tests for session-related methods
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-04 20:12:55 +01:00
Babak K. Shandiz
0f5fd6ece0
fix(agent-task/capi): handle non-JSON error response
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-04 20:12:54 +01:00
Babak K. Shandiz
77bb72c2d4
fix(agent-task/capi): improve returned errs
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-04 20:12:54 +01:00
Babak K. Shandiz
0138bf3dab
refactor(agent-task/capi): improve pagination
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-04 20:12:54 +01:00
Babak K. Shandiz
f3c3797d5c
refactor(agent-task list): use shared CapiClientFunc
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-04 20:12:53 +01:00
Babak K. Shandiz
107edc3dd6
fix(agent-task/shared): add CapiClientFunc helper
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-04 20:12:50 +01:00
Kynan Ware
28a7daee40 Improve agent-task create command help text
Expanded usage examples in the command help to clarify reading from stdin and selecting a base branch. Updated flag descriptions for --from-file and --base to provide clearer guidance to users.
2025-09-04 11:13:21 -06:00
Kynan Ware
3c3b5669f1 Refactor test case struct in create_test.go
Replaces custom 'tc' type with an inline struct for test cases in TestNewCmdCreate_Args, simplifying the test code structure.
2025-09-03 17:35:17 -06:00
Kynan Ware
b2f506fd50 Add base branch option to agent task creation
Introduces a BaseBranch field to CreateOptions and updates the job creation flow to include the base branch in the payload if specified. The CapiClient and related methods are updated to accept and handle the baseBranch parameter, and tests are added to verify correct behavior when a base branch is provided.
2025-09-03 17:33:38 -06:00
Kynan Ware
8af1787b31 Support reading task description from stdin
Refactored file reading in agent-task create command to use cmdutil.ReadFile, allowing input from stdin. Updated tests to cover reading file content from stdin and improved test setup for file and stdin input cases.
2025-09-03 15:52:45 -06:00
Kynan Ware
9dfe89fe50 Increase backoff timing for agent task creation
Extended the max elapsed time and max interval for the exponential backoff strategy in agent task creation to improve reliability during retries.
2025-09-03 15:29:47 -06:00
Kynan Ware
b94ffe90c4 Add file input support to agent-task create command
The agent-task create command now accepts a task description from a file using the -F/--from-file flag, with mutual exclusivity enforced between inline and file input. Tests were updated to cover new input scenarios and error cases, and usage examples were added to the command help.
2025-09-03 15:29:47 -06:00
Kynan Ware
6a50ecb880
Merge pull request #11653 from cli/1013-gh-agent-task-create-creates-a-new-agent-task-and-responds-with-pr-url
Introduce `gh agent-task create`
2025-09-03 14:33:17 -06:00
Kynan Ware
a821b408d4 Update error messages and test repo handling in agent-task create
Replaces 'problem statement' with 'task description' in error messages for clarity. Refactors tests to use a BaseRepo function instead of direct repo objects, and adds a test for missing task description error.
2025-09-03 14:25:38 -06:00