Consistent with completedAt handling. Addresses Copilot review feedback
from companion PR #12807.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- 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>
- 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>
- 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>
Add the changeType field from the PullRequestChangedFile GraphQL type
to the PullRequestFile struct. This exposes the file status (added,
modified, deleted, renamed, copied, changed) in gh pr list --json files
and gh pr view --json files output.
Closes#11385
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.
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>
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>
The assignees query fragment only requested id, login, and name but the
GitHubUser struct includes a DatabaseID field. Since the field was never
requested from the API, it always defaulted to Go's zero value (0) in
JSON output. This adds databaseId to the fragment so the actual value is
returned.
Also adds ExportData test cases for assignees on both Issue and
PullRequest to verify databaseId round-trips correctly through JSON
serialization.
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.
Fixescli/cli#12683
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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>
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>