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

GitLab support?

Open mjambon opened this issue 3 years ago • 5 comments

I'm running into a third-party opam package that's hosted on GitLab and has a broken checksum, presumably because GitLab changed the compression parameters and recompressed the release tarball.

Is there a way for GitLab users to use dune-release to publish tarballs that won't change?

I'm thinking of the following options:

  1. Implement full support for the GitLab API, assuming it has a similar mechanism to upload release artifacts.
  2. Maintain a GitHub mirror of the target project only for releases.

Any suggestion that would help avoid recurring checksum problems?

mjambon avatar Mar 28 '23 22:03 mjambon

At the moment I can't think of a way (especially as I would like to replace all git commands by using the GitHub API to make it less fragile and side-effecty), one would need to create a separate backend for the GitLab API.

What you could do at the moment is to use the tagging using dune-release (creating annotated tags) and use dune-release distrib to create the tarball and upload it manually. That's probably still less of a hassle than a separate GitHub mirror and at least the tarballs are in the expected place. You can use dune-release opam pkg to generate the opam file, though you'll need to edit the URL to point to the GitLab URL.

Leonidas-from-XIV avatar Mar 30 '23 12:03 Leonidas-from-XIV

I'm in the process of setting up a CI on GitLab to release my own packages. I'm looking into your suggestion of using dune-release distrib to do it, but I'm facing a weird issue.

dune-release distrib --skip-tests

(I use --skip-tests because I'm already running the tests in another job)

This command fails with the following message.

[-] Building source archive dune-release: [ERROR] /builds/richard.degenne/ocaml-perfectconfiguration: No VCS repository found

However, all GitLab jobs are run within a Git repository. Is there a reason why dune-release would fail to recognize the repo?

Richard-Degenne avatar Oct 15 '23 07:10 Richard-Degenne

Also side question: is there a documentation about how the tarball is built? I'm starting to feel like it would be easier to build the tarball myself rather than trying to twist dune-release in a use-case it's clearly not intended for.

Richard-Degenne avatar Oct 15 '23 07:10 Richard-Degenne

dune-release: [ERROR] /builds/richard.degenne/ocaml-perfectconfiguration: No VCS repository found

It is possible that the current working directory isn't /builds/richard.degenne/ocaml-perfectconfiguration because there is a fallback path which uses the current directory. Maybe you can set the CI?

Also side question: is there a documentation about how the tarball is built?

No, there is only the source at the moment.

Leonidas-from-XIV avatar Oct 16 '23 09:10 Leonidas-from-XIV

For what it's worth, I ended up rebuilding a whole pipeline from scratch for GitLab's CI, and in particular, I was able to retrieve the shasum directly from the package registry API.

You can read up about it here.

https://blog.richarddegenne.fr/2023/10/20/setting-up-a-private-opam-repository-on-gitlab-step-by-step/

That might be good input for the day you'd want to extend dune-release to GitLab's.

Richard-Degenne avatar Oct 20 '23 17:10 Richard-Degenne