Skip to content

test(opam): reproduce missing promotion after source deletion - #16232

Merged
Alizter merged 1 commit into
ocaml:mainfrom
Alizter:opam-source-deletion-repro
Aug 28, 2026
Merged

Alizter merged 1 commit into
ocaml:mainfrom
Alizter:opam-source-deletion-repro

Conversation

@Alizter

@Alizter Alizter commented Aug 28, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Reproduction case for #16233.

Add a minimal cram regression test for generated OPAM files. The test primes
the @opam diff action while foo.opam exists, removes the source file, and
captures the current behavior: dune build @opam succeeds without registering
a creation promotion, leaving foo.opam missing.

The fix is in #16234.

Related Issue and Motivation

This was reported while upgrading to Dune 3.24.2 with (lang dune 3.24) and
(generate_opam_files). Removing a generated OPAM file should cause @opam to
offer the regenerated file for promotion.

Testing

  • dune build @check @fmt
  • dune runtest test/blackbox-tests/test-cases/dune-project-meta

Copilot AI 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.

Pull request overview

Adds a focused cram regression test reproducing stale @opam action caching after deleting a generated source OPAM file.

Changes:

  • Creates and promotes foo.opam.
  • Deletes it and verifies the missing creation promotion.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@Alizter Alizter changed the title test(opam): reproduce missing promotion after source deletion fix(opam): restore promotion after generated file deletion Aug 28, 2026
@Alizter
Alizter force-pushed the opam-source-deletion-repro branch from 9e6d2e7 to 5a9ae0f Compare August 28, 2026 13:26
@Alizter Alizter changed the title fix(opam): restore promotion after generated file deletion test(opam): reproduce missing promotion after source deletion Aug 28, 2026
@Alizter
Alizter merged commit 2ab5dc2 into ocaml:main Aug 28, 2026
73 of 74 checks passed
@Alizter
Alizter deleted the opam-source-deletion-repro branch August 28, 2026 15:51
@Alizter Alizter added this to the 3.25.0 milestone Aug 29, 2026
Alizter added a commit that referenced this pull request Aug 31, 2026
## Description

Run generated OPAM-file diff actions in a sandbox. After a generated
OPAM file
is deleted, the stale build-tree copy is no longer a declared dependency
and is
therefore excluded from the sandbox. The diff then treats the source as
missing
and records a creation promotion.

The regression test was added separately in #16232. This PR updates its
expectations to cover the fix.

## Related Issue and Motivation

Fixes #16233

Deleting a generated OPAM file should allow `@opam` to regenerate and
promote
it again.

## Testing

- `dune build @check @fmt`
- `dune runtest test/blackbox-tests/test-cases/dune-project-meta`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants