Repository navigation
bug(deploy): three more shell scripts build the SLM frontend with the wrong npm target #15718
Description
Found while widening the #15650/#15689/#15659 shell-publish guard to sweep every *.sh file in the tree for the same defect class (wrong npm build target / non-atomic publish into a served path).
What
Three more shell entry points build the SLM frontend (autobot-slm-frontend) with a plain npm run build instead of build:slm (the script that bakes VITE_API_URL=/slm in -- #9563, #9710, #10435):
run_agent.sh:316--cd "$PROJECT_ROOT/autobot-slm-frontend" && npm install --force && npm run build && npm run dev &autobot-infrastructure/shared/scripts/bulletproof-frontend/zero-downtime-update.sh:84--npm run buildautobot-infrastructure/shared/scripts/bulletproof-frontend/deploy-bulletproof-frontend.sh:74--VITE_BUILD_TIMESTAMP=$(date +%s) npm run build
The two bulletproof-frontend/ scripts also publish through an entirely separate mechanism from the one #15557/#15610 established: a primary/staging symlink swap under /opt/autobot/src/autobot-slm-frontend{,-primary,-staging}, not autobot-slm-frontend/current -- the path nginx (roles/slm_manager/templates, autobot-infrastructure/autobot-slm-frontend/templates/autobot-slm.conf) and every other publisher (build_publish_slm_frontend.yml, services/slm_frontend_build.py, and the shell helper added in #15650/#15689/#15659, autobot-infrastructure/autobot-slm-frontend/templates/build-publish-slm-frontend.sh) actually serve. Whether that swap is even atomic is a separate question from the build-target defect.
Why this is filed rather than fixed here
Out of scope for #15650/#15689/#15659, which named bootstrap-slm.sh and sync-frontend.sh specifically. The never-delete rule applies here too: bulletproof-frontend/ is referenced only by its own README (no other caller found), so establishing whether the ansible/bootstrap path already supersedes it -- rather than assuming -- is exactly the #15659-style question that needs answering before deciding to fix it in place or retire it.
Acceptance criteria
- Establish whether anything still calls
run_agent.sh's frontend-build line, andzero-downtime-update.sh/deploy-bulletproof-frontend.sh(a runbook, a doc, a developer habit) - If kept: point each at
build:slmand the atomicdist-<id>/current/previouspublish idiom (reuseautobot-infrastructure/autobot-slm-frontend/templates/build-publish-slm-frontend.shif the target path can be unified withautobot-slm-frontend/current; otherwise justify why/opt/autobot/src/...is a legitimately different target) - If retired: remove with evidence that the ansible/bootstrap path already covers what it did
- The repo_tests guard added in bug(deploy): bootstrap-slm.sh builds the SLM frontend with the wrong script and warns instead of failing #15650/bug(deploy): bootstrap-slm.sh builds into the directory nginx is serving and publishes a failed build #15689/bug(deploy): sync-frontend.sh publishes via an inventory path that does not exist #15659 (shell build/publish sweep) currently grandfathers these three sites by explicit, commented exclusion so it does not silently widen; closing this issue should remove that exclusion list
Related
- bug(deploy): bootstrap-slm.sh builds the SLM frontend with the wrong script and warns instead of failing #15650, bug(deploy): bootstrap-slm.sh builds into the directory nginx is serving and publishes a failed build #15689, bug(deploy): sync-frontend.sh publishes via an inventory path that does not exist #15659 -- the shell-publish guard that surfaced this
- bug(deploy): three ansible entry points build the SLM frontend with no staged publish and no failure gate #15557, bug(deploy): the SLM frontend promotion is two renames, so the served directory briefly does not exist #15610, fix(ansible): stage the SLM frontend publish and repair three backend path defects (#15557, #15560) #15602 -- the ansible-side fixes for the same defect class
Activity
fix(deploy): give the shell SLM-frontend publishers the #15557/#15610 …