fix(scripts): mutate a module-root package from its own directory - #667
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_pkgis built as an absolute path and then stripped with${rel_pkg#"$module_root"/}. For a module-root package the string equals$module_rootexactly, 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.