fix: no infinite soup search for query misses #1313
Workflow file for this run
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: cloud storage code check | |
| on: | |
| pull_request: | |
| branches: [ 'main' ] | |
| concurrency: | |
| group: code-check-cloud-storage-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| path-check: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| should_run: ${{ steps.filter.outputs.should_run }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| should_run: | |
| - 'rust/cloud-storage/**' | |
| - .github/workflows/code-check-cloud-storage.yml | |
| check: | |
| needs: path-check | |
| if: needs.path-check.outputs.should_run == 'true' && github.event.pull_request.draft == false | |
| runs-on: linux-latest-middy | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUSTFLAGS: "-Dwarnings" | |
| RUSTDOCFLAGS: "-Dwarnings" | |
| SQLX_OFFLINE: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/setup-rust | |
| - name: fmt | |
| run: | | |
| cd rust/cloud-storage | |
| cargo fmt --check | |
| - name: clippy | |
| run: | | |
| cd rust/cloud-storage | |
| cargo clippy --all-features | |
| test: | |
| needs: path-check | |
| if: needs.path-check.outputs.should_run == 'true' && github.event.pull_request.draft == false | |
| runs-on: linux-latest-beefy | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_USER: user | |
| POSTGRES_PASSWORD: password | |
| POSTGRES_DB: macrodb # Start with macrodb, we initialize all others in the cloud-storage/justfile | |
| ports: | |
| - 5432:5432 | |
| # needed because the postgres container does not provide a healthcheck | |
| options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/setup-rust | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('rust/cloud-storage/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: install dependencies | |
| run: | | |
| command -v just || cargo install just | |
| command -v sqlx || cargo install sqlx-cli | |
| command -v cargo-nextest || cargo install cargo-nextest | |
| - name: prepare tests | |
| run: | | |
| just rust/cloud-storage/setup_test_envs | |
| just rust/cloud-storage/initialize_dbs | |
| - name: run tests | |
| run: | | |
| cd rust/cloud-storage | |
| cargo nextest run --all-features | |
| diff-check: | |
| needs: path-check | |
| if: needs.path-check.outputs.should_run == 'true' && github.event.pull_request.draft == false | |
| runs-on: ubuntu-latest | |
| outputs: | |
| docx-unzip-handler: ${{ steps.changes.outputs.docx-unzip-handler }} | |
| worker-trigger: ${{ steps.changes.outputs.worker-trigger }} | |
| document-text-extractor: ${{ steps.changes.outputs.document-text-extractor }} | |
| organization_retention_trigger: ${{ steps.changes.outputs.organization_retention_trigger }} | |
| organization_retention_handler: ${{ steps.changes.outputs.organization_retention_handler }} | |
| delete_chat_handler: ${{ steps.changes.outputs.delete_chat_handler }} | |
| search_upload_handler: ${{ steps.changes.outputs.search_upload_handler }} | |
| upload_extractor_lambda_trigger: ${{ steps.changes.outputs.upload_extractor_lambda_trigger }} | |
| upload_extractor_lambda_handler: ${{ steps.changes.outputs.upload_extractor_lambda_handler }} | |
| email_suppression_handler: ${{ steps.changes.outputs.email_suppression_handler }} | |
| deleted_item_poller: ${{ steps.changes.outputs.deleted_item_poller }} | |
| email_refresh_handler: ${{ steps.changes.outputs.email_refresh_handler }} | |
| email_scheduled_handler: ${{ steps.changes.outputs.email_scheduled_handler }} | |
| user_link_cleanup_handler: ${{ steps.changes.outputs.user_link_cleanup_handler }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: whutchinson98/[email protected] | |
| id: changes | |
| with: | |
| token: ${{ GITHUB.TOKEN }} | |
| diff: | | |
| docx-unzip-handler: ./rust/cloud-storage/docx-unzip-handler/* | |
| worker-trigger: ./rust/cloud-storage/worker-trigger/* | |
| document-text-extractor: ./rust/cloud-storage/document-text-extractor/* | |
| organization_retention_trigger: ./rust/cloud-storage/organization_retention_trigger/* | |
| organization_retention_handler: ./rust/cloud-storage/organization_retention_handler/* | |
| delete_chat_handler: ./rust/cloud-storage/delete_chat_handler/* | |
| search_upload_handler: ./rust/cloud-storage/search_upload_handler/* | |
| upload_extractor_lambda_trigger: ./rust/cloud-storage/upload_extractor_lambda_trigger/* | |
| upload_extractor_lambda_handler: ./rust/cloud-storage/upload_extractor_lambda_handler/* | |
| email_suppression_handler: ./rust/cloud-storage/email_suppression_handler/* | |
| deleted_item_poller: ./rust/cloud-storage/deleted_item_poller/* | |
| email_refresh_handler: ./rust/cloud-storage/email_refresh_handler/* | |
| email_scheduled_handler: ./rust/cloud-storage/email_scheduled_handler/* | |
| user_link_cleanup_handler: ./rust/cloud-storage/user_link_cleanup_handler/* | |
| lambda_aggregate_frecency: ./rust/cloud-storage/lambda_aggregate_frecency/* | |
| check-lambdas: | |
| needs: diff-check | |
| runs-on: ubuntu-latest | |
| if: github.event.pull_request.draft == false | |
| strategy: | |
| # we want to fail the particular item that failed not all of them. | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - service: docx-unzip-handler | |
| - service: worker-trigger | |
| - service: document-text-extractor | |
| - service: organization_retention_trigger | |
| - service: organization_retention_handler | |
| - service: delete_chat_handler | |
| - service: search_upload_handler | |
| - service: upload_extractor_lambda_trigger | |
| - service: upload_extractor_lambda_handler | |
| - service: email_suppression_handler | |
| - service: deleted_item_poller | |
| - service: email_refresh_handler | |
| - service: email_scheduled_handler | |
| - service: user_link_cleanup_handler | |
| steps: | |
| - name: setup env var | |
| shell: bash | |
| run: | | |
| echo "Check for ${{ matrix.service }}" | |
| echo "SHOULD_RUN=${{ needs.diff-check.outputs[matrix.service] }}" >> $GITHUB_ENV | |
| - uses: actions/checkout@v4 | |
| if: env.SHOULD_RUN == 'true' | |
| - name: check if lambda is built | |
| if: env.SHOULD_RUN == 'true' | |
| run: | | |
| echo "Checking diff to ensure bootstrap.zip is part of PR" | |
| git fetch origin ${{ github.base_ref }} | |
| if ! git diff --name-only --diff-filter=AM origin/${{ github.base_ref }} HEAD | grep "rust/cloud-storage/target/lambda/${{ matrix.service }}/bootstrap.zip" > /dev/null; then | |
| echo "Code changes detected, but new bootstrap.zip for ${{matrix.service}} not found in PR. Please run: just rust/cloud-storage/${{matrix.service}}/build to build and commit bootstrap.zip. Alternatively you can run just rust/cloud-storage/build_lambads to build all lambdas." | |
| exit 1 | |
| fi | |
| # Collector job that always runs - use this as the required status check | |
| status-check: | |
| name: Cloud Storage Status Check | |
| if: always() | |
| needs: [path-check, check, test, diff-check, check-lambdas] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check job results | |
| run: | | |
| echo "path-check: ${{ needs.path-check.result }}" | |
| echo "check: ${{ needs.check.result }}" | |
| echo "test: ${{ needs.test.result }}" | |
| echo "diff-check: ${{ needs.diff-check.result }}" | |
| echo "check-lambdas: ${{ needs.check-lambdas.result }}" | |
| # Fail if any job failed (skipped and success are both OK) | |
| if [[ "${{ needs.path-check.result }}" == "failure" ]] || \ | |
| [[ "${{ needs.check.result }}" == "failure" ]] || \ | |
| [[ "${{ needs.test.result }}" == "failure" ]] || \ | |
| [[ "${{ needs.diff-check.result }}" == "failure" ]] || \ | |
| [[ "${{ needs.check-lambdas.result }}" == "failure" ]]; then | |
| echo "❌ One or more jobs failed" | |
| exit 1 | |
| fi | |
| echo "✅ All jobs passed or were skipped" |