ActualValue is empty

Hello!
Can you help me please?) I have a trouble with actualValue field in json file

Must-share information (formatted with Markdown):

  • SonarQube 6.7.4
  • I need the actual values field in the json on the first run of the analysis

An example of the first analysis in a new project:

> **15:53:41** Sonar Project status: {"projectStatus":{"status":"OK","conditions":[{"status":"OK","metricKey":"blocker_violations","comparator":"GT","periodIndex":1,"errorThreshold":"0"},{"status":"OK","metricKey":"critical_violations","comparator":"GT","periodIndex":1,"errorThreshold":"0"},{"status":"OK","metricKey":"open_issues","comparator":"GT","periodIndex":1,"warningThreshold":"0"},{"status":"OK","metricKey":"reopened_issues","comparator":"GT","periodIndex":1,"warningThreshold":"0"},{"status":"OK","metricKey":"skipped_tests","comparator":"GT","periodIndex":1,"warningThreshold":"0"},{"status":"OK","metricKey":"test_errors","comparator":"GT","periodIndex":1,"errorThreshold":"0"},{"status":"OK","metricKey":"test_failures","comparator":"GT","periodIndex":1,"errorThreshold":"0"}],"periods":[],"ignoredConditions":false}}
> 
> **15:53:41** Archiving artifacts
> 
> **15:53:41**
> 
> **15:53:41** SONAR QUICK REPORT:
> 
> **15:53:41** blocker_violations null/0: OK
> 
> **15:53:41** critical_violations null/0: OK
> 
> **15:53:41** open_issues null/0: OK
> 
> **15:53:41** reopened_issues null/0: OK
> 
> **15:53:41** skipped_tests null/0: OK
> 
> **15:53:41** test_errors null/0: OK
> 
> **15:53:41** test_failures null/0: OK

An example of a second analysis in a new project:

> **14:51:36** Sonar Project status: {"projectStatus":{"status":"ERROR","conditions":[{"status":"OK","metricKey":"blocker_violations","comparator":"GT","periodIndex":1,"errorThreshold":"0","actualValue":"-4"},{"status":"OK","metricKey":"critical_violations","comparator":"GT","periodIndex":1,"errorThreshold":"0","actualValue":"-15"},{"status":"OK","metricKey":"open_issues","comparator":"GT","periodIndex":1,"warningThreshold":"0","actualValue":"-695"},{"status":"OK","metricKey":"reopened_issues","comparator":"GT","periodIndex":1,"warningThreshold":"0","actualValue":"0"},{"status":"OK","metricKey":"new_sqale_debt_ratio","comparator":"GT","periodIndex":1,"errorThreshold":"5","actualValue":"1.6919739696312366"},{"status":"OK","metricKey":"skipped_tests","comparator":"GT","periodIndex":1,"warningThreshold":"0","actualValue":"-1"},{"status":"OK","metricKey":"test_errors","comparator":"GT","periodIndex":1,"errorThreshold":"0","actualValue":"-1"},{"status":"OK","metricKey":"test_failures","comparator":"GT","periodIndex":1,"errorThreshold":"0","actualValue":"0"},{"status":"ERROR","metricKey":"new_coverage","comparator":"LT","periodIndex":1,"errorThreshold":"80","actualValue":"0.0"},{"status":"ERROR","metricKey":"new_duplicated_lines_density","comparator":"GT","periodIndex":1,"errorThreshold":"5","actualValue":"62.85025051029876"}],"periods":[{"index":1,"mode":"previous_version","date":"2019-08-21T17:09:06+0300","parameter":"3.0.19.pr7"}],"ignoredConditions":false}}
> 
> **14:51:36** Archiving artifacts
> 
> **14:51:37**
> 
> **14:51:37** SONAR QUICK REPORT:
> 
> **14:51:37** blocker_violations -4/0: OK
> 
> **14:51:37** critical_violations -15/0: OK
> 
> **14:51:37** open_issues -695/0: OK
> 
> **14:51:37** reopened_issues 0/0: OK
> 
> **14:51:37** new_sqale_debt_ratio 1.6919739696312366/5: OK
> 
> **14:51:37** skipped_tests -1/0: OK
> 
> **14:51:37** test_errors -1/0: OK
> 
> **14:51:37** test_failures 0/0: OK
> 
> **14:51:37** new_coverage 0.0/80: ERROR
> 
> **14:51:37** new_duplicated_lines_density 62.85025051029876/5: ERROR

Where does the actualValue field come from? Is it based on a previous analysis?

Hi,

I believe what we’re looking at here is the webhook payload(?). Proceeding under that assumption…

At a guess, you have a condition in your quality gate that has the “on New Code” checkbox checked. Things get a little weird when that checkbox is checked, which is why when we did a small overhaul on Quality Gates in 7.6 we dropped the checkbox in favor of the “X on New Code” metrics that were already available.

When you upgrade to 7.9.1, the latest version and current LTS (You are planning to upgrade, aren’t you? :wink:) that condition will automatically be converted to the equivalent “X on New Code” metric. If you’d like an immediate change/fix, you can swap out the condition in your Quality Gate now. Once you do, you’ll get more understandable labels and values in your webhook payload.

 
HTH,
Ann