Skip to content

fix: スプレッドシート export が差分 PR のみで上書きされる問題を修正#249

Merged
coji merged 1 commit intomainfrom
fix/export-spreadsheet-full-data
Mar 25, 2026
Merged

fix: スプレッドシート export が差分 PR のみで上書きされる問題を修正#249
coji merged 1 commit intomainfrom
fix/export-spreadsheet-full-data

Conversation

@coji
Copy link
Owner

@coji coji commented Mar 25, 2026

Summary

  • sheet.paste() がシート全体を削除→貼り付けするため、差分 crawl 時に更新された PR だけで rawdata シートが上書きされていた
  • export ステップで DB から全 PR を取得して export するように修正
  • exportReviewResponses は差分データしか持たないため一旦停止(DB 永続化後に対応予定)
  • getPullRequestReportselectAll → 必要 19 カラムのみに絞り込み

Test plan

  • デプロイ後、iris org の crawl が走った後にスプシ rawdata を確認し全 PR が出力されていること
  • reviewres シートは更新されなくなることを確認

🤖 Generated with Claude Code

Summary by CodeRabbit

リリースノート

  • バグ修正

    • プルリクエストのエクスポートがデータベースから完全なデータセットを取得するようになり、シート全体の置換動作を保証しました。
  • 改善

    • プルリクエストのエクスポートに、ソースブランチ、ターゲットブランチ、状態、タイトル、URL、複数のタイムスタンプと期間情報など、より詳細な情報が含まれるようになりました。
    • レビューレスポンスのエクスポート機能を削除しました。

sheet.paste() がシート全体を削除してから貼り付けるため、
差分 crawl 時に更新された PR だけが export されていた。
DB から全件取得して export するように変更。

- exportPulls: DB 全件クエリ (getPullRequestReport) を使用
- exportReviewResponses: DB 永続化未対応のため一旦停止 (TODO)
- getPullRequestReport: selectAll → 必要カラムのみに絞り込み
- dead code 削除: exportReviewResponses, ReviewResponse, allReviewResponses

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Mar 25, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2b065fd7-a19b-4a69-aae6-12cdadf041c3

📥 Commits

Reviewing files that changed from the base of the PR and between 0f9ebd1 and 4f07ac2.

📒 Files selected for processing (3)
  • app/services/jobs/shared-steps.server.ts
  • batch/bizlogic/export-spreadsheet.ts
  • batch/db/queries.ts

📝 Walkthrough

ウォークスルー

プルリクエストエクスポート機能を改善するため、レビューレスポンスの収集・処理を削除し、データベースから最新のプルリクエスト情報を直接フェッチする仕様に変更しました。エクスポートスキーマを拡張し、複数のタイムスタンプと期間フィールドを含めて詳細情報を提供するようにしました。

変更内容

凝集体 / ファイル(s) 概要
ジョブ処理の簡素化
app/services/jobs/shared-steps.server.ts
分析フェーズからレビューレスポンスの収集・処理を削除。PR エクスポートをデータベースクエリ getPullRequestReport(orgId) から完全データセットを取得する仕様に変更。
エクスポート機能の再設計
batch/bizlogic/export-spreadsheet.ts
exportReviewResponses 関数を削除。新たに ExportPullRequest 型を導入し、PR メタデータ、複数のタイムスタンプ、期間フィールドを含む拡張スキーマでエクスポート。タイトルのタブエスケープと全タイムスタンプフィールドのタイムゾーン形式対応を実装。
クエリ投影の最適化
batch/db/queries.ts
getPullRequestReport の列選択を明示的に指定。リポジトリ、PR 番号、ブランチ、ステート、タイトル、URL、およびタイミング関連フィールドのみを返すように最適化。

推定コードレビュー工数

🎯 4 (複雑) | ⏱️ ~50 分

関連する可能性のある PR

ラビットからのポエム

🐰✨ レビューレスポンス、さようなら~
データベースから真実を取り、
PR たちはスキーマで美しく舞い、
タイムスタンプはタイムゾーンに染まり、
エクスポートフローはすっきりと輝く! 🌟

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/export-spreadsheet-full-data

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coji coji merged commit 81b49cb into main Mar 25, 2026
6 checks passed
@coji coji deleted the fix/export-spreadsheet-full-data branch March 25, 2026 06:37
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.

1 participant