0
  1. Created a build definition in TFS 2018

  2. Add step Prepare analysis on SonarQube. 3 Tokenizer: Transform Source Files

  3. NuGet Restore

  4. Build Solution: .NET

  5. VsTest - testAssemblies

  6. Run Code Analysis

  7. Publish Quality Gate Result

    Step 8 Fails with below error:

    Evaluating condition for step: 'Publish Quality Gate Result'

    Evaluating: succeeded()

    Evaluating succeeded:

    (Boolean) True

    Expanded: True

    Result: True

    Starting: Publish Quality Gate Result

============================================================================== 2018-06-04T17:34:41.6970611Z Task : Publish Quality Gate Result 2018-06-04T17:34:41.6971068Z Description : Publish SonarQube's Quality Gate result on the VSTS/TFS build result, to be used after the actual analysis. 2018-06-04T17:34:41.6971496Z Version : 4.2.0 2018-06-04T17:34:41.6971818Z Author : sonarsource 2018-06-04T17:34:41.6972216Z Help : More Information 2018-06-04T17:34:41.6972761Z ==============================================================================

agent.TempDirectory=D:\source\agent\_work\_temp

loading inputs and endpoints

loading 

ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN

loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION

loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION

loading INPUT_POLLINGTIMEOUTSEC

loading SECRET_SONARQUBE_ENDPOINT

loaded 5

Agent.ProxyUrl=undefined

Agent.CAInfo=undefined

Agent.ClientCert=undefined

Agent.SkipCertValidation=undefined

SONARQUBE_SCANNER_PARAMS={"sonar.host.url":"http://localhost:9000/","sonar.login":"admin","sonar.password":"admin","sonar.projectKey":"nao-webapi","sonar.projectName":"nao-webapi","sonar.projectVersion":"1.0","sonar.cs.vscoveragexml.reportsPaths":"**/*.coveragexml","sonar.verbose":"true"}

SONARQUBE_ENDPOINT=********

API GET: '/api/metrics/search' with query "{"f":"name","ps":500}"

Response: 401 Body: "undefined"

API GET '/api/metrics/search' failed, status code was: 401

Could not fetch metrics

Processed: ##vso[task.issue type=error;][SQ] Could not fetch metrics

API GET '/api/metrics/search' failed, status code was: 401

Processed: ##vso[task.issue type=error;][SQ] API GET '/api/metrics/search' failed, status code was: 401

 Agent.BuildDirectory=D:\source\agent\_work\21

 defaultRoot: 'D:\source\agent\_work\21'

 findOptions.followSpecifiedSymbolicLink: 'true'

 findOptions.followSymbolicLinks: 'true'

 matchOptions.debug: 'false'

I get the results, can't figure out why this is not working.

Community
  • 1
  • 1
TyBoard
  • 1
  • 3
  • Its SonarQube 7.1 not 4.2 sorry for the confusion. – TyBoard Jun 01 '18 at 19:23
  • Hi, welcome to stack overflow. Please refer the [ask] link for more details on how to ask a question and update your question accordingly (start changing the tile). – Jeroen Heier Jun 03 '18 at 08:09
  • What do you want to achieve? Did you queue builds in TFS? Could you share your build definition? 401 usually means `Unauthorized`, did you have permission to access your server? – Cece Dong - MSFT Jun 04 '18 at 08:26
  • Tried Linkhttps://stackoverflow.com/questions/48544346/sonarqube-v-4-tfs-task-publish-analysis-result-throw-error-could-not-fetch-me?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa But did not fix issue. – TyBoard Jun 04 '18 at 19:25
  • Is the latest SonarQube Extension compatible with TFS 2018 update 2 – TyBoard Jun 04 '18 at 19:51
  • This is TFS 2018 Update 2, has update 2 been tested with extension? – TyBoard Jun 07 '18 at 15:34

1 Answers1

0

The extension site indicates, SonarQube extension works with:

  • Visual Studio Team Services
  • Team Foundation Server 2017 Update 2
  • Team Foundation Server 2017 Update 3
  • Team Foundation Server 2018

No TFS 2018 Update 2 yet.

Cece Dong - MSFT
  • 29,631
  • 1
  • 24
  • 39