Skip to content

chore: クライアント識別ヘッダーとログ基盤を全プラットフォーム対応#167

Merged
func09 merged 4 commits intomainfrom
chore/client-logs
Apr 10, 2026
Merged

chore: クライアント識別ヘッダーとログ基盤を全プラットフォーム対応#167
func09 merged 4 commits intomainfrom
chore/client-logs

Conversation

@func09
Copy link
Copy Markdown
Owner

@func09 func09 commented Apr 10, 2026

概要

web / macos / ios から共通のクライアント情報ヘッダーを送信できるようにしました。
あわせて API 側のログを request / client 構造で出力し、deploy 時に Web のクライアント版情報を注入するようにしました。

変更内容

  • web / mobile / desktop で X-Client-* ヘッダー送信を統一
  • API の logger を構造化し、client 情報(version/platform/osVersion/environment)を出力
  • CORS に X-Client-* ヘッダーを追加
  • deploy workflow で VITE_CLIENT_ENVIRONMENT=production を固定注入
  • deploy workflow で最新タグ(v 除去)から VITE_CLIENT_VERSION を注入(タグなしは unknown
  • apps/web/.env.example に deploy 注入前提の説明を追加
  • .cursor/settings.json に Cloudflare plugin 設定を追加

動作確認

  • pnpm check:types が通ること
  • API ログで request / client 構造が出力されること
  • web で X-Client-* ヘッダーが送信されること

備考

  • VITE_CLIENT_VERSION は deploy 時に上書きされる想定です。

func09 added 3 commits April 10, 2026 16:52
Add X-Client-* headers across web, mobile, and desktop flows, and update API logging/CORS to capture structured request/client metadata including OS version.

Made-with: Cursor
Enable the Cloudflare plugin in Cursor workspace settings so the project has the expected local editor integration.

Made-with: Cursor
Set production client environment during web deploy and derive client version from the latest tag (with v prefix stripped), with unknown fallback when no tags exist.

Made-with: Cursor
@func09 func09 self-assigned this Apr 10, 2026
@func09 func09 added the chore label Apr 10, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 10, 2026

Coverage Report for Monorepo

Status Category Percentage Covered / Total
🔵 Lines 99.5% 1011 / 1016
🔵 Statements 99.53% 1061 / 1066
🔵 Functions 99.66% 296 / 297
🔵 Branches 97.48% 387 / 397
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
apps/api/src/middlewares/logger.ts 82.75% 75% 75% 82.75% 8-9, 15-23
apps/desktop/src/main.ts 100% 100% 100% 100%
Generated in workflow #184 for commit 534cc0f by the Vitest Coverage Report Action

Align logger and desktop tests with the new structured log shape and macOS user-agent format so coverage runs pass after the client metadata changes.

Made-with: Cursor
@func09 func09 merged commit 171e11a into main Apr 10, 2026
4 checks passed
@func09 func09 deleted the chore/client-logs branch April 10, 2026 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant