Commit graph

5685 commits

Author SHA1 Message Date
Benjamin Levesque
a69f7a6b53
simplify exporter usage 2025-09-13 22:14:59 +02:00
Benjamin Levesque
5abb467e69
remove includeScope 2025-09-13 21:50:06 +02:00
Benjamin Levesque
54bf8432f6
do not mutate opts.ShowToken 2025-09-13 21:35:02 +02:00
Benjamin Levesque
60088e0e7d
move displayToken to String method 2025-09-13 21:30:20 +02:00
Benjamin Levesque
b38e12ef61
move flag validation to RunE 2025-09-13 21:30:19 +02: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
10e4abc515
refactor(pr/shared): rename rest to tail
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-11 09:04:17 +01: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
2311a04688
fix(pr/shared): ensure ParseURL regexp is backward-compatible
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-10 19:07:52 +01: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
Babak K. Shandiz
78b09e55e5
fix(pr/shared): add rest return value to ParseURL
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
6b19a85471
Merge pull request #11638 from cli/babakks/use-advanced-issue-search
Use advanced issue search
2025-09-08 20:32:22 +01:00
Babak K. Shandiz
37896d613a
fix(featuredetection): remove redundant AdvancedIssueSearchWebInIssuesTab field
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-08 18:46:28 +01:00
Babak K. Shandiz
2c08f20c33
docs(search prs): mention advanced issue search syntax support
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-08 18:37:37 +01:00
Babak K. Shandiz
cc60d9c3fa
docs(search issues): mention advanced issue search syntax support
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-08 18:37:17 +01:00
Babak K. Shandiz
02dc03c8e2
docs(pr list): mention advanced issue search syntax support
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-08 18:36:46 +01:00
Babak K. Shandiz
02ee337818
docs(issue list): mention advanced issue search syntax support
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-08 18:36:24 +01:00
Babak K. Shandiz
ef69901f05
refactor(search): rename Query.String to StandardSearchString
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-08 16:04:47 +01:00
Babak K. Shandiz
efddea720f
test(search): improve test cases
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-08 15:45:20 +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