amyboard-pr-preview: keep amy pinned to the PR through the root container build#1066
Conversation
…iner build The esp-idf firmware step runs in a root Docker container that does a `git submodule update`, which reverted the `amy` submodule from the PR's pinned commit back to main's recorded gitlink — so AMY-PR previews (and the HW CI that flashes them) were silently built from main's amy, not the PR's. The revert also left amy/ files owned by root, so the later non-root web build hit `Permission denied` regenerating amy/amy/constants.py whenever the PR changed a header (e.g. amy#784). Fix: record the PR SHA as the superproject gitlink (`git add amy`) so the container's submodule update keeps the PR commit, and reclaim workspace ownership after the container step so the web build can write. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
🔌 AMYboard PR previewEditor + flasher: https://amyboard-pr-1066.vercel.app/editor/ This preview bundles this PR's firmware — its flasher only flashes this build (not the release). Rebuilt on every push; removed when the PR closes. The hardware CI has been kicked off and should return within a few minutes, stand by! |
🎛️ HW CI (physical bench)AMYboard (USB-MIDI + AMY Tulip (TULIP4_R11; serial-REPL audio + WiFi screenshot): ✅ PASS — flashed this PR’s firmware; all checks matched the references. ⬇️ Artifacts: recordings · screenshot · serial logs · run logs Self-hosted bench. Audio spectral-compared to |
Problem
AMY-PR previews (
repository_dispatch: amy-pr) started failing in the Build amyboardweb stage/ step (e.g. amy#784):Root cause (verified on the runner)
The esp-idf firmware step runs in a Docker container as root with the workspace bind-mounted, and inside it a
git submodule updateruns (it doesgit config --global --add safe.directory "*"first). That reverts theamysubmodule from the PR's pinned commit back to the superproject's recorded gitlink (main's pin) and leaves the reverted files owned byroot:root.I confirmed this with a diagnostic run: right after the container,
amy/amy/constants.pywasroot rootand byte-identical to main's pin (2773 bytes), not the PR's version (2794 bytes withNOTE_SOURCE_MAPPED).Two consequences:
Permission deniedwhenmake webregeneratedamy/amy/constants.py. This only surfaces when the PR changes a header (src/amy.h) without regenerating the committedsrc/patches.h, somakeconsiders it stale (amy#784 does exactly this); other AMY PRs stayed green while still building main's amy.Fix
git add amy) in the pin step, so the container'sgit submodule updatekeeps the PR commit instead of reverting.build/).Verification
Dispatched this workflow for amy#784 (
a07a6ae) on a branch carrying this fix plus a temporary probe + stop-before-deploy guard:amy HEAD = a07a6ae(PR SHA),constants.py= 2794 bytes,runner runner,HAS PR MARKER— the pin survived and the revert no longer root-owns the tree.Build amyboardweb stage/passed.conclusion == success).🤖 Generated with Claude Code