The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:
TypeScript analyticsbibusiness-intelligencebusinessintelligenceclojuredashboarddatadata-analysisdata-visualizationdatabasemetabasemysqlpostgrespostgresqlreportingslacksql-editorvisualization
Repro Bot Enabling (#70823)
Nathan Voxland21c8136e7e6f
diff --git a/.github/workflows/repro-bot.yml b/.github/workflows/repro-bot.ymlindex 45e67420218..36809ec09cc 100644--- a/.github/workflows/repro-bot.yml+++ b/.github/workflows/repro-bot.yml@@ -10,6 +10,11 @@ on:description: "Issue number to reproduce"required: truetype: string+ repro_bot_branch:+ description: "Branch of repro-bot to use"+ required: false+ default: "main"+ type: stringjobs:repro-bot:@@ -36,48 +41,100 @@ jobs:echo "number=${{ github.event.issue.number }}" >> $GITHUB_OUTPUTfi+ - uses: actions/checkout@v4+ - uses: ./.github/actions/prepare-backend+ - uses: ./.github/actions/prepare-frontend+- name: Checkout repro-bot- uses: actions/checkout@v4+ uses: actions/checkout@v6with:repository: metabase/repro-bot- ref: ci-support+ ref: ${{ github.event.inputs.repro_bot_branch || 'main' }}token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}+ path: repro-bot- name: Pre-clone metabase bare git repo- run: git clone --bare https://github.com/metabase/metabase.git git/metabase-- - name: Set up Java- uses: actions/setup-java@v4- with:- distribution: 'temurin'- java-version: '21'+ run: git clone --bare .git repro-bot/git/metabase- - name: Set up Python (uv)- uses: astral-sh/setup-uv@v4+ - name: Capture Node.js path for MCP subprocesses+ run: echo "NODE_BIN_DIR=$(dirname $(which node))" >> $GITHUB_ENV- name: Install playwright-clirun: |npm install -g @playwright/cli@latestplaywright-cli install --skills+ - name: Install bbin and clj-nrepl-eval+ run: |+ # Install babashka+ curl -sLO https://raw.githubusercontent.com/babashka/babashka/master/install+ chmod +x install+ sudo ./install+ rm install++ # Install bbin+ mkdir -p ~/.bbin/bin+ curl -sL https://raw.githubusercontent.com/babashka/bbin/main/bbin > ~/.bbin/bin/bbin+ chmod +x ~/.bbin/bin/bbin+ export PATH="$HOME/.bbin/bin:$PATH"+ export BBIN_HOME="$HOME/.bbin"++ # Install clj-nrepl-eval via bbin+ bbin install https://github.com/bhauman/clojure-mcp-light.git \+ --tag v0.2.1 \+ --as clj-nrepl-eval \+ --main-opts '["-m" "clojure-mcp-light.nrepl-eval"]'++ # Add to PATH for the rest of the workflow+ echo "$HOME/.bbin/bin" >> $GITHUB_PATH++ # Verify+ clj-nrepl-eval --help | head -3++ - name: Register MCP servers+ env:+ LINEAR_API_KEY: ${{ secrets.LINEAR_API_KEY_REPRO_BOT }}+ run: |+ UV_PATH="$(which uv)"+ jq -n \+ --arg uv "$UV_PATH" \+ --arg key "$LINEAR_API_KEY" \+ '{+ mcpServers: {+ "metabase-repro": {+ command: $uv,+ args: ["run", "--directory", "mcp", "--with", "fastmcp", "python", "-m", "metabase_repro"]+ },+ "linear-server": {+ url: "https://mcp.linear.app/mcp",+ type: "http",+ headers: {+ Authorization: ("Bearer " + $key)+ }+ }+ }+ }' > ~/.claude.json+- name: Generate GitHub App Token- uses: actions/create-github-app-token@v1+ uses: actions/create-github-app-token@v2id: claude-app-tokenwith:app-id: ${{ secrets.METABASE_BOT_APP_ID }}private-key: ${{ secrets.METABASE_BOT_APP_PRIVATE_KEY }}- name: Run repro-bot with Claude Code+ id: claude+ continue-on-error: trueuses: anthropics/claude-code-action@v1env:+ CLAUDE_CODE_DEBUG_LOGS_DIR: /tmp/claude-debug-logs+ CLAUDE_WORKING_DIR: ${{ github.workspace }}/repro-botMB_PREMIUM_EMBEDDING_TOKEN: ${{ secrets.PR_ENV_MB_PREMIUM_EMBEDDING_TOKEN }}- LINEAR_API_KEY: ${{ secrets.LINEAR_API_KEY }}GITHUB_ACTIONS_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}+ timeout-minutes: 30with:- anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}+ anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY_REPRO_BOT }}github_token: ${{ steps.claude-app-token.outputs.token }}- plugins: |- @anthropic/plugin-productivity-linearprompt: |Read and follow the instructions in .claude/commands/repro.md to investigate this GitHub issue:https://github.com/${{ github.repository }}/issues/${{ steps.issue.outputs.number }}@@ -86,15 +143,124 @@ jobs:- The bare git repo has been pre-cloned at git/metabase. The master worktree still needs setup via setup_master_worktree().- The GITHUB_ACTIONS_RUN_URL environment variable is set. If any phase fails catastrophically, follow the CI error handling in repro.md to post the error to Linear with the action run URL.- Docker is available for appdb (Postgres/MySQL/MariaDB) if needed.- - Java 21 and Python/uv are pre-installed.- claude_args: |- --allowedTools "Bash(playwright-cli*),Bash(gh *),Bash(jq*),Bash(find*),Bash(ls*),Bash(grep*),Bash(cat*),Bash(base64*),Bash(git*),Bash(npx*),Bash(docker*),Bash(kill*),Bash(curl*),Write,Read,Glob,Grep,Edit,MultiEdit,WebFetch,mcp__metabase_repro__*,mcp__plugin_productivity_linear__*"+ - Java and Python/uv are pre-installed.+ claude_args: >-+ --allowedTools+ "Glob,+ Grep,+ Read,+ ToolSearch,+ Skill(*),+ WebSearch,+ WebFetch(domain:docs.metabase.com),+ WebFetch(domain:metabase.com),+ WebFetch(domain:www.metabase.com),+ Edit(//./**),+ Edit(repro/**),+ Edit(/tmp/**),+ Write(//./**),+ Write(repro/**),+ Write(/tmp/**),+ Bash(base64 *),+ Bash(cat *),+ Bash(cd *),+ Bash(clj-nrepl-eval *),+ Bash(clojure *),+ Bash(cp *),+ Bash(diff *),+ Bash(docker *),+ Bash(echo *),+ Bash(find *),+ Bash(gh api repos/metabase/metabase/*),+ Bash(gh issue list * --repo metabase/metabase *),+ Bash(gh issue view * --repo metabase/metabase *),+ Bash(gh release *),+ Bash(gh search *),+ Bash(git *),+ Bash(grep *),+ Bash(head *),+ Bash(jar *),+ Bash(jq *),+ Bash(kill *),+ Bash(ls *),+ Bash(mkdir *),+ Bash(mv *),+ Bash(npx playwright-cli:*),+ Bash(pgrep *),+ Bash(playwright-cli:*),+ Bash(printf *),+ Bash(ps *),+ Bash(psql *),+ Bash(PGPASSWORD=*),+ Bash(python -m mcp.metabase_repro *),+ Bash(python3 *),+ Bash(sed *),+ Bash(sort *),+ Bash(strings *),+ Bash(tail *),+ Bash(tee *),+ Bash(touch *),+ Bash(unzip *),+ Bash(wc *),+ Bash(which *),+ Bash(xargs *),+ mcp__metabase-repro__api_call,+ mcp__metabase-repro__browser_snapshot,+ mcp__metabase-repro__check_setup,+ mcp__metabase-repro__check_setup_token,+ mcp__metabase-repro__cleanup,+ mcp__metabase-repro__create_env,+ mcp__metabase-repro__get_session_token,+ mcp__metabase-repro__get_status,+ mcp__metabase-repro__jar_download,+ mcp__metabase-repro__repl_eval,+ mcp__metabase-repro__reset_metabase,+ mcp__metabase-repro__run_test,+ mcp__metabase-repro__save_test_patch,+ mcp__metabase-repro__setup_master_worktree,+ mcp__metabase-repro__setup_worktree,+ mcp__metabase-repro__start_appdb,+ mcp__metabase-repro__start_metabase,+ mcp__metabase-repro__stop_appdb_tool,+ mcp__metabase-repro__stop_metabase,+ mcp__linear-server__create_attachment,+ mcp__linear-server__get_issue,+ mcp__linear-server__list_comments,+ mcp__linear-server__list_issues,+ mcp__linear-server__list_issue_labels,+ mcp__linear-server__save_comment,+ mcp__linear-server__save_issue"--disallowedTools "Bash(git push*),Bash(rm -rf /*)"- - name: Upload SUGGESTIONS.md artifact- uses: actions/upload-artifact@v4+ - name: Verify repro-bot completed successfully+ run: |+ if [ "${{ steps.claude.outcome }}" = "failure" ]; then+ echo "::error::Claude Code crashed or exited with an error"+ exit 1+ fi++ EXEC_FILE="${{ steps.claude.outputs.execution_file }}"+ if [ -z "$EXEC_FILE" ] || [ ! -f "$EXEC_FILE" ]; then+ echo "::error::No execution file found"+ exit 1+ fi++ if ! grep -q "mcp__linear-server__" "$EXEC_FILE"; then+ echo "::error::Claude did not post a comment on Linear"+ exit 1+ fi++ echo "Repro-bot completed successfully and posted to Linear"++ - name: Upload repro-bot artifacts+ uses: actions/upload-artifact@v7if: always()with:- name: repro-suggestions- path: repro/*/SUGGESTIONS.md+ name: repro-bot-${{ steps.issue.outputs.number }}if-no-files-found: ignore+ path: |+ repro/*/SUGGESTIONS.md+ repro/*/*.log+ repro/*/*.patch+ repro/*/playwright/**+ ${{ steps.claude.outputs.execution_file }}