Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fine-grained personal access tokens not supported by multi-gitter #300

Closed
klieret opened this issue Nov 9, 2022 · 4 comments
Closed

Fine-grained personal access tokens not supported by multi-gitter #300

klieret opened this issue Nov 9, 2022 · 4 comments
Labels
blocked Blocked by external dependency bug Something isn't working

Comments

@klieret
Copy link

klieret commented Nov 9, 2022

Describe the bug
Multi-gitter does not seem to work with the fine-grained personal access tokens that are currently in beta

image

To Reproduce
Steps to reproduce the behavior:

  1. Create a fine-grained personal access token
  2. Run multi-gitter merge ....
  3. See error
$ multi-gitter merge -U klieret --branch "dependabot/github_actions/actions/upload-artifact-3" --merge-type squash  

Error: unexpected end of JSON input
Usage:
  multi-gitter merge [flags]

Flags:
  -g, --base-url string      Base URL of the GitHub API, needs to be changed if GitHub enterprise is used. Or the url to a self-hosted GitLab instance.
  -B, --branch string        The name of the branch where changes are committed. (default "multi-gitter-branch")
      --config string        Path of the config file.
      --fork                 Use pull requests made from forks instead of from the same repository.
      --fork-owner string    If set, use forks from the defined value instead of the logged in user.
  -G, --group strings        The name of a GitLab organization. All repositories in that group will be used.
  -h, --help                 help for merge
      --include-subgroups    Include GitLab subgroups when using the --group flag.
      --insecure             Insecure controls whether a client verifies the server certificate chain and host name. Used only for Bitbucket server.
      --log-file string      The file where all logs should be printed to. "-" means stdout. (default "-")
      --log-format string    The formating of the logs. Available values: text, json, json-pretty. (default "text")
  -L, --log-level string     The level of logging that should be made. Available values: trace, debug, info, error. (default "info")
      --merge-type strings   The type of merge that should be done (GitHub). Multiple types can be used as backup strategies if the first one is not allowed. (default [merge,squash,rebase])
  -O, --org strings          The name of a GitHub organization. All repositories in that organization will be used.
  -p, --platform string      The platform that is used. Available values: github, gitlab, gitea, bitbucket_server. (default "github")
  -P, --project strings      The name, including owner of a GitLab project in the format "ownerName/repoName".
  -R, --repo strings         The name, including owner of a GitHub repository in the format "ownerName/repoName".
      --ssh-auth             Use SSH cloning URL instead of HTTPS + token. This requires that a setup with ssh keys that have access to all repos and that the server is already in known_hosts.
  -T, --token string         The GitHub/GitLab personal access token. Can also be set using the GITHUB_TOKEN/GITLAB_TOKEN/GITEA_TOKEN/BITBUCKET_SERVER_TOKEN environment variable.
  -U, --user strings         The name of a user. All repositories owned by that user will be used.
  -u, --username string      The Bitbucket server username.

unexpected end of JSON input

Additional context

I double checked that I had copied the token correctly.
After switching back to a classical token, everything worked as expected.

@klieret klieret added the bug Something isn't working label Nov 9, 2022
@klieret klieret changed the title Fine-grained personal access tokens not yet supported Fine-grained personal access tokens not supported by multi-gitter Nov 9, 2022
@lindell
Copy link
Owner

lindell commented Nov 9, 2022

Could you also post the logs with --log-level=trace ?

What permissions did you give the token?

@lindell
Copy link
Owner

lindell commented Nov 10, 2022

I managed to run it as well. It seems that the error is

Personal access tokens with fine grained access do not support the GraphQL API

image

It seems that GraphQL support is coming. I will close the issue for now, but let's revisit check-in once GraphQL is supported.

@lindell lindell closed this as completed Nov 10, 2022
@lindell lindell added the blocked Blocked by external dependency label Nov 10, 2022
@lindell
Copy link
Owner

lindell commented Nov 10, 2022

For now, I've made this change #301, which will better show errors made through GraphQL such as permission denied.

@klieret
Copy link
Author

klieret commented Nov 10, 2022

Thanks @lindell, I really appreciate your work 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Blocked by external dependency bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants