fix: v9.14.1 — Bug #663 race condition in upsert_points drops shared … #1000
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI/CD with Auto Release | |
| on: | |
| push: | |
| branches: [ master, main, develop, development, staging ] | |
| pull_request: | |
| branches: [ master, main ] | |
| permissions: | |
| contents: write # Allow creating tags and releases | |
| actions: read # Allow reading workflow runs | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.9', '3.10', '3.11', '3.12'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python3 -m pip install -e third_party/hnswlib --break-system-packages | |
| python3 -m pip install -e ".[dev]" --break-system-packages | |
| - name: Run parity tests | |
| run: | | |
| python3 -m pytest tests/integration/parity/ -v --tb=short | |
| - name: Run server smoke tests | |
| run: | | |
| python3 -m pytest tests/unit/server/storage/test_factory.py tests/unit/server/mcp/test_protocol.py tests/unit/services/test_database_health_cluster.py -v --tb=short --deselect=tests/unit/server/storage/test_factory.py::TestSQLiteProtocolSatisfaction::test_dependency_map_tracking_satisfies_protocol | |
| - name: Generate parity matrix | |
| if: always() | |
| run: | | |
| python3 scripts/generate_parity_matrix.py || echo "Parity matrix generation failed (script may not exist yet)" | |
| - name: Upload parity matrix | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: parity-matrix-py${{ matrix.python-version }} | |
| path: docs/mcp-rest-parity-matrix.md | |
| if-no-files-found: ignore | |
| check-version: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version_changed: ${{ steps.check_version.outputs.version_changed }} | |
| current_version: ${{ steps.check_version.outputs.current_version }} | |
| previous_version: ${{ steps.check_version.outputs.previous_version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| submodules: recursive | |
| - name: Get current version | |
| id: get_version | |
| run: | | |
| echo "current_version=$(python3 -c "import sys; sys.path.insert(0, 'src'); from code_indexer import __version__; print(__version__)")" >> $GITHUB_OUTPUT | |
| - name: Check if version file changed | |
| run: | | |
| if git diff --name-only HEAD~1 HEAD | grep -q "src/code_indexer/__init__.py"; then | |
| echo "version_file_changed=true" >> $GITHUB_ENV | |
| else | |
| echo "version_file_changed=false" >> $GITHUB_ENV | |
| fi | |
| - name: Get previous version | |
| if: env.version_file_changed == 'true' | |
| run: | | |
| echo "previous_version=$(git show HEAD~1:src/code_indexer/__init__.py | grep '__version__' | cut -d'\"' -f2)" >> $GITHUB_ENV | |
| - name: Check if version changed | |
| id: check_version | |
| run: | | |
| current_version="${{ steps.get_version.outputs.current_version }}" | |
| echo "current_version=$current_version" >> $GITHUB_OUTPUT | |
| if [ "${{ env.version_file_changed }}" = "true" ]; then | |
| previous_version="${{ env.previous_version }}" | |
| echo "previous_version=$previous_version" >> $GITHUB_OUTPUT | |
| if [ "$current_version" != "$previous_version" ]; then | |
| echo "version_changed=true" >> $GITHUB_OUTPUT | |
| echo "Version changed from $previous_version to $current_version" | |
| else | |
| echo "version_changed=false" >> $GITHUB_OUTPUT | |
| echo "Version file modified but version unchanged: $current_version" | |
| fi | |
| else | |
| echo "version_changed=false" >> $GITHUB_OUTPUT | |
| echo "Version file not modified: $current_version" | |
| fi | |
| create-tag: | |
| runs-on: ubuntu-latest | |
| needs: [check-version] | |
| if: | | |
| needs.check-version.outputs.version_changed == 'true' && | |
| github.ref == 'refs/heads/development' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Create and Push Tag | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| # Extract version | |
| VERSION="${{ needs.check-version.outputs.current_version }}" | |
| # Check if tag already exists on remote (pushed manually) | |
| if git ls-remote --tags origin "refs/tags/v$VERSION" | grep -q "v$VERSION"; then | |
| echo "Tag v$VERSION already exists on remote -- skipping creation" | |
| exit 0 | |
| fi | |
| # Create git tag | |
| git config user.name github-actions | |
| git config user.email github-actions@github.com | |
| git tag "v$VERSION" -m "Release version $VERSION" | |
| git push origin "v$VERSION" | |
| echo "Created and pushed tag v$VERSION from development branch" | |
| create-release: | |
| runs-on: ubuntu-latest | |
| needs: [check-version] | |
| if: | | |
| needs.check-version.outputs.version_changed == 'true' && | |
| github.ref == 'refs/heads/master' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.11 | |
| - name: Install build dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python3 -m pip install build twine --break-system-packages | |
| - name: Build package | |
| run: | | |
| python3 -m build | |
| - name: Create GitHub Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| # Extract version | |
| VERSION="${{ needs.check-version.outputs.current_version }}" | |
| # Check if release already exists (created from prior branch push) | |
| if gh release view "v$VERSION" &>/dev/null; then | |
| echo "Release v$VERSION already exists -- uploading dist artifacts only" | |
| gh release upload "v$VERSION" dist/* --clobber || true | |
| exit 0 | |
| fi | |
| # Create GitHub release with auto-generated notes using existing tag | |
| gh release create "v$VERSION" \ | |
| --title "Release v$VERSION" \ | |
| --generate-notes \ | |
| --draft=false \ | |
| --prerelease=false \ | |
| dist/* | |
| echo "Created GitHub release v$VERSION from master branch" |