Skip to content

fix(scripts): mutate a module-root package from its own directory - #667

Merged
JeroenSoeters merged 1 commit into
mainfrom
fix/mutation-module-root-path
Aug 21, 2026
Merged

fix(scripts): mutate a module-root package from its own directory#667
JeroenSoeters merged 1 commit into
mainfrom
fix/mutation-module-root-path

Conversation

@JeroenSoeters

Copy link
Copy Markdown
Collaborator

Summary

With the runner-death mode fixed (#665), the remaining red mutation checks on open PRs all share one signature: any changed package that is itself a Go module root (pkg/plugin, pkg/model, pkg/credential, ...) fails with [setup failed] ... impossible to executeCoverage.

The cause is in run_package's path computation: rel_pkg is built as an absolute path and then stripped with ${rel_pkg#"$module_root"/}. For a module-root package the string equals $module_root exactly, so the trailing-slash pattern never matches and the absolute path survives; gremlins is then invoked from inside the module on a doubled path like ./home/runner/work/formae/formae/pkg/plugin.

The fix addresses a package that equals its module root as the current directory. Covered by a new case in the script's test suite that pins both the working directory and the target gremlins receives; it fails on the unfixed script with the doubled path and passes with the fix.

This is what keeps #621's and #663's checks red after their branch updates. #653 touches the same script and carries the same computation; whichever lands second rebases trivially.

When a changed package is itself a module root, such as pkg/plugin, the
relative-path computation never matched: the prefix strip carries a
trailing slash, so a path equal to the module root came through intact
and gremlins was invoked on a doubled absolute path like
./home/runner/work/formae/formae/pkg/plugin, failing setup before
coverage could run. The check then reported the package as producing no
usable result.

A package that equals its module root is now addressed as the current
directory, so gremlins runs in that module on the module itself.
@JeroenSoeters
JeroenSoeters merged commit 7d3da99 into main Aug 21, 2026
29 of 30 checks passed
@JeroenSoeters
JeroenSoeters deleted the fix/mutation-module-root-path branch August 21, 2026 21:17
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