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

GitLab support? #463

Open
mjambon opened this issue Mar 28, 2023 · 5 comments
Open

GitLab support? #463

mjambon opened this issue Mar 28, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@mjambon
Copy link
Contributor

mjambon commented Mar 28, 2023

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?

@Leonidas-from-XIV
Copy link
Member

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 Leonidas-from-XIV added the enhancement New feature or request label Mar 30, 2023
@Richard-Degenne
Copy link

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
Copy link

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.

@Leonidas-from-XIV
Copy link
Member

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.

@Richard-Degenne
Copy link

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.

@kayceesrk kayceesrk moved this to Todo in hackocaml Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

3 participants