From 7d2321019de6457abdfc71fba692b80bad3c4df4 Mon Sep 17 00:00:00 2001 From: Rajat Ahuja Date: Wed, 10 Dec 2025 15:10:17 -0500 Subject: [PATCH] fix: CodeRabbit comments --- .github/workflows/start-fly-runner.yml | 12 +++++++++++- .github/workflows/unified-tests.yml | 13 ++----------- pyproject.toml | 2 +- tests/unified/runner.py | 6 ++---- uv.lock | 4 ++-- 5 files changed, 18 insertions(+), 19 deletions(-) diff --git a/.github/workflows/start-fly-runner.yml b/.github/workflows/start-fly-runner.yml index 7f20e18a..0ecb6172 100644 --- a/.github/workflows/start-fly-runner.yml +++ b/.github/workflows/start-fly-runner.yml @@ -25,6 +25,9 @@ jobs: start-runner: name: Start Fly Runner runs-on: ubuntu-latest + permissions: + actions: read + contents: read outputs: runner-ready: ${{ steps.wait-for-runner.outputs.ready }} machine-id: ${{ steps.machine-management.outputs.machine-id }} @@ -53,6 +56,13 @@ jobs: echo "Getting app info for ${FLY_RUNNER_APP}..." flyctl status -a "${FLY_RUNNER_APP}" + - name: Set GH_TOKEN in Fly secrets + env: + FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN_TESTING }} + run: | + echo "Setting GH_TOKEN in Fly secrets..." + flyctl secrets set GH_TOKEN="${{ secrets.GH_TOKEN_ACTIONS }}" -a "${FLY_RUNNER_APP}" + - name: Fly machine management id: machine-management env: @@ -99,10 +109,10 @@ jobs: echo "📁 Using available volume: $AVAILABLE_VOLUME" # Create new machine with the available volume + # Note: GH_TOKEN should be set via Fly secrets: flyctl secrets set GH_TOKEN=... FULL_OUTPUT=$(flyctl machines run "${FLY_RUNNER_IMAGE}" \ -a "${FLY_RUNNER_APP}" \ --region "${FLY_RUNNER_REGION}" \ - --env GH_TOKEN=${{ secrets.GH_TOKEN_ACTIONS }} \ --env RUN_ID=${{ github.run_id }} \ --env TEST_TYPE="honcho-unified-runner" \ --vm-size shared-cpu-8x \ diff --git a/.github/workflows/unified-tests.yml b/.github/workflows/unified-tests.yml index 6bb1744e..63e46f43 100644 --- a/.github/workflows/unified-tests.yml +++ b/.github/workflows/unified-tests.yml @@ -8,6 +8,7 @@ on: permissions: contents: read + actions: read jobs: start-runner: @@ -15,20 +16,10 @@ jobs: uses: ./.github/workflows/start-fly-runner.yml secrets: inherit - wait-for-runner: - name: Wait for Runner - runs-on: ubuntu-latest - needs: start-runner - if: needs.start-runner.outputs.runner-ready == 'true' - steps: - - run: | - echo "✅ Runner is ready. Waiting a few seconds before scheduling tests..." - sleep 5 - unified-tests: name: Run Unified Tests runs-on: ${{ fromJSON(format('[{0}]', needs.start-runner.outputs.runner-labels)) }} - needs: [start-runner, wait-for-runner] + needs: start-runner if: needs.start-runner.outputs.runner-ready == 'true' timeout-minutes: 90 environment: unified-tests diff --git a/pyproject.toml b/pyproject.toml index e37bcbd3..51d6d8f0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,6 @@ dependencies = [ "json-repair>=0.49.0", "redis>=6.0.0", "cashews[redis]==7.4.1", - "boto3>=1.42.5", ] [tool.uv] dev-dependencies = [ @@ -52,6 +51,7 @@ dev-dependencies = [ "honcho-ai", "fakeredis>=2.32.0", "scipy>=1.15.3", + "boto3>=1.42.5", ] [tool.uv.workspace] diff --git a/tests/unified/runner.py b/tests/unified/runner.py index 1bd0538f..3c694c60 100644 --- a/tests/unified/runner.py +++ b/tests/unified/runner.py @@ -75,8 +75,8 @@ async def send_discord_message(webhook_url: str, message: str) -> None: response = await client.post(webhook_url, json={"content": message}) response.raise_for_status() logger.info("Discord notification sent successfully") - except Exception as e: - logger.error(f"Failed to send Discord notification: {e}", exc_info=True) + except Exception: + logger.exception("Failed to send Discord notification") async def save_results_to_s3( @@ -96,8 +96,6 @@ async def save_results_to_s3( # AWS credentials are configured via OIDC in GitHub Actions # Check if boto3 can access credentials (either from environment or OIDC) try: - import boto3 - session = boto3.Session() credentials = session.get_credentials() # pyright: ignore if not credentials: diff --git a/uv.lock b/uv.lock index 454d741b..31a90b40 100644 --- a/uv.lock +++ b/uv.lock @@ -742,7 +742,6 @@ version = "2.5.0" source = { virtual = "." } dependencies = [ { name = "alembic" }, - { name = "boto3" }, { name = "cashews", extra = ["redis"] }, { name = "fastapi", extra = ["standard"] }, { name = "fastapi-pagination" }, @@ -774,6 +773,7 @@ dependencies = [ [package.dev-dependencies] dev = [ { name = "basedpyright" }, + { name = "boto3" }, { name = "coverage" }, { name = "fakeredis" }, { name = "honcho-ai" }, @@ -792,7 +792,6 @@ dev = [ [package.metadata] requires-dist = [ { name = "alembic", specifier = ">=1.14.0" }, - { name = "boto3", specifier = ">=1.42.5" }, { name = "cashews", extras = ["redis"], specifier = "==7.4.1" }, { name = "fastapi", extras = ["standard"], specifier = ">=0.111.0" }, { name = "fastapi-pagination", specifier = ">=0.12.24" }, @@ -824,6 +823,7 @@ requires-dist = [ [package.metadata.requires-dev] dev = [ { name = "basedpyright", specifier = ">=1.29.4" }, + { name = "boto3", specifier = ">=1.42.5" }, { name = "coverage", specifier = ">=7.6.0" }, { name = "fakeredis", specifier = ">=2.32.0" }, { name = "honcho-ai", editable = "sdks/python" },