Skip to content

Instantly share code, notes, and snippets.

@m-mizutani
Created September 15, 2025 09:38
Show Gist options
  • Select an option

  • Save m-mizutani/9d79e9cc3976a9ac4a2974da4eb00a1e to your computer and use it in GitHub Desktop.

Select an option

Save m-mizutani/9d79e9cc3976a9ac4a2974da4eb00a1e to your computer and use it in GitHub Desktop.
要件diff
78a79,81
> type StatusHistoryID string // UUID v7 typed string
> type IncidentID string // typed string
>
80,85c83,88
< ID string // 履歴ID
< IncidentID string // インシデントID
< Status IncidentStatus // 変更後のステータス
< ChangedBy User // 変更実施者
< ChangedAt time.Time // 変更日時
< Reason string // 変更理由(オプション)
---
> ID StatusHistoryID // 履歴ID (UUID v7)
> IncidentID IncidentID // インシデントID
> Status IncidentStatus // 変更後のステータス
> ChangedBy types.SlackUserID // 変更実施者のSlackユーザーID
> ChangedAt time.Time // 変更日時
> Note string // 状況メモ(オプション)
87,92d89
<
< type User struct {
< SlackUserID string // SlackユーザーID
< Name string // ユーザー名
< Email string // メールアドレス(オプション)
< }
100c97
< ID string
---
> ID IncidentID
103c100
< Lead string
---
> Lead types.SlackUserID // インシデントリード(SlackユーザーID)
116c113
< ### incidents コレクション
---
> ### Incidents コレクション
118c115
< /incidents/{incidentId}
---
> /Incidents/{incidentId}
120,127c117,124
< id: string
< title: string
< description: string
< lead: string
< status: string // 現在のステータス
< initialTriage: boolean
< createdAt: timestamp
< updatedAt: timestamp
---
> ID: string
> Title: string
> Description: string
> Lead: string
> Status: string // 現在のステータス
> InitialTriage: boolean
> CreatedAt: timestamp
> UpdatedAt: timestamp
131c128
< ### status_histories サブコレクション
---
> ### StatusHistories サブコレクション
133c130
< /incidents/{incidentId}/status_histories/{historyId}
---
> /Incidents/{incidentId}/StatusHistories/{historyId}
135,144c132,137
< id: string
< incidentId: string
< status: string
< changedBy: {
< slackUserId: string
< name: string
< email: string
< }
< changedAt: timestamp
< reason: string
---
> ID: string
> IncidentID: string
> Status: string
> ChangedBy: string // SlackユーザーID
> ChangedAt: timestamp
> Note: string
163c156
< changedBy: User!
---
> changedBy: User! # usersから解決
165c158
< reason: String
---
> note: String
183c176
< reason: String
---
> note: String
213c206
< 3. 変更理由の入力フィールド(オプション)
---
> 3. 状況メモの入力フィールド(オプション)
227c220
< UpdateStatus(ctx context.Context, incidentID string, status IncidentStatus, userID string) error
---
> UpdateStatus(ctx context.Context, incidentID IncidentID, status IncidentStatus, userID types.SlackUserID) error
229,230c222,223
< // ステータス履歴取得
< GetStatusHistory(ctx context.Context, incidentID string) ([]StatusHistory, error)
---
> // ステータス履歴取得(ユーザー情報を含む)
> GetStatusHistory(ctx context.Context, incidentID IncidentID) ([]StatusHistoryWithUser, error)
233c226
< PostStatusMessage(ctx context.Context, channelID string, incidentID string) error
---
> PostStatusMessage(ctx context.Context, channelID types.ChannelID, incidentID IncidentID) error
234a228,233
>
> // ユーザー情報を含むステータス履歴
> type StatusHistoryWithUser struct {
> StatusHistory
> User *User // usersから取得したユーザー情報
> }
286c285
< │ │ ├── StatusHistory.tsx # ステータス履歴表示
---
> │ │ ├── StatusSection.tsx # ステータスセクション(現在のステータス+履歴)
302c301
< interface StatusHistoryProps {
---
> interface StatusSectionProps {
303a303,304
> currentStatus: IncidentStatus;
> statusHistories: StatusHistory[];
306,312c307,335
< // 右サイドバーに表示
< // タイムライン形式で変更履歴を表示
< // 各エントリには以下を表示:
< // - ステータス変更内容(From -> To)
< // - 変更者情報
< // - 変更日時
< // - 変更理由(あれば)
---
> // 右サイドバーにステータスセクション表示
> // 構成要素:
> // 1. 現在のステータス(大きく表示、色分け)
> // 2. ステータス変更ボタン
> // 3. シンプルなステータス履歴
> // - 縦並びのエントリ、矢印で遷移を表現
> // - 各エントリ:
> // - 時刻(相対時間 - 例:2h ago)
> // - 新しいステータスバッジ
> // - 行間に上向き矢印(↑)で遷移元を表現
> // - 前のステータスバッジ
> // - 変更者名(@username)
> // - 状況メモ(あれば、グレーのサブテキスト)
> //
> // レイアウト例:
> // ┌─────────────────────┐
> // │ 🔴 Handling │ ← 現在のステータス
> // │ [Change Status] │ ← 変更ボタン
> // │ ↑ │
> // │ 2h ago │
> // │ 🔴 Handling │
> // │ @john.doe │
> // │ Started investigation │ ← メモ(グレー)
> // │ ↑ │
> // │ 5h ago │
> // │ 🟡 Triage │
> // │ @incident.creator │
> // │ Initial creation │
> // └─────────────────────┘
373a397,405
> ### E2Eテスト
>
> 1. **HTTP E2Eテスト** (`pkg/controller/http/server_test.go`)
> - GraphQL経由でのupdateIncidentStatus mutationの動作確認
> - GraphQL経由でのincidentStatusHistory queryの動作確認
> - HTTPリクエスト/レスポンスの検証
> - ステータス変更と履歴取得の一連のフロー
> - 認証・権限チェックとエラーハンドリング
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment