Skip to content

Fix intermittent streaming response aggregation test failure (#4135) #19

Fix intermittent streaming response aggregation test failure (#4135)

Fix intermittent streaming response aggregation test failure (#4135) #19

name: Maintenance Push – Fast
on:
push:
branches: ['*.*.x']
jobs:
fast-impacted:
if: contains(github.event.head_commit.message, '(cherry picked from commit')
runs-on: ubuntu-latest
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 2 } # Need HEAD and HEAD~1 for single commit diff
- uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Show commit range
run: |
echo "Base ref: origin/$GITHUB_REF_NAME"
git log --oneline "origin/$GITHUB_REF_NAME...HEAD"
- name: Compute impacted modules
id: mods
run: |
echo "=== Module Detection Debug Info ==="
echo "Environment variables:"
echo " GITHUB_REF_NAME: $GITHUB_REF_NAME"
echo " GITHUB_REF: $GITHUB_REF"
echo " PWD: $(pwd)"
echo ""
echo "Git state verification:"
echo " HEAD: $(git rev-parse HEAD 2>/dev/null || echo 'FAILED')"
echo " HEAD~1: $(git rev-parse HEAD~1 2>/dev/null || echo 'NOT AVAILABLE')"
echo " Branch: $(git branch --show-current 2>/dev/null || echo 'DETACHED')"
echo ""
echo "Testing different git diff approaches:"
echo "1. HEAD~1..HEAD:"
git diff --name-only HEAD~1..HEAD 2>&1 | head -10 || echo " FAILED: $?"
echo "2. git show HEAD:"
git show --name-only --format= HEAD 2>&1 | head -10 || echo " FAILED: $?"
echo "3. Recent commits:"
git log --oneline -3 2>/dev/null || echo " Git log failed"
echo ""
echo "=== Running test_discovery.py with full debugging ==="
set -x # Enable bash debug mode
MODS=$(python3 .github/scripts/test_discovery.py modules-from-diff --base "origin/$GITHUB_REF_NAME" --verbose 2>&1)
EXIT_CODE=$?
set +x # Disable bash debug mode
echo ""
echo "=== Test Discovery Results ==="
echo "Exit code: $EXIT_CODE"
echo "Output:"
echo "$MODS"
echo ""
# Extract just the module list (last line that isn't stderr logging)
MODULE_LIST=$(echo "$MODS" | grep -v "^Detected base ref:" | grep -v "^Changed files" | grep -v "^Final module list:" | tail -1)
echo "Extracted modules: '$MODULE_LIST'"
echo "modules=$MODULE_LIST" >> "$GITHUB_OUTPUT"
- name: Test affected modules with integration tests
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
SPRING_AI_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
MODS="${{ steps.mods.outputs.modules }}"
if [ -z "$MODS" ]; then
echo "ERROR: No modules detected - git diff failed to find changes"
echo "This likely indicates a problem with the git diff strategy"
echo "Failing fast to avoid wasted resources and investigate the issue"
echo "Check the 'Compute impacted modules' step output for debugging info"
exit 1
fi
./mvnw -B -T 1C -Pintegration-tests -DfailIfNoTests=false -pl "$MODS" verify \
-Dorg.slf4j.simpleLogger.log.org.testcontainers=WARN \
-Dorg.slf4j.simpleLogger.log.com.github.dockerjava=WARN \
-Dorg.slf4j.simpleLogger.log.org.testcontainers.dockerclient=ERROR \
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer=WARN \
-Dlogging.level.org.testcontainers=WARN \
-Dlogging.level.com.github.dockerjava=WARN