Skip to content

Install OCaml consumer dependencies in action#19

Merged
subsetpark merged 1 commit into
masterfrom
zax/action-install-ocaml-consumer-deps
Jun 8, 2026
Merged

Install OCaml consumer dependencies in action#19
subsetpark merged 1 commit into
masterfrom
zax/action-install-ocaml-consumer-deps

Conversation

@subsetpark

@subsetpark subsetpark commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

What

Install the consuming OCaml project's opam dependencies in the composite action before running the OCaml adapter.

Why

The OCaml adapter now reads typedtree artifacts from the consumer project. That requires building the consumer project, including test modules, so the action must install the consumer's dependencies, not only archlint adapter dependencies.

Verification

  • uv run --with pyyaml python -c \"import yaml; yaml.safe_load(open('action.yml'))\"
  • Failure reproduced on onton #358 before this change: missing qcheck-core, eio, etc. in the action switch.

View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

@flowglad-review-service flowglad-review-service Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review: 2 comments

Comment thread action.yml
# the active switch, so no separate build step is needed here.
run: opam install "$GITHUB_ACTION_PATH/ocaml" --deps-only --yes
- if: inputs.adapter == 'ocaml'
shell: bash

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MUST FIX] action.yml:85 — This installs the consumer repo at GITHUB_WORKSPACE, which in a composite action may include the archlint checkout itself rather than the target repository when repo-root is overridden. That means opam install can miss the actual consumer project dependencies or try to resolve dependencies for the wrong tree. Use the configured repo root input here so the action builds the same project tree that evaluate.py analyzes.

Scope: Adjust the new OCaml dependency-install step in action.yml to resolve the repository root from the existing action input before invoking opam install.

Spec violation: The action should prepare the consumer repository that --repo-root points to; using a fixed workspace path can break the end-to-end consumer-build invariant described in the PR.

Reviewed at 25293fc

Comment thread action.yml
- if: inputs.adapter == 'ocaml'
shell: bash
# The OCaml adapter reads typedtree artifacts from the consumer project,
# so it must be able to build that project too. Install consumer deps,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[SHOULD FIX] action.yml:87opam install ... --with-test will only work if the consumer project is an opam package root that exposes test dependencies in its opam metadata. If the workspace contains a non-opam subtree or a monorepo layout where the OCaml source root is narrower than the repository root, this command will attempt to install dependencies for the wrong package set and can fail before the adapter runs. Consider scoping the install to the same path the OCaml adapter uses for discovery, or otherwise deriving the install target from the existing OCaml root input.

Scope: Constrain the new OCaml opam-install step within action.yml to the consumer OCaml project path already configured by this action.

Spec violation: The composite action’s OCaml setup should match the OCaml project root used for analysis; otherwise dependency installation can fail even though the analyzer is pointed at a different subtree.

Reviewed at 25293fc

@flowglad-review-service

Copy link
Copy Markdown

Review Summary

The new OCaml setup step is a good direction, but it currently hard-codes the workspace path and may install dependencies for the wrong tree when consumers override the repo root or keep OCaml code in a subdirectory.

Severity Count
Must-fix 1
Should-fix 1
Note 0

Variant: convergence-v2

Candidates: 2 | Posted: 2 | Suppressed: 0


2 comments posted · Model: gpt-5.4-mini (haiku) · Tokens: 5707 in / 434 out · Review mode: one-shot

@subsetpark subsetpark merged commit b3ab4bb into master Jun 8, 2026
7 checks passed
@subsetpark subsetpark deleted the zax/action-install-ocaml-consumer-deps branch June 8, 2026 19:11
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

Successfully merging this pull request may close these issues.

1 participant