Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
1868a10
Diffuse analysis in CI (#825)
gthea Nov 10, 2025
b23f08f
Main and logger modules (#826)
gthea Nov 19, 2025
b4919de
Events module (#827)
gthea Nov 26, 2025
5f2b029
Events Manager implementation (#828)
gthea Nov 26, 2025
9148f78
API and events domain modules (#829)
gthea Nov 28, 2025
a94cac9
Event Metadata (#830)
gthea Nov 28, 2025
7c411b4
Event delivery implementation (#832)
gthea Nov 28, 2025
d6fc780
Move classes to api and events domain modules (#833)
gthea Nov 28, 2025
905d5e4
SplitEventsManager implementation (#834)
gthea Dec 4, 2025
c75832c
EventsManagerConfig requireAny as Set (#835)
gthea Dec 4, 2025
82cf13f
Remove synthetic sync events (#836)
gthea Dec 4, 2025
572f3b6
Updated flags metadata (#837)
gthea Dec 4, 2025
5dd4ff9
Ready from cache metadata (#838)
gthea Dec 4, 2025
4c55548
Sort external events dependencies (#839)
gthea Dec 9, 2025
621bcb3
New methods for SplitEventTask (#840)
gthea Dec 9, 2025
fb1c581
Metadata for killed flag (#841)
gthea Dec 10, 2025
28f5534
Integration tests for events with metadata (#842)
gthea Dec 12, 2025
a3dec44
Updated License Year (#843)
github-actions[bot] Jan 5, 2026
e061820
Metadata using Event Listener (#846)
gthea Jan 7, 2026
05c64a2
Fix segments clearance (#847)
gthea Jan 7, 2026
1bacd60
Fix publishing
gthea Jan 8, 2026
19879da
Add RBS metadata for update event (#848)
gthea Jan 8, 2026
a79dd87
Add metadata to SDK ready (#849)
gthea Jan 13, 2026
bf6701e
Expose flag names in metadata (#850)
gthea Jan 14, 2026
65dae90
Javadoc and sources fix (#851)
gthea Jan 16, 2026
c37e0b3
Merge pull request #853 from splitio/master
gthea Jan 19, 2026
a230c01
Increase test coverage (#852)
gthea Jan 19, 2026
141e298
Metadata source in events manager (#856)
gthea Jan 21, 2026
10732cd
Merge pull request #859
gthea Jan 22, 2026
177c61a
Fix test assertion
gthea Jan 22, 2026
d35b0fc
Version 5.5.0-rc1
gthea Jan 22, 2026
8a40eed
Version 5.5.0
gthea Jan 27, 2026
e722581
Update javadoc
gthea Jan 28, 2026
242099f
Merge branch 'master' into release_5.5.0
gthea Jan 28, 2026
7262106
Update CHANGES
gthea Jan 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
172 changes: 82 additions & 90 deletions .github/workflows/sonarqube.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: SonarCloud Analysis

on:
push:
branches:
- master
- development
- '*_baseline'
pull_request:
branches:
- '*'
Expand Down Expand Up @@ -41,111 +46,98 @@ jobs:
- name: Build project and run tests with coverage
run: |
# Build the project
./gradlew assembleDebug --stacktrace

# Run tests with coverage - allow test failures
./gradlew testDebugUnitTest jacocoTestReport --stacktrace
TEST_RESULT=$?
if [ $TEST_RESULT -ne 0 ]; then
echo "Some tests failed, but continuing to check for coverage data..."
# Even if tests fail, JaCoCo should generate a report with partial coverage
# from the tests that did pass
fi

- name: Prepare class files for SonarQube analysis
run: |
echo "Searching for compiled class files..."

# Create the target directory
mkdir -p build/intermediates/runtime_library_classes_dir/debug

# Find all directories containing class files with better patterns
CLASS_DIRS=$(find build -name "*.class" -type f -exec dirname {} \; | sort -u | grep -E "(javac|kotlin-classes|runtime_library)" | head -10)

if [ -z "$CLASS_DIRS" ]; then
echo "WARNING: No class files found in the build directory!"
echo "Searching in all build subdirectories..."
find build -name "*.class" -type f | head -20
./gradlew assembleDebug

# Run tests - continue even if some tests fail
./gradlew testDebugUnitTest || echo "Some tests failed, but continuing to generate coverage report..."

# Generate JaCoCo aggregate report separately (ensures it runs even if tests failed)
./gradlew jacocoRootReport

# Log report location for debugging
REPORT_PATH="build/reports/jacoco/jacocoRootReport/jacocoRootReport.xml"
if [ -f "$REPORT_PATH" ]; then
echo "✓ JaCoCo report generated at: $REPORT_PATH ($(wc -c < "$REPORT_PATH") bytes)"
else
echo "Found class files in the following directories:"
echo "$CLASS_DIRS"

# Copy classes from all relevant directories, not just the first one
for CLASS_DIR in $CLASS_DIRS; do
if [ -d "$CLASS_DIR" ] && [ "$(find "$CLASS_DIR" -name "*.class" | wc -l)" -gt 0 ]; then
echo "Copying classes from $CLASS_DIR"
cp -r "$CLASS_DIR"/* build/intermediates/runtime_library_classes_dir/debug/ 2>/dev/null || echo "Failed to copy from $CLASS_DIR"
fi
done

# Verify the target directory now has class files
CLASS_COUNT=$(find build/intermediates/runtime_library_classes_dir/debug -name "*.class" | wc -l)
echo "Target directory now contains $CLASS_COUNT class files"
echo "✗ JaCoCo report was NOT generated at: $REPORT_PATH"
fi

# Update sonar-project.properties with all found class directories
echo "" >> sonar-project.properties
echo "# Additional binary paths found during build" >> sonar-project.properties
if [ -n "$CLASS_DIRS" ]; then
# Convert newlines to commas for sonar.java.binaries
BINARY_PATHS=$(echo "$CLASS_DIRS" | tr '\n' ',' | sed 's/,$//')
echo "sonar.java.binaries=build/intermediates/runtime_library_classes_dir/debug,$BINARY_PATHS" >> sonar-project.properties
- name: Verify class files and coverage data for SonarQube analysis
run: |
echo "=== Verifying Build Artifacts for SonarQube ==="
echo ""

# Dynamically get modules from settings.gradle (extract module names from "include ':modulename'" lines)
MODULES=$(grep "^include" settings.gradle | cut -d"'" -f2 | cut -d":" -f2 | tr '\n' ' ')
echo "Detected modules: $MODULES"
echo ""

echo "Checking compiled class files for each module:"
for module in $MODULES; do
MODULE_CLASSES_DIR="${module}/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes"
if [ -d "$MODULE_CLASSES_DIR" ]; then
CLASS_COUNT=$(find "$MODULE_CLASSES_DIR" -name "*.class" | wc -l)
echo " ✓ ${module}: Found $CLASS_COUNT class files in $MODULE_CLASSES_DIR"
else
echo " ✗ ${module}: Class directory not found: $MODULE_CLASSES_DIR"
fi
done

echo ""
echo "Checking JaCoCo coverage report:"
if [ -f build/reports/jacoco/jacocoRootReport/jacocoRootReport.xml ]; then
REPORT_SIZE=$(wc -c < build/reports/jacoco/jacocoRootReport/jacocoRootReport.xml)
PACKAGE_COUNT=$(grep -c "<package" build/reports/jacoco/jacocoRootReport/jacocoRootReport.xml || echo "0")
CLASS_COUNT=$(grep -c "<class" build/reports/jacoco/jacocoRootReport/jacocoRootReport.xml || echo "0")
LINE_COUNT=$(grep -c "<line" build/reports/jacoco/jacocoRootReport/jacocoRootReport.xml || echo "0")
COVERED_LINES=$(grep -c 'ci="1"' build/reports/jacoco/jacocoRootReport/jacocoRootReport.xml || echo "0")

echo " ✓ JaCoCo report found: build/reports/jacoco/jacocoRootReport/jacocoRootReport.xml"
echo " - Size: $REPORT_SIZE bytes"
echo " - Packages: $PACKAGE_COUNT"
echo " - Classes: $CLASS_COUNT"
echo " - Lines: $LINE_COUNT"
echo " - Covered lines: $COVERED_LINES"

# Check if events module coverage is present
if grep -q 'package name="io/harness/events"' build/reports/jacoco/jacocoRootReport/jacocoRootReport.xml; then
echo " ✓ Events module (io/harness/events) coverage found in report"
else
echo " ✗ WARNING: Events module coverage NOT found in report"
fi
else
echo "sonar.java.binaries=build/intermediates/runtime_library_classes_dir/debug" >> sonar-project.properties
echo " ✗ JaCoCo report file not found"
fi

echo "Checking for JaCoCo report files..."
find build -name "*.xml" | grep jacoco || echo "No JaCoCo XML files found"
find build -name "*.exec" | grep jacoco || echo "No JaCoCo exec files found"

echo "Contents of JaCoCo report directory:"
ls -la build/reports/jacoco/jacocoTestReport/ || echo "Directory not found"


echo ""
echo "Checking test execution results:"
echo "Checking JaCoCo execution data for each module:"
for module in $MODULES; do
EXEC_FILE="${module}/build/jacoco/testDebugUnitTest.exec"
if [ -f "$EXEC_FILE" ]; then
EXEC_SIZE=$(wc -c < "$EXEC_FILE")
echo " ✓ ${module}: Found execution data ($EXEC_SIZE bytes) in $EXEC_FILE"
else
echo " ✗ ${module}: Execution data not found: $EXEC_FILE"
fi
done

echo ""
echo "Test execution summary:"
TEST_RESULT_FILES=$(find build -name "TEST-*.xml" 2>/dev/null)
if [ -n "$TEST_RESULT_FILES" ]; then
echo "Found test result files:"
echo "$TEST_RESULT_FILES"
# Count total tests, failures, errors
TOTAL_TESTS=$(cat $TEST_RESULT_FILES | grep -o 'tests="[0-9]*"' | cut -d'"' -f2 | awk '{sum+=$1} END {print sum}')
TOTAL_FAILURES=$(cat $TEST_RESULT_FILES | grep -o 'failures="[0-9]*"' | cut -d'"' -f2 | awk '{sum+=$1} END {print sum}')
TOTAL_ERRORS=$(cat $TEST_RESULT_FILES | grep -o 'errors="[0-9]*"' | cut -d'"' -f2 | awk '{sum+=$1} END {print sum}')
echo "Test summary: $TOTAL_TESTS tests, $TOTAL_FAILURES failures, $TOTAL_ERRORS errors"
echo " Tests: $TOTAL_TESTS | Failures: $TOTAL_FAILURES | Errors: $TOTAL_ERRORS"
else
echo "No test result files found"
echo " No test result files found"
fi

echo ""
echo "Checking JaCoCo report content:"
if [ -f build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml ]; then
echo "Report file size: $(wc -c < build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml) bytes"
echo "First 500 chars of report:"
head -c 500 build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml
echo ""
echo ""
echo "Counting coverage elements:"
grep -c "<package" build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml || echo "No packages found"
grep -c "<class" build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml || echo "No classes found"
grep -c "<method" build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml || echo "No methods found"
grep -c "<line" build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml || echo "No lines found"
grep -c 'ci="1"' build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml || echo "No covered lines found"
else
echo "JaCoCo report file not found"
fi

echo ""
echo "Checking binary directories specified in sonar-project.properties:"
echo "build/intermediates/runtime_library_classes_dir/debug:"
ls -la build/intermediates/runtime_library_classes_dir/debug || echo "Directory not found"

echo ""
echo "Checking all available class directories:"
find build -path "*/build/*" -name "*.class" | head -n 10 || echo "No class files found"

echo ""
echo "Final sonar-project.properties content:"
echo "SonarQube configuration (sonar-project.properties):"
cat sonar-project.properties
echo ""
echo "=== Verification Complete ==="

- name: SonarCloud Scan
uses: SonarSource/sonarqube-scan-action@v7
Expand Down
Loading
Loading