Commit graph

229 commits

Author SHA1 Message Date
Babak K. Shandiz
1ccbb0af83 feat(agent-task view): add --log and --follow flags
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-15 10:13:55 -06:00
Babak K. Shandiz
05e609c5b3 fix(agent-task/shared): add log renderer
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-15 10:13:55 -06:00
Babak K. Shandiz
fbcdeed41f feat(agent-task/capi): add GetSessionLogs method
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-15 10:13:55 -06:00
Kynan Ware
48cf448622
Merge pull request #11708 from cli/kw/edit-file-and-prompt-for-confirmation-interactively
`gh agent task create`: Allow interactively editing task description file and add confirmation prompt
2025-09-11 11:44:39 -06:00
Kynan Ware
3831380d13 Add error type assertion to createRun tests
Introduces a new 'wantErrIs' field to test cases in Test_createRun to assert specific error types using require.ErrorIs. This enhances test coverage by verifying not only error messages but also error types.
2025-09-11 11:23:18 -06:00
Kynan Ware
1dbb694790 Add test for non-interactive problem statement input
Adds a test case to ensure that when a problem statement is provided as an argument non-interactively, the command does not prompt or return an error, and the correct job is created.
2025-09-11 09:24:42 -06:00
Kynan Ware
f22dc9271b Update test to use edited task description
Modified the test in create_test.go to return and expect 'edited task description' instead of concatenating the prompt string. This clarifies the test's intent and expected behavior for the MarkdownEditorFunc and CreateJobFunc.
2025-09-11 09:22:27 -06:00
Kynan Ware
666f5574e4 Remove unused stdin field from create command tests
The 'stdin' field and related code were removed from TestNewCmdCreate as they were no longer used. This simplifies the test structure and eliminates unnecessary code.
2025-09-11 09:20:48 -06:00
Kynan Ware
872cf495c2 Refactor create command tests and add base branch case
Removed redundant test cases for file input and stdin in TestNewCmdCreate, and added a new test to verify that the base branch argument sets the BaseBranch field correctly.
2025-09-11 09:19:52 -06:00
Babak K. Shandiz
1c37ab9453
refactor(agent-task/shared): enhance symbol names
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-11 09:03:36 +01:00
Kynan Ware
deee0c61ed Update command examples for agent-task create
Improves the help text for the 'gh agent-task create' command by clarifying the editor usage example and adding an example for using a file as a template.
2025-09-10 18:39:35 -06:00
Kynan Ware
c0a5b9aced Refactor agent-task create to improve file input handling
Moves file reading for the problem statement from argument parsing to execution, storing the file path in CreateOptions. Updates error handling and user prompts to better distinguish between interactive and non-interactive modes. Refactors and expands tests to match the new logic and improve coverage for file and prompt scenarios.
2025-09-10 18:19:12 -06:00
Babak K. Shandiz
b079ea82e5
refactor(agent-task/shared): extract uuid pattern
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-10 19:07:03 +01:00
Babak K. Shandiz
6b872923ea
refactor(agent-task view): rename resourceID to prID
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-10 18:57:58 +01:00
Babak K. Shandiz
3798d98969
feat(agent-task view): support PR /agent-sessions/* URL as argument
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-10 18:57:58 +01:00
Babak K. Shandiz
7e21837f3d
fix(agent-task/shared): add ParsePullRequestAgentSessionURL
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-10 18:57:57 +01:00
Kynan Ware
20c89043bb
Merge pull request #11704 from cli/babakks/add-web-flag-to-view-cmd
`gh agent-task view`: add `--web` flag
2025-09-10 11:54:59 -06:00
Babak K. Shandiz
6a5481368f
docs(agent-task view): improve --help docs
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-10 13:53:45 +01:00
Babak K. Shandiz
4cebd35791
refactor(agent-task create): assign Config at instantiation
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-10 12:48:31 +01:00
Babak K. Shandiz
b463395d48
fix(agent-task create): only prompt for problem statement if not provided
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-10 12:45:34 +01:00
Babak K. Shandiz
88e2d0d7d9
fix(agent-task view): stop progress indicator before opening browser
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-10 11:41:49 +01:00
Babak K. Shandiz
b3b8697cf3
test(agent-task view): enhance naming and stubs
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-10 11:05:29 +01:00
Babak K. Shandiz
ecbad7ecb9
test(agent-task view): add --web mode tests
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-10 11:05:29 +01:00
Babak K. Shandiz
57d9f1ff0e
feat(agent-task view): add --web mode
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-10 11:05:29 +01:00
Babak K. Shandiz
ab7e4039da
refactor: move Copilot Agents home URL to capi
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-10 11:05:28 +01:00
Babak K. Shandiz
6b29c2905c
fix(agent-task/capi): also return PR URL from GetPullRequestDatabaseID
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-10 11:05:28 +01:00
Kynan Ware
6945fc0183 Still prompt for task desc with -F 2025-09-09 17:08:04 -06:00
Kynan Ware
563809362b Add interactive prompt for task description in agent-task create
Enhances the agent-task create command to prompt users for a task description interactively if none is provided and the terminal supports prompting. Updates tests to cover interactive and non-interactive scenarios, including error handling for empty input and prompt failures.
2025-09-09 16:19:52 -06:00
Kynan Ware
1f107cec4f Fix default value in session selection prompt
Updated the call to Prompter.Select to use an empty string as the default value instead of options[0], ensuring no session is preselected by default.
2025-09-09 16:15:10 -06:00
Kynan Ware
bbf7586578 Show session name instead of ID in agent-task list
Updated the agent-task list command to display the session name instead of the session ID in the table output and header. Adjusted tests to reflect this change by using the Name field for display and updating expected outputs accordingly.
2025-09-09 11:06:53 -06:00
Babak K. Shandiz
ec8f412cca
docs(agent-task view): explain test case rationale
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-09 12:24:09 +01:00
Babak K. Shandiz
f8ff42a3f1
docs(agent-task view): explain when condition is met
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-09 12:22:21 +01:00
Babak K. Shandiz
8b1f722911
docs(agent-task/capi): remove redundant comment
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-09 12:09:34 +01:00
Babak K. Shandiz
0a9a4a4250
test(agent-task/capi): fix test case args
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-09 11:37:49 +01:00
Babak K. Shandiz
d52502b638
fix(agent-task/capi): skip unpopulated resource ID when hydrating
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-09 11:37:28 +01:00
Babak K. Shandiz
922843301d
docs(agent-task/shared): add godoc to SessionStateString
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-09 10:57:51 +01:00
Babak K. Shandiz
6e78b8d68f
test(agent-task view): update tests
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-08 13:51:38 +01:00
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
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