When the remote config option is misconfigured, an error happens at package submission time:
the first time the user configures dune-release, they enter one of their code repositories as remote
later they submit a package and the following error is displayed:
$ dune-release opam submit
...
[-] Opening pull request to merge branch release-pkg-0.0.1 of git@github.com:myself/project into ocaml/opam-repository
dune-release: [ERROR] Could not retrieve pull request URL from response, unexpected Github API error: "Validation Failed"
This happens because myself/project is not a fork of ocaml/opam-repository.
In terms of checking, a remote that does not end in /opam-repository should be enough to raise eyebrows, but the right way is to use the API: in the case of a fork, https://api.github.com/repos/myself/opam-repository has .fork == true and .parent.full_name == "ocaml/opam-repository" while https://api.github.com/repos/myself/project has .fork == false.
This check can be performed at configure time, after this kind of error, or as part of a config-checking command. I'll defer that to @NathanReb if he considers that this should be improved.
When the
remote
config option is misconfigured, an error happens at package submission time:remote
This happens because
myself/project
is not a fork ofocaml/opam-repository
.In terms of checking, a
remote
that does not end in/opam-repository
should be enough to raise eyebrows, but the right way is to use the API: in the case of a fork,https://api.github.com/repos/myself/opam-repository
has.fork == true
and.parent.full_name == "ocaml/opam-repository"
whilehttps://api.github.com/repos/myself/project
has.fork == false
.This check can be performed at configure time, after this kind of error, or as part of a config-checking command. I'll defer that to @NathanReb if he considers that this should be improved.