From 365c05c202f49a915c1cc44c069d0f36e7c0d48f Mon Sep 17 00:00:00 2001 From: Louis MARTIN Date: Tue, 13 Feb 2024 15:26:20 +0100 Subject: [PATCH] Synchronize quality gates with sonarqube image --- conf/quality_gates/CNES_CAYC_FromScratch.json | 143 ++++++++++++++++ .../CNES_CAYC_FromScratch_coverage.json | 155 ++++++++++++++++++ conf/quality_gates/CNES_CAYC_Herited.json | 71 ++++++++ .../CNES_CAYC_Herited_coverage.json | 77 +++++++++ configure-cat.bash | 2 +- 5 files changed, 447 insertions(+), 1 deletion(-) create mode 100644 conf/quality_gates/CNES_CAYC_FromScratch.json create mode 100644 conf/quality_gates/CNES_CAYC_FromScratch_coverage.json create mode 100644 conf/quality_gates/CNES_CAYC_Herited.json create mode 100644 conf/quality_gates/CNES_CAYC_Herited_coverage.json diff --git a/conf/quality_gates/CNES_CAYC_FromScratch.json b/conf/quality_gates/CNES_CAYC_FromScratch.json new file mode 100644 index 0000000..3ea226c --- /dev/null +++ b/conf/quality_gates/CNES_CAYC_FromScratch.json @@ -0,0 +1,143 @@ +{ + "id": "AY1FHSNgqvoSmFLK7ySt", + "name": "CNES CAYCode FromScratch", + "conditions": [ + { + "id": "AY1FHSNiqvoSmFLK7ySu", + "metric": "new_maintainability_rating", + "op": "GT", + "error": "1" + }, + { + "id": "AY1FHSNjqvoSmFLK7ySv", + "metric": "new_reliability_rating", + "op": "GT", + "error": "1" + }, + { + "id": "AY1FHSNjqvoSmFLK7ySw", + "metric": "new_security_hotspots_reviewed", + "op": "LT", + "error": "100" + }, + { + "id": "AY1FHSNjqvoSmFLK7ySx", + "metric": "new_security_rating", + "op": "GT", + "error": "1" + }, + { + "id": "AY1FHSNkqvoSmFLK7ySy", + "metric": "new_duplicated_lines_density", + "op": "GT", + "error": "5" + }, + { + "id": "AY1FHSNkqvoSmFLK7ySz", + "metric": "new_coverage", + "op": "LT", + "error": "0" + }, + { + "id": "AY1FHSNlqvoSmFLK7yS0", + "metric": "new_blocker_violations", + "op": "GT", + "error": "0" + }, + { + "id": "AY1FHSNlqvoSmFLK7yS1", + "metric": "new_critical_violations", + "op": "GT", + "error": "0" + }, + { + "id": "AY1FHSNmqvoSmFLK7yS2", + "metric": "new_major_violations", + "op": "GT", + "error": "0" + }, + { + "id": "AY1FHSNmqvoSmFLK7yS3", + "metric": "blocker_violations", + "op": "GT", + "error": "0" + }, + { + "id": "AY1FHSNnqvoSmFLK7yS4", + "metric": "major_violations", + "op": "GT", + "error": "0" + }, + { + "id": "AY1FHSNnqvoSmFLK7yS5", + "metric": "critical_violations", + "op": "GT", + "error": "0" + }, + { + "id": "AY1FHSNoqvoSmFLK7yS6", + "metric": "sqale_debt_ratio", + "op": "GT", + "error": "5" + }, + { + "id": "AY1FHSNoqvoSmFLK7yS7", + "metric": "comment_lines_density", + "op": "LT", + "error": "20" + }, + { + "id": "AY1FHSNpqvoSmFLK7yS8", + "metric": "duplicated_lines_density", + "op": "GT", + "error": "10" + }, + { + "id": "AY1FHSNpqvoSmFLK7yS9", + "metric": "test_errors", + "op": "GT", + "error": "0" + }, + { + "id": "AY1FHSNqqvoSmFLK7yS-", + "metric": "test_failures", + "op": "GT", + "error": "0" + }, + { + "id": "AY1FHSNqqvoSmFLK7yS_", + "metric": "security_review_rating", + "op": "GT", + "error": "1" + }, + { + "id": "AY1FHSNrqvoSmFLK7yTA", + "metric": "security_hotspots_reviewed", + "op": "LT", + "error": "100" + }, + { + "id": "AY1FHSNrqvoSmFLK7yTB", + "metric": "reliability_rating", + "op": "GT", + "error": "1" + }, + { + "id": "AY1FHSNsqvoSmFLK7yTC", + "metric": "sqale_rating", + "op": "GT", + "error": "1" + } + ], + "isBuiltIn": false, + "actions": { + "rename": true, + "setAsDefault": true, + "copy": true, + "associateProjects": true, + "delete": true, + "manageConditions": true, + "delegate": true + }, + "caycStatus": "over-compliant" +} \ No newline at end of file diff --git a/conf/quality_gates/CNES_CAYC_FromScratch_coverage.json b/conf/quality_gates/CNES_CAYC_FromScratch_coverage.json new file mode 100644 index 0000000..8d639b8 --- /dev/null +++ b/conf/quality_gates/CNES_CAYC_FromScratch_coverage.json @@ -0,0 +1,155 @@ +{ + "id": "AY1E7SwrqvoSmFLK7yRC", + "name": "CNES CAYCode From Scratch with coverage", + "conditions": [ + { + "id": "AY1E7SwtqvoSmFLK7yRD", + "metric": "new_maintainability_rating", + "op": "GT", + "error": "1" + }, + { + "id": "AY1E7SwxqvoSmFLK7yRE", + "metric": "new_reliability_rating", + "op": "GT", + "error": "1" + }, + { + "id": "AY1E7SwyqvoSmFLK7yRF", + "metric": "new_security_hotspots_reviewed", + "op": "LT", + "error": "100" + }, + { + "id": "AY1E7SwzqvoSmFLK7yRG", + "metric": "new_security_rating", + "op": "GT", + "error": "1" + }, + { + "id": "AY1E7Sw1qvoSmFLK7yRH", + "metric": "new_duplicated_lines_density", + "op": "GT", + "error": "5" + }, + { + "id": "AY1E7_QSqvoSmFLK7yRJ", + "metric": "new_coverage", + "op": "LT", + "error": "0" + }, + { + "id": "AY1E8r9hqvoSmFLK7yRS", + "metric": "new_blocker_violations", + "op": "GT", + "error": "0" + }, + { + "id": "AY1E8t-jqvoSmFLK7yRT", + "metric": "new_critical_violations", + "op": "GT", + "error": "0" + }, + { + "id": "AY1E9BLhqvoSmFLK7yRU", + "metric": "new_major_violations", + "op": "GT", + "error": "0" + }, + { + "id": "AY1FBy32qvoSmFLK7yR-", + "metric": "blocker_violations", + "op": "GT", + "error": "0" + }, + { + "id": "AY1FB3KDqvoSmFLK7yR_", + "metric": "major_violations", + "op": "GT", + "error": "0" + }, + { + "id": "AY1FB8AfqvoSmFLK7ySA", + "metric": "critical_violations", + "op": "GT", + "error": "0" + }, + { + "id": "AY1FCGjgqvoSmFLK7ySB", + "metric": "sqale_debt_ratio", + "op": "GT", + "error": "5" + }, + { + "id": "AY1FCSgOqvoSmFLK7ySC", + "metric": "comment_lines_density", + "op": "LT", + "error": "20" + }, + { + "id": "AY1FCYNIqvoSmFLK7ySD", + "metric": "duplicated_lines_density", + "op": "GT", + "error": "10" + }, + { + "id": "AY1FCkC6qvoSmFLK7ySE", + "metric": "test_errors", + "op": "GT", + "error": "0" + }, + { + "id": "AY1FCmNPqvoSmFLK7ySF", + "metric": "test_failures", + "op": "GT", + "error": "0" + }, + { + "id": "AY1FDUiBqvoSmFLK7ySM", + "metric": "security_review_rating", + "op": "GT", + "error": "1" + }, + { + "id": "AY1FDXyyqvoSmFLK7ySN", + "metric": "security_hotspots_reviewed", + "op": "LT", + "error": "100" + }, + { + "id": "AY1FDhHDqvoSmFLK7ySO", + "metric": "reliability_rating", + "op": "GT", + "error": "1" + }, + { + "id": "AY1FDoMHqvoSmFLK7ySP", + "metric": "sqale_rating", + "op": "GT", + "error": "1" + }, + { + "id": "AY1FHZgFqvoSmFLK7yTD", + "metric": "new_line_coverage", + "op": "LT", + "error": "100" + }, + { + "id": "AY1FHdh5qvoSmFLK7yTH", + "metric": "line_coverage", + "op": "LT", + "error": "100" + } + ], + "isBuiltIn": false, + "actions": { + "rename": true, + "setAsDefault": true, + "copy": true, + "associateProjects": true, + "delete": true, + "manageConditions": true, + "delegate": true + }, + "caycStatus": "over-compliant" +} \ No newline at end of file diff --git a/conf/quality_gates/CNES_CAYC_Herited.json b/conf/quality_gates/CNES_CAYC_Herited.json new file mode 100644 index 0000000..b1c9830 --- /dev/null +++ b/conf/quality_gates/CNES_CAYC_Herited.json @@ -0,0 +1,71 @@ +{ + "id": "AY1FBoE-qvoSmFLK7yRu", + "name": "CNES CAYCode HeritedCode", + "conditions": [ + { + "id": "AY1FBoFAqvoSmFLK7yRv", + "metric": "new_maintainability_rating", + "op": "GT", + "error": "1" + }, + { + "id": "AY1FBoFBqvoSmFLK7yRw", + "metric": "new_reliability_rating", + "op": "GT", + "error": "1" + }, + { + "id": "AY1FBoFCqvoSmFLK7yRx", + "metric": "new_security_hotspots_reviewed", + "op": "LT", + "error": "100" + }, + { + "id": "AY1FBoFCqvoSmFLK7yRy", + "metric": "new_security_rating", + "op": "GT", + "error": "1" + }, + { + "id": "AY1FBoFCqvoSmFLK7yRz", + "metric": "new_duplicated_lines_density", + "op": "GT", + "error": "5" + }, + { + "id": "AY1FBoFDqvoSmFLK7yR0", + "metric": "new_coverage", + "op": "LT", + "error": "0" + }, + { + "id": "AY1FBoFDqvoSmFLK7yR1", + "metric": "new_blocker_violations", + "op": "GT", + "error": "0" + }, + { + "id": "AY1FBoFEqvoSmFLK7yR2", + "metric": "new_critical_violations", + "op": "GT", + "error": "0" + }, + { + "id": "AY1FBoFEqvoSmFLK7yR3", + "metric": "new_major_violations", + "op": "GT", + "error": "0" + } + ], + "isBuiltIn": false, + "actions": { + "rename": true, + "setAsDefault": true, + "copy": true, + "associateProjects": true, + "delete": true, + "manageConditions": true, + "delegate": true + }, + "caycStatus": "over-compliant" +} \ No newline at end of file diff --git a/conf/quality_gates/CNES_CAYC_Herited_coverage.json b/conf/quality_gates/CNES_CAYC_Herited_coverage.json new file mode 100644 index 0000000..b98e254 --- /dev/null +++ b/conf/quality_gates/CNES_CAYC_Herited_coverage.json @@ -0,0 +1,77 @@ +{ + "id": "AY1FFCDIqvoSmFLK7ySW", + "name": "CNES CAYCode HeritedCode with coverage", + "conditions": [ + { + "id": "AY1FFCDKqvoSmFLK7ySX", + "metric": "new_maintainability_rating", + "op": "GT", + "error": "1" + }, + { + "id": "AY1FFCDLqvoSmFLK7ySY", + "metric": "new_reliability_rating", + "op": "GT", + "error": "1" + }, + { + "id": "AY1FFCDLqvoSmFLK7ySZ", + "metric": "new_security_hotspots_reviewed", + "op": "LT", + "error": "100" + }, + { + "id": "AY1FFCDLqvoSmFLK7ySa", + "metric": "new_security_rating", + "op": "GT", + "error": "1" + }, + { + "id": "AY1FFCDMqvoSmFLK7ySb", + "metric": "new_duplicated_lines_density", + "op": "GT", + "error": "5" + }, + { + "id": "AY1FFCDMqvoSmFLK7ySc", + "metric": "new_coverage", + "op": "LT", + "error": "0" + }, + { + "id": "AY1FFCDNqvoSmFLK7ySd", + "metric": "new_blocker_violations", + "op": "GT", + "error": "0" + }, + { + "id": "AY1FFCDNqvoSmFLK7ySe", + "metric": "new_critical_violations", + "op": "GT", + "error": "0" + }, + { + "id": "AY1FFCDOqvoSmFLK7ySf", + "metric": "new_major_violations", + "op": "GT", + "error": "0" + }, + { + "id": "AY1FFSy_qvoSmFLK7ySj", + "metric": "new_line_coverage", + "op": "LT", + "error": "100" + } + ], + "isBuiltIn": false, + "actions": { + "rename": true, + "setAsDefault": true, + "copy": true, + "associateProjects": true, + "delete": true, + "manageConditions": true, + "delegate": true + }, + "caycStatus": "over-compliant" +} \ No newline at end of file diff --git a/configure-cat.bash b/configure-cat.bash index bec5308..77a9f4e 100644 --- a/configure-cat.bash +++ b/configure-cat.bash @@ -97,7 +97,7 @@ create_quality_gates(){ fi # Setting it as default quality gate - if [ "$NAME" = "CNES" ] + if [ "$NAME" = "CNES CAYCode FromScratch" ] then log_info "setting CNES quality gate as default gate." res=$(curl -su "admin:admin" \