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

Proposal: Integrate Opam CI Lint Functionality into opam-publish #165

Open
punchagan opened this issue Nov 26, 2024 · 3 comments
Open

Proposal: Integrate Opam CI Lint Functionality into opam-publish #165

punchagan opened this issue Nov 26, 2024 · 3 comments

Comments

@punchagan
Copy link

Proposal

Recently, the opam-repository maintainers have been discussing incorporating the lint checks run as part of the opam-repository CI into the package publication tools. Running these lints locally before submitting pull requests to the opam-repository could smoothen the workflow of package authors, while also reducing the workload of the repository maintainers as well as the infrastructure.

Would the opam-publish maintainers be open to integrating this functionality and exploring how best to implement it?

Current Work

As a part of our work to improve package author-ing workflows, we have extracted some of the functionality/logic from the opam-repository CI code into a CLI sub-project, opam-ci-check, that can be used locally to run some of the CI steps, including linting.

We are currently working on extracting the lint functionality from opam-ci-check as a library with a minimal dependency cone to help ease the integration into package publication tools like opam-publish/dune-release.

Next Steps

If the maintainers are open to this idea, we would be happy to share a draft PR with an initial implementation for further discussion. We are happy to hear any advice, suggestions or concerns regarding this. Also, let us know if you'd like us to proceed differently here.

/cc @shonfeder

@punchagan punchagan changed the title Proposal: Integrate Opam CI Check Lint Functionality into opam-publish Proposal: Integrate Opam CI Lint Functionality into opam-publish Nov 26, 2024
@punchagan
Copy link
Author

We've wrapped up the refactor of the API to make it easy to extract the lint functionality as a separate library.

I have an initial implementation of the linting here.

@rjbou
Copy link
Contributor

rjbou commented Dec 16, 2024

Thanks for the proposal. That was something that we have in mind since a long time.

We discussed it in last dev meeting, there are some things to keep in mind while implementing this feature.

opam-publish is not for the main OCaml opam repository only, it's the default to publish on ocaml/opam-repository. In that case, that default should use opam-ci-check lint, but it should remain possible to use another linter (default or external) for another repository (for example, coq/rocq opam repo uses opam-publish, maybe other ones too).

Also, it is necessary to keep synchronisation between linting used by ocaml/opam-repository and linting used in opam-publish, to avoid more work for repo maintainers. Let's say that the user have installed in its switch opam-publish with opam-ci-check version x and the ocaml/opam-repository bumped to opam-ci-check version y, adding new lints. Before opening the PR, opam-publish should warn the user to update its opam-publish install. It can be done with the information of the current version used by ocaml/opam-repository available somewhere (rest api?).

Please open the WIP PR, we'll be able to discuss that in it, and the code itself.

@punchagan
Copy link
Author

Thank you for taking the time to discuss this proposal in the dev meeting, @rjbou !

Both the suggestions for consideration are great and I agree that it would be nice to keep them in mind while implementing this feature. The current WIP branch I have allows the linting to be done only on opam-repository, but doesn't take into account the version being used in CI. (opam-repository CI currently uses an unpublished version of opam-ci-check for the linting).

I'll open a draft PR and close the proposal issue to move the discussion closer to the code.

Thanks again for your time!

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