Commit graph

5446 commits

Author SHA1 Message Date
Kynan Ware
79796d2dc5
Merge pull request #12787 from ManManavadaria/fix-12726/item-edit-draft-issue-partial-update
fix: `gh project item-edit` error when editing Draft Issue with only one (title/body) flag
2026-03-02 12:19:53 -07:00
Kynan Ware
1957a022b6
Merge pull request #12652 from VishnuVV27/fix-issue-view-comments-redundancy
Fix redundant API call in gh issue view --comments (#12606)
2026-03-02 10:58:41 -07:00
Louis Shawn
5194256928 fix(issue list): reject pull request-only search qualifiers 2026-03-02 10:50:15 -07:00
Kynan Ware
1c36686a61
Merge branch 'trunk' into 2722-fix-fork-remote-flag 2026-03-02 10:22:27 -07:00
Kynan Ware
0f5355e8b4
Merge pull request #12781 from itchyny/api-compile-json-content
Use pre-compiled regexp for matching Content-Type
2026-03-02 10:16:37 -07:00
Devraj Mehta
351df5b9d1
Set COPILOT_GH env var when launching Copilot CLI
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-02 10:25:47 -05:00
gunadhya
ee8014a4d9 Simplify progress indicators in issue develop 2026-03-02 17:01:57 +05:30
Max Beizer
d908af3484 Emit null for zero createdAt/updatedAt values
Consistent with completedAt handling. Addresses Copilot review feedback
from companion PR #12807.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-01 10:18:37 -06:00
Max Beizer
0d05a8acca Address Copilot review feedback
- Prioritize --json output over --log/--follow so JSON is not silently ignored
- Emit null for zero createdAt/updatedAt values, consistent with completedAt

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-01 10:18:21 -06:00
Max Beizer
ceb8cf2561 Polish --json support for agent-task view
- Rename 'status' field to 'state' for consistency with struct and UI
- Add missing JSON fields: completedAt, user, pullRequestTitle, pullRequestState
- Add test for nil PullRequest with --json
- Expand existing JSON test to cover new fields

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-01 09:09:08 -06:00
Max Beizer
c5c107aa8b Polish --json support for agent-task list
- Fix empty results returning error instead of [] when --json is used
- Rename 'status' field to 'state' for consistency with struct and UI
- Add missing JSON fields: completedAt, user, pullRequestTitle, pullRequestState
- Add test for empty results with --json
- Add test for nil PullRequest with --json

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-01 09:08:18 -06:00
Max Beizer
250d5a850a Fix gofmt alignment in view_test.go
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-01 08:57:53 -06:00
Takeshi
01c83acfe8 Add --duplicate-of flag and duplicate reason to gh issue close
Support closing issues as duplicates via --reason duplicate and
--duplicate-of <issue> flags. The --duplicate-of flag accepts an issue
number or URL, validates it references a different issue (not a PR),
and passes the duplicate issue ID to the closeIssue mutation.

Feature detection checks whether the GHES instance supports the
DUPLICATE enum value in IssueClosedStateReason before using it.
2026-02-28 20:10:07 -05:00
Max Beizer
7241b42ecf Add --json support to gh agent-task view
Add --json, --jq, and --template flags to `gh agent-task view`,
consistent with the pattern used by `gh pr view --json`,
`gh issue view --json`, etc.

This reuses the same ExportData interface and SessionFields defined
for list, applying them to the single-session view output.

Closes https://github.com/cli/cli/issues/12805 (partial)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-28 09:22:28 -06:00
Max Beizer
0d9e6af3da Add --json support to gh agent-task list
Add --json, --jq, and --template flags to `gh agent-task list`,
consistent with the pattern used by `gh pr list --json`,
`gh issue list --json`, etc.

This implements the ExportData interface on capi.Session and defines
SessionFields for the available JSON fields:
id, name, status, repository, createdAt, updatedAt,
pullRequestNumber, pullRequestUrl.

Closes https://github.com/cli/cli/issues/12805 (partial)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-28 09:20:13 -06:00
ManManavadaria
d21544c085 fix(project/item-edit): preserve title/body when editing draft issue with partial flags 2026-02-26 16:23:37 +05:30
itchyny
6057bfadbf Use pre-compiled regexp for matching Content-Type 2026-02-25 19:43:45 +09:00
William Martin
4dd50cf60c Fix project mutation query variable usage
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-23 07:13:07 -07:00
Babak K. Shandiz
4681b40e70
fix(agent-task/capi): fix capi API version
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2026-02-20 18:04:12 +00:00
Kynan Ware
48951aca01 Fix invalid ANSI SGR escape code in JSON and diff colorization
Replace `1;38` with `1;37` (bold white) in the delimiter/header
color constant. SGR parameter 38 is the extended foreground color
prefix and requires sub-parameters (e.g. `38;5;n` or `38;2;r;g;b`),
so using it bare produces an invalid escape sequence. Most terminals
silently ignore the malformed parameter, masking the bug.

Fixes cli/cli#12683

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-18 17:52:01 -07:00
William Martin
7ea88b1c4d
Bundle licenses at release time (#12625)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-02-18 17:59:27 +01:00
William Martin
ccfe693c46 Rename query for clarity 2026-02-18 17:34:42 +01:00
William Martin
f55656ca67 Remove pointer comments 2026-02-18 17:25:56 +01:00
William Martin
f8d855f502 Simplify error message 2026-02-18 17:25:56 +01:00
William Martin
aeeb8a3d93 Remove DTO concept 2026-02-18 17:25:56 +01:00
William Martin
8dcfd330e7
Add --query flag to project item-list (#12696)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Babak K. Shandiz <babakks@github.com>
2026-02-18 16:34:13 +01:00
Kynan Ware
8ed2fc913c Clarify --clobber flag deletes assets before re-uploading
Update the help text and flag description for `gh release upload --clobber`
to make it clear that existing assets are deleted before new ones are uploaded,
and that original assets will be lost if the upload fails.

Fixes #8822

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-17 18:11:57 -07:00
Babak K. Shandiz
027adc7bf5
Merge pull request #12695 from cli/babakks/retrieve-workflow-dispatch-run-id
feat(workflow run): retrieve workflow dispatch run details
2026-02-17 20:37:53 +00:00
Kynan Ware
3af535902d Add usage examples to gh gist edit command
Add a cobra Example string to the gist edit command showing common
operations: interactive selection, editing in default editor, editing a
specific file, replacing file content, adding/removing files, and
changing the description.

Closes #8943

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-17 12:38:15 -07:00
Babak K. Shandiz
31f3756089
fix(workflow run): bail out on feature detection error
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2026-02-17 11:48:25 +00:00
Babak K. Shandiz
ce016217d0
docs(workflow run): improve help docs
Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>
2026-02-16 22:49:42 +00:00
Babak K. Shandiz
c47a10e583
docs(workflow run): add cleanup marker with explanation on future changes
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2026-02-16 22:02:18 +00:00
Babak K. Shandiz
36a85fd71f
fix(workflow run): apply url.PathEscape when compiling URL
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2026-02-16 21:55:25 +00:00
Babak K. Shandiz
3e9fbbb2fa
refactor(workflow run): remove temp out
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2026-02-16 21:53:17 +00:00
Kynan Ware
9de48154de Add missing TODO comments for featuredetection if-statements
Add greppable TODO identifiers above all if-statements that reference
featuredetection struct fields, as required by the featuredetection
linter. This ensures every feature detection branch is tagged for
future cleanup when GHES gains support.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-16 14:24:32 -07:00
Babak K. Shandiz
bf2ff7c39b
test(workflow run): verify retrieval of workflow run details
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2026-02-16 12:57:01 +00:00
Babak K. Shandiz
e73bf113dd
feat(workflow run): retrieve workflow run if supported by the API
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2026-02-16 12:56:01 +00:00
4RH1T3CT0R7
fa95f3a21b Add --no-upstream flag to gh repo clone
When cloning a forked repository, `gh repo clone` automatically adds the
parent repo as an `upstream` remote and sets it as the default repository.
This can be problematic when the user lacks access to the parent repo,
the upstream fetch is expensive for large repos, or the user simply
doesn't want the upstream remote.

Add a `--no-upstream` flag that skips adding the upstream remote when
cloning a fork. When used, origin (the fork) is set as the default
repository instead. The flag is mutually exclusive with
`--upstream-remote-name`. For non-fork repos the flag is a harmless
no-op.

Closes #8274
2026-02-14 20:31:02 +03:00
William Martin
166db75d36 pin REST API version to 2022-11-28
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-13 19:46:16 +01:00
William Martin
24964681a8 Respect --exit-status with --log and --log-failed
Fixes #12674
2026-02-13 16:04:06 +01:00
William Martin
2b5c3b5ecb document fork default branch behavior 2026-02-13 15:36:37 +01:00
William Martin
7448aed8ab fork default branch only in pr create 2026-02-12 16:56:14 +01:00
Kynan Ware
1d730951d2 Use org/slug format in test fixtures and remove /slug normalization 2026-02-11 14:51:12 -07:00
Kynan Ware
1cb776384e Normalize /slug team shorthand to org/slug and fix docs 2026-02-11 14:33:13 -07:00
Kynan Ware
e361335e5c Skip reviewer metadata fetch when using search-based selection 2026-02-11 13:18:39 -07:00
Kynan Ware
38661646ee Update test assertions to expect org/slug team format 2026-02-11 13:18:07 -07:00
Kynan Ware
1209b24e69 Partition bot reviewers separately for RequestReviewsByLogin 2026-02-11 13:16:03 -07:00
Kynan Ware
db167d3116 Preserve org/slug format for team reviewer slugs 2026-02-11 13:15:14 -07:00
Kynan Ware
cf08f4d51e
Apply suggestion from @BagToad 2026-02-10 11:08:12 -07:00
Kynan Ware
7373de3e70
Remove redundant comment 2026-02-10 10:58:23 -07:00