dune-release icon indicating copy to clipboard operation
dune-release copied to clipboard

Typos in dev-repo produces some surprising behaviour

Open kit-ty-kate opened this issue 4 years ago • 7 comments

$ dune-release
[...]
[-] Publishing to github
Username for 'https://github.com': kit-ty-kate
Password for 'https://[email protected]':
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: [email protected]:kit-ty-kate/opam-repository.git
local: /Users/kit_ty_kate/.config/dune/opam-repository

$ git remote show origin
* remote origin
  Fetch URL: [email protected]:kit-ty-kate/ocaml-docker-hub.git
  Push  URL: [email protected]:kit-ty-kate/ocaml-docker-hub.git
[...]

kit-ty-kate avatar Jan 11 '22 13:01 kit-ty-kate

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.

NathanReb avatar Jan 11 '22 14:01 NathanReb

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

kit-ty-kate avatar Jan 11 '22 15:01 kit-ty-kate

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 avatar Jan 12 '22 09:01 NathanReb

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

NathanReb avatar Jan 12 '22 09:01 NathanReb

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 avatar Jan 12 '22 09:01 NathanReb

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 avatar Jan 12 '22 09:01 NathanReb

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

NathanReb avatar Jan 12 '22 10:01 NathanReb