Gitlab with multiple build agents and parallel build steps

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    Developer Edition Version 8.7.1 (build 42226)
    Sonar Scanner Msbuild v5.0.4.24009 net46

  • what are you trying to achieve
    This is probably a sonar scanner question… We have 3 build runners for our gitlab setup and, in our build, we have 6 steps. Some of the build steps run parallel on different build runners. The issue we are having is that, in .sonarqube folder (generated by sonar scanner?), all paths in config files are absolute path (full path). Gitlab build folder has the following path

      {builds_dir}/$RUNNER_TOKEN_KEY/$CONCURRENT_ID/$NAMESPACE/$PROJECT_NAME
    

    Note the build runner token in the path ($RUNNER_TOKEN_KEY), it is different on each runner. That means that part of the file path is different from runner to runner. This is causing File Doesn’t Exist error when different SonarQube build steps are ran on different build runners.

  • what have you tried so far to achieve this
    Build everything on one build runner- significant slower build
    Run a script before each build step to correct the file paths in .sonarqube folder - Not ideal considering SonarQube probably could use relative path to the root folder of the solution I am trying to build in those config files.

My question: I went through the docos and couldn’t find anything. Is there a config somewhere I could change to make the scanner generate those files with relative path?

Hi,

Welcome to the community!

Sorry, but no. There’s no provision for running different steps on different workers.

And to be specific, can you explain what you mean by

Are you actually somehow chopping up analysis itself to run on multiple servers? Or is this about the test reports being generated on a different worker than analysis runs on?

 
Ann