.setSince("5.3")
.setHandler(this)
.setChangelog(
- new Change("10.0", "The field 'periods' in the response is removed"),
+ new Change("10.0", "The fields 'periods' and 'periodIndex' in the response are removed"),
new Change("9.9", "'caycStatus' field is added to the response"),
new Change("9.5", "The 'Execute Analysis' permission also allows to access the endpoint"),
new Change("8.5", "The field 'periods' in the response is deprecated. Use 'period' instead"),
formatConditionLevel(conditionBuilder, jsonCondition);
formatConditionMetric(conditionBuilder, jsonCondition);
formatConditionOperation(conditionBuilder, jsonCondition);
- formatConditionPeriod(conditionBuilder, jsonCondition);
formatConditionWarningThreshold(conditionBuilder, jsonCondition);
formatConditionErrorThreshold(conditionBuilder, jsonCondition);
formatConditionActual(conditionBuilder, jsonCondition);
}
}
- private static void formatConditionPeriod(ProjectStatusResponse.Condition.Builder conditionBuilder, JsonObject jsonCondition) {
- JsonElement periodIndex = jsonCondition.get("period");
- if (periodIndex == null) {
- return;
- }
- conditionBuilder.setPeriodIndex(periodIndex.getAsInt());
- }
-
private static void formatConditionOperation(ProjectStatusResponse.Condition.Builder conditionBuilder, JsonObject jsonCondition) {
JsonElement op = jsonCondition.get("op");
if (op != null && !isNullOrEmpty(op.getAsString())) {
"status": "ERROR",
"metricKey": "new_coverage",
"comparator": "LT",
- "periodIndex": 1,
"errorThreshold": "85",
"actualValue": "82.50562381034781"
},
"status": "ERROR",
"metricKey": "new_blocker_violations",
"comparator": "GT",
- "periodIndex": 1,
"errorThreshold": "0",
"actualValue": "14"
},
"status": "ERROR",
"metricKey": "new_critical_violations",
"comparator": "GT",
- "periodIndex": 1,
"errorThreshold": "0",
"actualValue": "1"
},
"status": "OK",
"metricKey": "new_sqale_debt_ratio",
"comparator": "GT",
- "periodIndex": 1,
"errorThreshold": "5",
"actualValue": "0.6562109862671661"
},
"status": "OK",
"metricKey": "reopened_issues",
"comparator": "GT",
- "periodIndex": 1,
"actualValue": "0"
},
{
"status": "ERROR",
"metricKey": "open_issues",
"comparator": "GT",
- "periodIndex": 1,
"actualValue": "17"
},
{
"status": "OK",
"metricKey": "skipped_tests",
"comparator": "GT",
- "periodIndex": 1,
"actualValue": "0"
}
],
ProjectStatusResponse.Comparator.LT,
ProjectStatusResponse.Comparator.GT,
ProjectStatusResponse.Comparator.GT);
- assertThat(conditions).extracting("periodIndex").containsExactly(1, 1, 1);
assertThat(conditions).extracting("warningThreshold").containsOnly("80", "");
assertThat(conditions).extracting("errorThreshold").containsOnly("85", "0", "0");
assertThat(conditions).extracting("actualValue").containsExactly("82.2985024398452", "1", "0");
assertThat(conditions).extracting("status").containsExactly(ProjectStatusResponse.Status.ERROR);
assertThat(conditions).extracting("metricKey").containsExactly("new_coverage");
assertThat(conditions).extracting("comparator").containsExactly(ProjectStatusResponse.Comparator.LT);
- assertThat(conditions).extracting("periodIndex").containsExactly(1);
assertThat(conditions).extracting("errorThreshold").containsOnly("85");
assertThat(conditions).extracting("actualValue").containsExactly("82.2985024398452");
}
optional Status status = 1;
optional string metricKey = 2;
optional Comparator comparator = 3;
- optional int32 periodIndex = 4;
+ reserved 4; //drop periodIndex
optional string warningThreshold = 5;
optional string errorThreshold = 6;
optional string actualValue = 7;