Instance executor: the "use_common_build_dir has no effect" warning is never shown
Summary
In executors/instance/instance.go, Prepare() logs the warning "use_common_build_dir has no effect: requires vm isolation or max_use_count = 1" through e.BuildLogger. At that point e.BuildLogger has not been set yet, because it is set by e.AbstractExecutor.Prepare(options), which is called a few lines later. The warning is dropped and the user is not told that use_common_build_dir is ignored.
Steps to reproduce
- Configure an instance executor runner (any fleeting plugin) with:
[runners.instance]
use_common_build_dir = true
[runners.autoscaler]
max_use_count = 3 # > 1, and vm_isolation not enabled- Run any job.
Actual behavior
The job succeeds; the job log contains no warning.
Expected behavior
The job log contains:
WARNING: use_common_build_dir has no effect: requires vm isolation or max_use_count = 1Used GitLab Runner version
19.4.0 (code unchanged on main, 19.6.0)
Possible fixes
Log through the build logger of the options (tested: the warning appears in the job log, the job succeeds):
--- a/executors/instance/instance.go
+++ b/executors/instance/instance.go
} else {
- e.BuildLogger.Warningln("use_common_build_dir has no effect: requires vm isolation or max_use_count = 1")
+ options.BuildLogger.Warningln("use_common_build_dir has no effect: requires vm isolation or max_use_count = 1")
}