Remove legacy migration scripts and fix route parameter handling - #267
Merged
Conversation
…n-scripts [codex] Remove legacy migration scripts
[codex] Fix activity video route parameter handling
[codex] recover stale web chunks
There was a problem hiding this comment.
Pull request overview
이 PR은 (1) 클라이언트 배포 진단/지원 강화를 위한 Build ID 주입 및 진단 로깅, (2) chunk 로드 실패 자동 복구(1회 리로드), (3) Azure 라우트 파라미터(lowercase) 호환을 추가하고, 동시에 레거시 마이그레이션 스크립트를 제거합니다.
Changes:
- Vite/HTML/앱 부트스트랩에 Build ID를 주입하고, Clarity 진단 이벤트/태그로 노출
- chunk 로드 실패 패턴 감지 → sessionStorage 기반 1회 리로드 복구 + 진단 이벤트 기록
- 서버에서 lowercase 라우트 파라미터(
activityvideoid)를 허용하고 관련 테스트 추가
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| migration/migrate-update-posts.js | 레거시 마이그레이션 스크립트 제거 |
| migration/migrate-static-attachments.js | 레거시 마이그레이션 스크립트 제거 |
| migration/migrate-agenthon.js | 레거시 마이그레이션 스크립트 제거 |
| migration/.gitignore | 마이그레이션 디렉터리 ignore 설정 정리(내용 제거) |
| Elevate.Web/vite.config.js | Build ID 생성/정규화 및 HTML 플레이스홀더 치환 |
| Elevate.Web/index.html | window.__BUILD_ID__ 전역 주입(플레이스홀더 기반) |
| Elevate.Web/src/main.jsx | chunk 복구 시작 + Clarity에 build_id 태그 설정 |
| Elevate.Web/src/services/clarity.js | trackClientDiagnostic 추가(태그+이벤트 공통 진단 API) |
| Elevate.Web/src/services/chunkLoadRecovery.js | chunk 로드 실패 감지/1회 리로드 복구 + 진단 기록 |
| Elevate.Web/src/components/common/ErrorBoundary.jsx | 렌더 에러 진단 전송 + UI에 Build ID 표시 |
| Elevate.Web/scripts/test-build-id-source.mjs | Build ID 소스 반영 여부(정적) 검증 스크립트 추가 |
| Elevate.Web/scripts/test-chunk-load-recovery-source.mjs | chunk 복구 로직 소스(정적) 검증 스크립트 추가 |
| Elevate.Web/package.json | 위 정적 검증 스크립트 실행 커맨드 추가 |
| .github/workflows/deploy.yml | 배포 시 Build ID 주입 + 배포 후 smoke test 추가 |
| documents/06-operations/DEPLOYMENT_AND_RUNBOOK.md | 배포/장애 대응(runbook) 문서 추가 |
| Elevate.Server/src/controllers/activityVideoController.js | lowercase 라우트 파라미터(activityvideoid) 허용 |
| Elevate.Server/tests/activity-videos.test.js | lowercase 파라미터 및 optional 필드 보존 동작 테스트 추가 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements to the Elevate project, focusing on enhanced deployment diagnostics, improved error handling and recovery for client-side chunk loading failures, and better support for Azure route parameter conventions. It also adds new tests and documentation to support these changes.
Deployment diagnostics and build identification:
Added a unique build ID (
VITE_BUILD_ID) to every deployment, sourced from the GitHub SHA, and injected it into the client via theindex.htmland as a global variable (window.__BUILD_ID__). This build ID is now referenced in the UI and error diagnostics to help correlate issues with specific deployments. (.github/workflows/deploy.yml[1]Elevate.Web/vite.config.js[2]Elevate.Web/index.html[3]Elevate.Web/src/components/common/ErrorBoundary.jsx[4]Added new scripts and test commands to verify the presence and correct propagation of the build ID and chunk load recovery logic in the client source. (
Elevate.Web/package.json[1]Elevate.Web/scripts/test-build-id-source.mjs[2]Elevate.Web/scripts/test-chunk-load-recovery-source.mjs[3]Client-side error handling and diagnostics:
Implemented a robust chunk load recovery mechanism in the client (
chunkLoadRecovery.js) that detects failed dynamic imports or asset loads, attempts a single page reload, and logs diagnostic events (including build ID and route) to Clarity. This helps users recover from stale asset caches and provides telemetry for monitoring. (Elevate.Web/src/services/chunkLoadRecovery.js[1]Elevate.Web/src/main.jsx[2] [3]Enhanced the
ErrorBoundarycomponent to report render errors to Clarity with route and build ID context, and to display the build ID in the error UI for user support. (Elevate.Web/src/components/common/ErrorBoundary.jsx[1] [2]Added a generic
trackClientDiagnosticfunction to send custom diagnostic events to Clarity, used by both chunk load recovery and error boundaries. (Elevate.Web/src/services/clarity.jsElevate.Web/src/services/clarity.jsR100-R112)Deployment workflow and operations:
Extended the GitHub Actions deployment workflow to include a smoke test step that verifies key routes and their referenced assets are available after deployment, catching routing or asset publishing issues early. (
.github/workflows/deploy.yml.github/workflows/deploy.ymlR79-R130)Added a deployment and incident runbook documenting smoke test procedures, troubleshooting steps, rollback criteria, and longer-term hosting considerations. (
documents/06-operations/DEPLOYMENT_AND_RUNBOOK.mddocuments/06-operations/DEPLOYMENT_AND_RUNBOOK.mdR1-R60)Azure route parameter compatibility and tests:
Updated server controller logic to accept both camelCase and lowercased route parameter names (e.g.,
activityVideoIdandactivityvideoid), improving compatibility with Azure API routing conventions. (Elevate.Server/src/controllers/activityVideoController.jsElevate.Server/src/controllers/activityVideoController.jsL20-R20)Added tests to ensure the server correctly handles lowercased route parameters for activity video endpoints. (
Elevate.Server/tests/activity-videos.test.js[1] [2]Other:
Added a test to verify that optional fields like
descriptionandchannelare preserved and normalized when creating activity videos. (Elevate.Server/tests/activity-videos.test.jsElevate.Server/tests/activity-videos.test.jsR276-R297)Cleaned up
.gitignorein the migration directory. (migration/.gitignoremigration/.gitignoreL1-L3)Most important changes:
Deployment diagnostics and error recovery:
.github/workflows/deploy.yml[1]Elevate.Web/vite.config.js[2]Elevate.Web/index.html[3]Elevate.Web/src/components/common/ErrorBoundary.jsx[4]Elevate.Web/src/services/chunkLoadRecovery.js[1]Elevate.Web/src/main.jsx[2] [3]Elevate.Web/src/components/common/ErrorBoundary.jsx[1] [2]Testing and operations:
.github/workflows/deploy.yml[1]documents/06-operations/DEPLOYMENT_AND_RUNBOOK.md[2]Elevate.Web/package.json[1]Elevate.Web/scripts/test-build-id-source.mjs[2]Elevate.Web/scripts/test-chunk-load-recovery-source.mjs[3]Server compatibility:
Elevate.Server/src/controllers/activityVideoController.js[1]Elevate.Server/tests/activity-videos.test.js[2] [3]