Allows multiple issues or PRs to be edited in parallel, and querying for shared fields once to reduce network requests.
Co-authored-by: Sam Coe <samcoe@users.noreply.github.com>
- show path to config file
- display token prefix
- refine how missing scopes are shown
Co-authored-by: Sam Coe <samcoe@users.noreply.github.com>
Co-authored-by: Mislav Marohnić <mislav@github.com>
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
This enforces strict separation between serialization structs used for
repository creation payload with respect to whether GraphQL or REST was
used. Before, a field added to a GraphQL payload would leak to REST
payload (and vice versa).
We no longer guess the head repository using heuristics; instead, we
present the user with the choice of pushable repositories and an
additional option to create a new fork.
The new `pr create --head` flag is available for the user to specify the
head branch in `branch` or `owner:branch` format and completely skip any
forking or auto-pushing checks.
This commit is another isolation refactor, this time for repo fork.
However, I got fed up with the --remote="true|false|prompt" style of
flags and took this opportunity to switch to a set of bool flags:
--remote and --clone
--no-remote and --no-clone
the string args were really non standard and confusing; with only two
bools it was impossible to tell when to prompt.
First, consolidate the functionality between `pr merge` and `pr
checkout` that resolves the default branch name of the base repo. With
an added bonus, the new approach avoids an API request when one isn't
necessary.
Then, ensure that checking out 3rd-party PRs will result in local branch
name such as `<owner>/<branch>` when the head branch of the repository
matches the default branch of the base repository. We already have had
code in place to take care of this, but it only took effect in the `pr
checkout <number>`-style invocation.
This adds a thread-safe RoundTripper that can be used for mocking HTTP
requests in tests. Incoming requests are matched based on their
contents, not the order the stubs were registered in.