-
Notifications
You must be signed in to change notification settings - Fork 1
Issue作成時のProbotにunit testを追加 + 全体のファイルを再度フォーマット #505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ved server management
WalkthroughProbot関連の再編成で Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor GitHub
participant FF as Firebase onRequest
participant PB as Probot
participant HZ as Hetzner API
participant GHAPI as GitHub API
GitHub->>FF: webhook (issues.opened)
FF->>PB: dispatch event
PB->>HZ: createServer(apiKey)
HZ-->>PB: { serverId, ipv4 }
PB->>GHAPI: POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig
GHAPI-->>PB: { encoded_jit_config }
PB->>HZ: initRunner(encoded_jit_config)
PB->>GitHub: post comment / other actions
FF-->>GitHub: 200 OK
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (2)
🧰 Additional context used🧠 Learnings (1)📚 Learning: 2025-10-12T04:41:44.291ZApplied to files:
🔇 Additional comments (8)
Comment |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
openci-runner/firebase/functions/probot/github.ts (1)
16-29: ハードコードされた値とエラー処理を確認してください。以下の点について検証をお願いします:
runner_group_id: 1: デフォルトのランナーグループIDとして1がハードコードされています。すべての環境やリポジトリで適切かどうかを確認してください。エラー処理: 関数にはエラー処理が実装されていません。GitHub APIリクエストが失敗した場合(認証エラー、レート制限、ネットワークエラーなど)、Octokitのデフォルトエラー処理に依存しています。呼び出し元でエラーを適切に処理しているか確認してください。
テンプレートリテラル: Lines 24-25の
ownerとrepoでテンプレートリテラルが使用されていますが、既に文字列型のため不要です。簡略化の提案:
- owner: `${owner}`, - repo: `${repo}`, + owner: owner, + repo: repo,
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
openci-runner/firebase/functions/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (10)
biome.jsonc(1 hunks)openci-runner/firebase/functions/package.json(1 hunks)openci-runner/firebase/functions/probot/github.ts(1 hunks)openci-runner/firebase/functions/probot/hetzner.ts(3 hunks)openci-runner/firebase/functions/probot/index.ts(3 hunks)openci-runner/firebase/functions/src/index.ts(2 hunks)openci-runner/firebase/functions/test/fixtures/issues.opened.json(1 hunks)openci-runner/firebase/functions/test/index.test.ts(2 hunks)openci-runner/firebase/functions/tsconfig.json(1 hunks)openci.code-workspace(4 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
openci-runner/firebase/functions/test/index.test.ts (1)
openci-runner/firebase/functions/probot/index.ts (1)
appFn(17-134)
🔇 Additional comments (16)
openci-runner/firebase/functions/test/fixtures/issues.opened.json (1)
1-18: LGTM!テストフィクスチャのフィールド順序変更は、機能的に影響がなく問題ありません。
openci-runner/firebase/functions/tsconfig.json (1)
2-13: LGTM!TypeScript設定の再構成により、すべての設定が適切に
compilerOptionsの下にネストされています。module: "NodeNext"はNode.js ESMプロジェクトに適しており、target: "es2017"はNode.js 22に対応しています。openci-runner/firebase/functions/src/index.ts (2)
17-18: リソース制限が高めに設定されています。Webhookハンドラーに対して8 CPUと16GiBのメモリが割り当てられています。Hetznerサーバーのプロビジョニング操作に必要な場合は問題ありませんが、これらのリソース制限が実際に必要かどうかを確認してください。過剰なリソース割り当てはコストに影響する可能性があります。
38-42: LGTM!Probot設定における
overridesブロックの追加により、GitHub App認証情報が適切に提供されています。Firebaseシークレットから値を取得する方法は正しく、ハードコードされた機密情報はありません。openci.code-workspace (2)
2-31: LGTM!推奨拡張機能のリストは、プロジェクトの技術スタック(Flutter、Rust、TypeScript)に適合しており、開発体験を向上させます。
104-106: LGTM!Biomeによる保存時のインポート整理設定により、コードの一貫性が保たれます。
formatOnSaveとの組み合わせで、自動的にコードがフォーマットされます。biome.jsonc (1)
2-9: LGTM!
assist.actions.source.useSortedKeysの有効化により、オブジェクトキーの順序が自動的に整理され、コードの一貫性が向上します。ワークスペースのBiome拡張機能推奨設定と整合しています。openci-runner/firebase/functions/package.json (1)
18-34: LGTM!パッケージ設定は適切です:
- Node.js 22(現行LTS)を指定
type: "module"によりESMモジュールとして構成tsconfig.jsonのmodule: "NodeNext"設定と整合- Firebase Functionsプロジェクトの標準的なスクリプト構成
openci-runner/firebase/functions/probot/index.ts (3)
1-5: LGTM!インポートの変更により、
getJitConfigがhetzner.tsからgithub.tsに移動しています。これはJIT設定取得ロジックをGitHub関連モジュールに配置するリファクタリングの一部であり、モジュールの責務が明確になります。
21-25: LGTM!イベントハンドラーが
issues.openedに変更され、PRタイトルの「Issue作成時のProbotにunit testを追加」と整合しています。コメント本文が「Hello, World!」に変更されていますが、デバッグ用コードとして明示されているため問題ありません。
71-76: LGTM!SSH接続設定のフィールド順序変更は、機能的に影響がなく問題ありません。
openci-runner/firebase/functions/probot/github.ts (3)
1-1: LGTM!
Octokit型のインポートにより、getJitConfig関数のパラメータに適切な型付けが行われています。
10-15: LGTM!関数シグネチャは明確で、適切に型付けされています。
index.tsでの使用方法と一致しています。
31-31: LGTM!
encoded_jit_configの返却は、GitHub APIレスポンスから正しくデータを抽出しています。openci-runner/firebase/functions/test/index.test.ts (1)
45-47: コメント本文の完全一致チェックが良いです
toEqualで期待ボディを厳密に検証しているので、差分に敏感なリグレッションを確実に拾えます。openci-runner/firebase/functions/probot/hetzner.ts (1)
43-48:serverIdを返す形に整理された点が良いです取得した ID をそのまま返却しておくことで、呼び出し側での追加パースが不要になり見通しが良くなりました。
Summary by CodeRabbit