- Supports passing a PR as argument, not just issues
- Makes it non-fatal when project cards were not able to load
- Cleans up legacy method for fetching issues
- `issue reopen` no longer fetches all issue fields and thus avoids the
problem when loading failed due to token not having access to projects
- `issue reopen` now accepts either issue or pull number as argument.
- `issue close` no longer fetches all issue fields and thus avoids the
problem when loading failed due to token not having access to projects
- `issue close` now accepts either issue or pull number as argument.
- `issue comment` no longer fetches all issue fields and thus avoids the
problem when loading failed due to token not having access to projects
- `issue comment` now accepts either issue or pull number as argument.
If a 4xx server response lists scopes in the X-Accepted-Oauth-Scopes
header that are not present in the X-Oauth-Scopes header, the final
error messaging on stderr will now include a hint for the user that they
might need to request the additional scope:
$ gh codespace list
error getting codespaces: HTTP 403: Must have admin rights to Repository. (https://api.github.com/user/codespaces?per_page=30)
This API operation needs the "codespace" scope. To request it, run: gh auth refresh -h github.com -s codespace
The "path" field of a GraphQL error object contains a mix of strings and
numbers and cannot be deserialized into `[]string`. Fortunately, we
don't need to rely on the "path" field and instead have the final error
message be constructed by aggregating human-readable "message" fields.
This was a regression in how `statusCheckRollup` is queried and stored.
As a result, `gh pr status` did not include rendered information about
checks related to each pull request. This switches the query builder to
`PullRequestGraphQL()` to eliminate the outdated query.
1. The `--json` export now only renders the `login` field for User types
and `name` and `slug` fields for Team types.
2. The `pr view` command now renders team reviewers in the format of
`ORG/SLUG` instead of the team name. This is so that the same value
can be used in the `pr create -r` flag.
This avoids loading authorship information for git commits, since it
relies on a GraphQL API that wasn't available before GHE v3.0. The
authorship information wasn't necessary for the merge operation anyway;
just loading the last commit OID was.
This completely rewrites the PR lookup mechanism so that the caller
must specify the GraphQL fields to query for each PR. Additionally, this
fixes some export problems with `pr view --json`.
Features:
- Each pr command now gets assigned a concept of a Finder. This makes it
easier to stub the PR in tests without having to stub the underlying
HTTP calls or git invocations.
- `pr view --web` is much faster since it only fetches the "url" field.
- `pr diff 123` now skips a whole API call where a whole PR was
unnecessarily preloaded just to access its diff in a subsequent call.
- PullRequestGraphQL query builder is now used to construct queries.
- A bunch of individual commands are now freed of having to know about
concepts such as BaseRepo, Branch, Config, or Remotes.