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

Typos in dev-repo produces some surprising behaviour #426

Open
kit-ty-kate opened this issue Jan 11, 2022 · 7 comments
Open

Typos in dev-repo produces some surprising behaviour #426

kit-ty-kate opened this issue Jan 11, 2022 · 7 comments

Comments

@kit-ty-kate
Copy link
Contributor

kit-ty-kate commented Jan 11, 2022

$ dune-release
[...]
[-] Publishing to github
Username for 'https://github.com': kit-ty-kate
Password for 'https://kit-ty-kate@github.com':
dune-release: [ERROR] Exit code 128 from command
    `git --git-dir .git ls-remote --quiet --tags
       https://github.com/kit-ty-kate/opam-docker-hub.git v0.1.0`:
  remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
  remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
  fatal: Authentication failed for 'https://github.com/kit-ty-kate/opam-docker-hub.git/'

$ ls ~/.config/dune/
github.token	release.yml

$ cat ~/.config/dune/release.yml
remote: git@github.com:kit-ty-kate/opam-repository.git
local: /Users/kit_ty_kate/.config/dune/opam-repository

$ git remote show origin
* remote origin
  Fetch URL: git@github.com:kit-ty-kate/ocaml-docker-hub.git
  Push  URL: git@github.com:kit-ty-kate/ocaml-docker-hub.git
[...]
@NathanReb
Copy link
Contributor

Is the repo private? This looks like it is hence the reason why you're asked a password for ls-remote. I think atm it's safe to say dune-release does not support private repos release.

If the repo is public it's a different matter but I'm a bit suprised then. You shouldn't need to authenticate to ls-remote on a public repo.

@kit-ty-kate
Copy link
Contributor Author

It is a public repository: https://github.com/kit-ty-kate/ocaml-docker-hub/

@NathanReb
Copy link
Contributor

This is extremely strange, I'm able to run ls-remote on other repos, using https, without any auth but not on this particular one.

@NathanReb
Copy link
Contributor

Hmm this is even weirder, I'm reruning the command locally and now it works, after having failed earlier.

@NathanReb
Copy link
Contributor

Haha got it! The command being run by dune-release is:

git ls-remote https://github.com/kit-ty-kate/opam-docker-hub.git

The repo you linked above is ocaml-docker-hub, not opam-docker-hub. Might it be a typo somewhere in an opam file dev-repo or homepage field?

@NathanReb
Copy link
Contributor

The problem here is that Github, in order to prevent malicious users to guess existing private repos name ask for auth whenever you try to access a repo URL that isn't a public repo, be it a private one or a non existing one. That's why you're getting asked for your username and password.

@NathanReb
Copy link
Contributor

We could try to properly wrap the ls-remote invocation to detect those errors and report with the actual problem though!

@kit-ty-kate kit-ty-kate changed the title Github tokens are not used anymore Typos in dev-repo produces some surprising behaviour Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants