E2E tests for R2/S3 bucket flows and Rust→Swift fleet upgrade #336
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: Codex Review | |
| on: | |
| issue_comment: | |
| types: [created] | |
| pull_request_review_comment: | |
| types: [created] | |
| pull_request_review: | |
| types: [submitted] | |
| jobs: | |
| codex: | |
| if: | | |
| (github.event_name == 'issue_comment' && github.event.issue.pull_request != null && contains(github.event.comment.body, '@codex')) || | |
| (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@codex')) || | |
| (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@codex')) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| issues: write | |
| outputs: | |
| final_message: ${{ steps.run_codex.outputs.final-message }} | |
| pr_number: ${{ steps.pr.outputs.number }} | |
| steps: | |
| - name: Resolve PR number | |
| id: pr | |
| env: | |
| EVENT_NAME: ${{ github.event_name }} | |
| ISSUE_NUMBER: ${{ github.event.issue.number }} | |
| PR_NUMBER: ${{ github.event.pull_request.number }} | |
| run: | | |
| if [ "$EVENT_NAME" = "issue_comment" ]; then | |
| echo "number=$ISSUE_NUMBER" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "number=$PR_NUMBER" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Get PR metadata | |
| id: meta | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| REPO: ${{ github.repository }} | |
| PR_NUMBER: ${{ steps.pr.outputs.number }} | |
| run: | | |
| json=$(gh api "repos/$REPO/pulls/$PR_NUMBER") | |
| echo "head_sha=$(echo "$json" | jq -r '.head.sha')" >> "$GITHUB_OUTPUT" | |
| echo "base_sha=$(echo "$json" | jq -r '.base.sha')" >> "$GITHUB_OUTPUT" | |
| echo "base_ref=$(echo "$json" | jq -r '.base.ref')" >> "$GITHUB_OUTPUT" | |
| { | |
| echo "title<<EOF" | |
| echo "$json" | jq -r '.title // ""' | |
| echo "EOF" | |
| echo "body<<EOF" | |
| echo "$json" | jq -r '.body // ""' | |
| echo "EOF" | |
| } >> "$GITHUB_OUTPUT" | |
| - name: Checkout PR merge commit | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.0 | |
| with: | |
| ref: refs/pull/${{ steps.pr.outputs.number }}/merge | |
| fetch-depth: 0 | |
| - name: Pre-fetch base and head refs | |
| env: | |
| PR_BASE_REF: ${{ steps.meta.outputs.base_ref }} | |
| PR_NUMBER: ${{ steps.pr.outputs.number }} | |
| run: | | |
| git fetch --no-tags origin \ | |
| "$PR_BASE_REF" \ | |
| "+refs/pull/$PR_NUMBER/head" | |
| - name: Run Codex | |
| id: run_codex | |
| uses: openai/codex-action@c25d10f3f498316d4b2496cc4c6dd58057a7b031 # v1 | |
| with: | |
| openai-api-key: ${{ secrets.OPENAI_API_KEY }} | |
| sandbox: read-only | |
| prompt: | | |
| You are reviewing PR #${{ steps.pr.outputs.number }} for ${{ github.repository }} — the Darkbloom / d-inference decentralized inference project. | |
| Review ONLY the changes introduced by this PR. Inspect the diff with: | |
| git log --oneline ${{ steps.meta.outputs.base_sha }}...${{ steps.meta.outputs.head_sha }} | |
| git diff ${{ steps.meta.outputs.base_sha }}...${{ steps.meta.outputs.head_sha }} | |
| Focus on, in order of importance: | |
| 1. Correctness and regressions — broken imports, missing protocol symmetry between `provider/src/protocol.rs` (Rust) and `coordinator/internal/protocol/messages.go` (Go), release-bundle consistency across `scripts/build-bundle.sh` / `scripts/install.sh` / `LatestProviderVersion`, untested edge cases. | |
| 2. Security — leaked secrets, skipped attestation or auth, unsafe eval of user input, weakened sandboxing. | |
| 3. Test coverage — per CLAUDE.md every non-trivial change ships with a test; bug fixes ship with a regression test. | |
| 4. Adherence to project conventions in `CLAUDE.md` and `CONTRIBUTING.md`. | |
| Be concise and specific. Reference exact file paths and line numbers. Keep feedback under ~400 words. If the PR is clean, say so briefly. | |
| PR title: | |
| ${{ steps.meta.outputs.title }} | |
| PR body: | |
| ${{ steps.meta.outputs.body }} | |
| post_feedback: | |
| runs-on: ubuntu-latest | |
| needs: codex | |
| if: needs.codex.outputs.final_message != '' | |
| permissions: | |
| issues: write | |
| pull-requests: write | |
| steps: | |
| - name: Post Codex feedback as PR comment | |
| uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7 | |
| env: | |
| CODEX_FINAL_MESSAGE: ${{ needs.codex.outputs.final_message }} | |
| PR_NUMBER: ${{ needs.codex.outputs.pr_number }} | |
| with: | |
| github-token: ${{ github.token }} | |
| script: | | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: Number(process.env.PR_NUMBER), | |
| body: `### Codex review\n\n${process.env.CODEX_FINAL_MESSAGE}`, | |
| }); |