|
| 1 | +# TEMPORARY — engineer-bot end-to-end verification (DO NOT MERGE; removed before finalize). |
| 2 | +# |
| 3 | +# The real engineer-bot.yml triggers on issues/workflow_dispatch, which only |
| 4 | +# register from the default branch — so they can't run on this PR branch. This |
| 5 | +# pull_request-triggered clone exercises the engineer AUTHOR path on the branch: |
| 6 | +# poetry install, .bot/config.yaml load, prompt resolution, and the author agent. |
| 7 | +# It runs AUTHOR ONLY (no publish) against a fixed throwaway issue (#864), so it |
| 8 | +# cannot open a spurious fix PR. Delete this file before marking #862 ready. |
| 9 | +name: engineer-bot-e2e (TEMP) |
| 10 | + |
| 11 | +on: |
| 12 | + pull_request: |
| 13 | + types: [synchronize] # re-run by pushing; avoids auto-run on every event type |
| 14 | + workflow_dispatch: {} |
| 15 | + |
| 16 | +permissions: |
| 17 | + contents: read |
| 18 | + id-token: write |
| 19 | + |
| 20 | +jobs: |
| 21 | + author-e2e: |
| 22 | + if: github.event.pull_request.head.repo.fork == false |
| 23 | + environment: azure-prod |
| 24 | + runs-on: |
| 25 | + group: databricks-protected-runner-group |
| 26 | + labels: [linux-ubuntu-latest] |
| 27 | + timeout-minutes: 45 |
| 28 | + steps: |
| 29 | + - name: Checkout (PR head — the branch under test) |
| 30 | + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 31 | + with: |
| 32 | + fetch-depth: 0 |
| 33 | + persist-credentials: false |
| 34 | + |
| 35 | + - name: Mint engineer-bot App token |
| 36 | + id: setup |
| 37 | + uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 |
| 38 | + with: |
| 39 | + app-id: ${{ secrets.ENGINEER_BOT_APP_ID }} |
| 40 | + private-key: ${{ secrets.ENGINEER_BOT_APP_PRIVATE_KEY }} |
| 41 | + |
| 42 | + - name: Setup Python |
| 43 | + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 |
| 44 | + with: |
| 45 | + python-version: '3.11' |
| 46 | + |
| 47 | + - name: Setup Node (for the Claude Code CLI the SDK spawns) |
| 48 | + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 |
| 49 | + with: |
| 50 | + node-version: '20' |
| 51 | + |
| 52 | + - name: Mint engine-scoped install token |
| 53 | + id: engine-token |
| 54 | + uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 |
| 55 | + with: |
| 56 | + app-id: ${{ secrets.ENGINEER_BOT_APP_ID }} |
| 57 | + private-key: ${{ secrets.ENGINEER_BOT_APP_PRIVATE_KEY }} |
| 58 | + owner: databricks |
| 59 | + repositories: databricks-bot-engine |
| 60 | + permission-contents: read |
| 61 | + |
| 62 | + - name: Install engine + Claude SDK/CLI |
| 63 | + uses: ./.github/actions/install-bot-engine |
| 64 | + with: |
| 65 | + engine-ref: b6205fb502566d617a456ccf3c37f3e4e3072ccd |
| 66 | + engine-token: ${{ steps.engine-token.outputs.token }} |
| 67 | + |
| 68 | + - name: Install connector deps (for pytest self-verify) |
| 69 | + run: | |
| 70 | + python -m pip install --upgrade poetry |
| 71 | + poetry install --no-interaction |
| 72 | +
|
| 73 | + - name: Resolve test issue #864 + gather context |
| 74 | + id: ctx |
| 75 | + env: |
| 76 | + GH_TOKEN: ${{ steps.setup.outputs.token }} |
| 77 | + REPO: ${{ github.repository }} |
| 78 | + run: | |
| 79 | + RAW=864 |
| 80 | + gh issue view "$RAW" --repo "$REPO" --json number,title,url,body > "$RUNNER_TEMP/issue.json" |
| 81 | + jq -r '.body // ""' "$RUNNER_TEMP/issue.json" > "$RUNNER_TEMP/issue_body.txt" |
| 82 | + TITLE="$(jq -r '.title // ""' "$RUNNER_TEMP/issue.json")" |
| 83 | + URL="$(jq -r '.url // ""' "$RUNNER_TEMP/issue.json")" |
| 84 | + { echo "ISSUE_NUMBER=$RAW"; echo "ISSUE_URL=$URL"; } >> "$GITHUB_ENV" |
| 85 | + DELIM="GHEOF_$(date +%s%N)${RANDOM}" |
| 86 | + { echo "ISSUE_TITLE<<$DELIM"; printf '%s\n' "$TITLE"; echo "$DELIM"; } >> "$GITHUB_ENV" |
| 87 | +
|
| 88 | + # AUTHOR ONLY — no publish. Confirms .bot/config.yaml loads, prompts |
| 89 | + # resolve, and the bug-fix author agent runs to a structured outcome. |
| 90 | + - name: Run author (bug-fix) — VERIFY ONLY |
| 91 | + env: |
| 92 | + MODEL_ENDPOINT: https://${{ secrets.DATABRICKS_HOST }}/serving-endpoints/databricks-claude-opus-4-8/invocations |
| 93 | + DATABRICKS_TOKEN: ${{ secrets.DATABRICKS_TOKEN }} |
| 94 | + TEST_REPO_ROOT: ${{ github.workspace }} |
| 95 | + RUNNER_TEMP: ${{ runner.temp }} |
| 96 | + working-directory: ${{ runner.temp }} |
| 97 | + run: >- |
| 98 | + python -m databricks_bot_engine.engineer_bot.run --phase author |
| 99 | + --system-prompt "$GITHUB_WORKSPACE/.bot/prompts/engineer/system.md" |
| 100 | + --user-prompt "$GITHUB_WORKSPACE/.bot/prompts/engineer/user.md" |
0 commit comments