Repository navigation
feat(reusable-build): guard nhánh production, fail nếu bundle chứa host backend staging trước khi push - #7
Conversation
…st backend staging trước khi push
|
Blocked, not merged: the guard would fail current production builds of Techainer/prj-ths-smart-class (it calls reusable-build on branch production via gitops-deploy.yml). Its source ships src/lib/posthog.ts:30, a host->PostHog-key map with the key "api-smart-class-staging.truonghocsoquocgia.vn". That string matches FAIL_RE ((api|go|hasura|auth)(-[a-z0-9]+)*-staging.…truonghocsoquocgia) and is compiled into the production bundle, so the build would exit 1 before push. A scan of the other callers' production and develop sources (school-frontend, shadcn-frontend, shadcn-admin, admin-lms, attendance-hub, live-class, frontend-game, exam-module, slide-frontend, agent-platform, backend-smart-class) found no FAIL_RE hits in source; baked .env values can't be checked from source. Suggested fix: make the guard ignore host strings that are keys of a host->environment table (or match only the actual configured API base URL), not any occurrence. Second issue: 'grep … | tee | grep -q .' under pipefail can return 141 (SIGPIPE) and silently skip the failure; capture hits into a variable and test [ -n "$HITS" ] instead. |
…ging, sửa bỏ sót do pipefail Host trần trong bảng ánh xạ (posthog.ts của smart-class) làm fail nhầm build production. tee | grep -q dưới pipefail có thể SIGPIPE và bỏ qua hit thật; ghi file rồi test -s. Kiểm trên image thật: prod smart-class/admin/lms-admin OK; image staging lms-admin fail đúng.
|
Đã sửa 2 điểm chặn: FAIL_RE cần scheme (https?|wss?)://; bỏ |
No description provided.