Skip to content

Remove legacy migration scripts and fix route parameter handling - #267

Merged
YoonKeumJae merged 11 commits into
mainfrom
develop
Jun 26, 2026
Merged

Remove legacy migration scripts and fix route parameter handling#267
YoonKeumJae merged 11 commits into
mainfrom
develop

Conversation

@YoonKeumJae

Copy link
Copy Markdown
Collaborator

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 the index.html and 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 ErrorBoundary component 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 trackClientDiagnostic function to send custom diagnostic events to Clarity, used by both chunk load recovery and error boundaries. (Elevate.Web/src/services/clarity.js Elevate.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.md documents/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., activityVideoId and activityvideoid), improving compatibility with Azure API routing conventions. (Elevate.Server/src/controllers/activityVideoController.js Elevate.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:


Most important changes:

Deployment diagnostics and error recovery:

  • Added build ID injection and propagation throughout the client and deployment process for improved diagnostics and support. (.github/workflows/deploy.yml [1] Elevate.Web/vite.config.js [2] Elevate.Web/index.html [3] Elevate.Web/src/components/common/ErrorBoundary.jsx [4]
  • Implemented chunk load recovery logic and integrated it into the client startup, with Clarity diagnostic logging. (Elevate.Web/src/services/chunkLoadRecovery.js [1] Elevate.Web/src/main.jsx [2] [3]
  • Enhanced error boundary to log render errors with build and route context, and display build ID in UI. (Elevate.Web/src/components/common/ErrorBoundary.jsx [1] [2]

Testing and operations:

  • Added deployment smoke tests to the GitHub Actions workflow and documented operational runbook for incident response and rollback. (.github/workflows/deploy.yml [1] documents/06-operations/DEPLOYMENT_AND_RUNBOOK.md [2]
  • Created scripts and test commands to verify build ID and chunk load recovery code paths. (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:

  • Updated server controller and tests to accept lowercased Azure-style route parameter names for activity video endpoints. (Elevate.Server/src/controllers/activityVideoController.js [1] Elevate.Server/tests/activity-videos.test.js [2] [3]

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 필드 보존 동작 테스트 추가

Comment thread Elevate.Web/src/services/chunkLoadRecovery.js
Comment thread .github/workflows/deploy.yml Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.

Comment thread Elevate.Web/src/services/chunkLoadRecovery.js
Comment thread documents/06-operations/DEPLOYMENT_AND_RUNBOOK.md

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated no new comments.

@YoonKeumJae
YoonKeumJae merged commit 604ab70 into main Jun 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants