Skip to content

Commit 146d30f

Browse files
committed
Improve SonarQube workflow and refine project config
Added debug steps to SonarQube GitHub Actions workflow for both backend and frontend to show directory structure and file counts. Enabled verbose output for SonarQube scans. Updated sonar-project.properties to specify backend source directories and refined exclusions for more accurate analysis.
1 parent e38cf8d commit 146d30f

2 files changed

Lines changed: 31 additions & 12 deletions

File tree

.github/workflows/sonarqube.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,19 @@ jobs:
1717
with:
1818
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
1919

20+
- name: Debug - Show directory structure
21+
run: |
22+
echo "=== Current directory ==="
23+
pwd
24+
echo "=== Root files ==="
25+
ls -la
26+
echo "=== src/ directory ==="
27+
ls -la src/
28+
echo "=== Python files count ==="
29+
find src/ -name "*.py" -type f | grep -v __pycache__ | grep -v migrations | wc -l
30+
echo "=== First 20 Python files ==="
31+
find src/ -name "*.py" -type f | grep -v __pycache__ | grep -v migrations | head -20
32+
2033
- name: SonarQube Scan - Backend
2134
uses: SonarSource/sonarqube-scan-action@v6
2235
env:
@@ -27,6 +40,7 @@ jobs:
2740
args: >
2841
-Dsonar.projectKey=omics-datascience_multiomix-backend
2942
-Dsonar.organization=omics-datascience
43+
-Dsonar.verbose=true
3044
3145
sonarqube-frontend:
3246
name: SonarQube Frontend Analysis
@@ -47,6 +61,17 @@ jobs:
4761
- name: Run linter and type checks
4862
run: npm --prefix src/frontend/static/frontend run check-all
4963

64+
- name: Debug - Show frontend structure
65+
run: |
66+
echo "=== Frontend directory ==="
67+
pwd
68+
echo "=== Frontend src files ==="
69+
ls -la src/frontend/static/frontend/
70+
echo "=== TypeScript files count ==="
71+
find src/frontend/static/frontend/src -type f \( -name "*.ts" -o -name "*.tsx" \) | wc -l
72+
echo "=== First 20 TypeScript files ==="
73+
find src/frontend/static/frontend/src -type f \( -name "*.ts" -o -name "*.tsx" \) | head -20
74+
5075
- name: SonarQube Scan - Frontend
5176
uses: SonarSource/sonarqube-scan-action@v6
5277
env:
@@ -57,3 +82,4 @@ jobs:
5782
args: >
5883
-Dsonar.projectKey=omics-datascience_multiomix-frontend
5984
-Dsonar.organization=omics-datascience
85+
-Dsonar.verbose=true

sonar-project.properties

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,17 @@ sonar.organization=omics-datascience
66
sonar.projectName=Multiomix Backend
77
sonar.projectVersion=1.0
88

9-
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
10-
sonar.sources=src
9+
# Path is relative to the sonar-project.properties file
10+
sonar.sources=src/api_service,src/biomarkers,src/common,src/datasets_synchronization,src/differential_expression,src/feature_selection,src/genes,src/inferences,src/institutions,src/molecules_details,src/multiomics_intermediate,src/statistical_properties,src/tags,src/user_files,src/users,src/websockets
1111

12-
# Exclude frontend, tests, migrations, and other non-backend code
13-
sonar.exclusions=**/node_modules/**,**/frontend/**,**/migrations/**,**/tests/**,**/__pycache__/**,**/venv/**,**/*.pyc,**/.venv/**,**/staticfiles/**,**/static/frontend/**
14-
15-
# Test files (commented out to avoid empty test issues)
16-
# sonar.tests=src
17-
# sonar.test.inclusions=**/tests/**,**/*_test.py,**/test_*.py
12+
# Exclude migrations, tests, cache, virtual env, and frontend
13+
sonar.exclusions=**/migrations/**,**/tests/**,**/__pycache__/**,**/venv/**,**/*.pyc,**/.venv/**,**/staticfiles/**,**/node_modules/**,**/frontend/**,**/htmlcov/**,**/email/**
1814

1915
# Python specific settings
2016
sonar.python.version=3.7,3.8,3.9,3.10,3.11
2117

2218
# Coverage reports (if you generate them)
2319
# sonar.python.coverage.reportPaths=src/.coverage
2420

25-
# Encoding of the source code. Default is default system encoding
21+
# Encoding of the source code
2622
sonar.sourceEncoding=UTF-8
27-
28-
# Language
29-
sonar.language=py

0 commit comments

Comments
 (0)