Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughRails を 7.2.x から 8.1.1 へアップグレードし、キュー基盤を GoodJob → SolidQueue へ移行、Gem/CI/起動スクリプト・初期化子・マイグレーション・スキーマ・エラーページ・多数のテストを更新しました。 Changes
Sequence Diagram(s)(該当条件を満たさないため、シーケンス図は追加していません) Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom Pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (27)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
Gemfile.lockis excluded by!**/*.lock
📒 Files selected for processing (3)
Gemfile(3 hunks)config/application.rb(1 hunks)db/schema.rb(10 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
config/**
📄 CodeRabbit inference engine (AGENTS.md)
Configuration files in
config/should include environment settings, routes, and lints (.rubocop.yml,config/slim_lint.yml)
Files:
config/application.rb
**/*.rb
📄 CodeRabbit inference engine (AGENTS.md)
Ruby code should use 2-space indentation, snake_case for method names, and CamelCase for class names, enforced by RuboCop (
.rubocop.yml)
Files:
config/application.rbdb/schema.rb
⚙️ CodeRabbit configuration file
**/*.rb: # refactoring
- まずFat Controllerを避け、次にFat Modelを避ける。
- Serviceクラスの乱用を避ける。
- controller concernを作ろうとしたらPORO(Plain Old Ruby Object)やActiveRecordモデルでの実装で代替できないか検討する。
Rails Patterns
- ViewHelperにメソッドを実装する時にはまずDecoratorパターンを使うことを検討する。(active_decorator gemを導入しているのでそれを使う)
- 複雑なActiveRecordクエリがあり、再利用できそうな場合はQueryObjectパターンを検討する。(rails-patterns gemを導入しているのでそれのQuery機能を使う)
- Viewにpartialを作る場合はViewComponentを使うことを検討する。
- 複数のActiveRecordモデルを操作する1つの責務がある時や外部APIとやりとりする処理がある場合にはInteractorオブジェクトパターンを検討する。(interactor gemを導入しているのでそれを使う)
- 複数のInteractorを実行するような処理がある場合Organizerオブジェクトパターンを検討する。(interactor gemを導入しており、その中にOrganizerの機能があるので使う)
Files:
config/application.rbdb/schema.rb
db/**
📄 CodeRabbit inference engine (AGENTS.md)
Database migrations and schema should be stored in
db/directory; app-specific utilities inlib/; static assets inpublic/
Files:
db/schema.rb
🧠 Learnings (9)
📓 Common learnings
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/product.rb:59-61
Timestamp: 2025-09-11T14:47:53.256Z
Learning: Rails アップグレードPRでは、アップグレードに直接関連しない性能改善や機能追加の提案は避けるべき。PRのスコープを維持することが重要で、そのような改善提案は別PRで対応すべきである。
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9115
File: db/migrate/20250902024949_add_unique_index_to_correct_answers.rb:1-5
Timestamp: 2025-11-13T09:20:36.030Z
Learning: fjordllc/bootcamp プロジェクトでは、データの整合性を保つためのデータ修正には data-migrate gem を使用し、db/data/ ディレクトリ配下にデータマイグレーションファイルを作成する運用を採用している。スキーマ変更(db/migrate/)とデータ変更(db/data/)を分離することで、より安全で管理しやすい構成を実現している。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:52-56
Timestamp: 2025-09-12T21:17:45.295Z
Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: mousu-a
Repo: fjordllc/bootcamp PR: 8566
File: db/migrate/20250830033535_add_default_to_pair_works_wip.rb:1-5
Timestamp: 2025-08-31T03:17:44.812Z
Learning: 新機能のマイグレーションで、まだ本番環境にリリースされていない場合は、既存レコードのバックフィル処理は不要。開発環境でrails db:resetが可能な状況では特に、デフォルト値の変更のみで十分。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/migrate/20250831234516_remove_unique_index_from_buzzes_title.rb:1-5
Timestamp: 2025-09-04T01:50:47.773Z
Learning: fjordllc/bootcampプロジェクトでは、マイグレーションにおいてdisable_ddl_transaction!やalgorithm: :concurrentlyは使用せず、標準的なRailsのchangeメソッド内でremove_indexを実行する慣例がある。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: config/initializers/sorcery.rb:0-0
Timestamp: 2025-09-11T16:02:24.782Z
Learning: Rails アップグレードPRにおいて、JWT設定の改善では複数のソース(secrets, credentials, ENV)を優先順位付きで検索し、本番環境では未設定時に起動を停止させる実装が推奨される。開発・テスト環境でのみsecret_key_baseフォールバックを許可する構成が安全である。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: db/migrate/20250828192202_add_missing_columns_to_good_jobs.rb:4-10
Timestamp: 2025-09-11T14:18:20.194Z
Learning: GoodJobやその他の外部gemが生成するマイグレーションファイルは、gem内部のロジックと密接に連携しているため、null制約やデフォルト値の追加などの変更を行うべきではない。gemのアップグレードパスに従い、生成されたマイグレーションをそのまま使用することが適切。
📚 Learning: 2025-11-13T09:20:36.030Z
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9115
File: db/migrate/20250902024949_add_unique_index_to_correct_answers.rb:1-5
Timestamp: 2025-11-13T09:20:36.030Z
Learning: fjordllc/bootcamp プロジェクトでは、データの整合性を保つためのデータ修正には data-migrate gem を使用し、db/data/ ディレクトリ配下にデータマイグレーションファイルを作成する運用を採用している。スキーマ変更(db/migrate/)とデータ変更(db/data/)を分離することで、より安全で管理しやすい構成を実現している。
Applied to files:
config/application.rb
📚 Learning: 2025-09-08T04:55:46.649Z
Learnt from: sharoa119
Repo: fjordllc/bootcamp PR: 8711
File: db/schema.rb:0-0
Timestamp: 2025-09-08T04:55:46.649Z
Learning: In this PR, the removal of length limits from companies.name and companies.website columns in db/schema.rb was unintentional - it was a case of accidentally lost constraints that needed to be restored to their original limits, not a deliberate design change.
Applied to files:
db/schema.rb
📚 Learning: 2025-09-04T01:27:23.422Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/fixtures/buzzes.yml:0-0
Timestamp: 2025-09-04T01:27:23.422Z
Learning: The buzz_controller.rb was indeed deleted, but there are still two remaining items from the old buzz single page implementation that need cleanup: the data migration file db/data/20230726024528_create_buzz.rb and the old buzz route in config/routes.rb line 136. These should be updated/removed to complete the buzz page redesign migration.
Applied to files:
db/schema.rb
📚 Learning: 2025-09-11T14:18:20.194Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: db/migrate/20250828192202_add_missing_columns_to_good_jobs.rb:4-10
Timestamp: 2025-09-11T14:18:20.194Z
Learning: GoodJobやその他の外部gemが生成するマイグレーションファイルは、gem内部のロジックと密接に連携しているため、null制約やデフォルト値の追加などの変更を行うべきではない。gemのアップグレードパスに従い、生成されたマイグレーションをそのまま使用することが適切。
Applied to files:
db/schema.rb
📚 Learning: 2025-09-11T16:02:24.782Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: config/initializers/sorcery.rb:0-0
Timestamp: 2025-09-11T16:02:24.782Z
Learning: Rails アップグレードPRにおいて、JWT設定の改善では複数のソース(secrets, credentials, ENV)を優先順位付きで検索し、本番環境では未設定時に起動を停止させる実装が推奨される。開発・テスト環境でのみsecret_key_baseフォールバックを許可する構成が安全である。
Applied to files:
Gemfile
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to test/**/*_test.rb : Use Minitest + Capybara for system tests; place unit and integration tests under matching `test/*` directories
Applied to files:
Gemfile
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to test/**/*_test.rb : Test suite should use Minitest with structure: `system/`, `models/`, `controllers/`, and fixtures in `test/fixtures/`; test files should be named `*_test.rb`
Applied to files:
Gemfile
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to test/** : Keep tests deterministic and use fixtures stored in `test/fixtures/` for test data
Applied to files:
Gemfile
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build_and_test
🔇 Additional comments (5)
Gemfile (2)
67-67:rails-i18nのバージョン制約解除は適切です。Rails 8.1 との互換性のためにバージョン制約を解除しています。
rails-i18nは通常、Rails バージョンとの互換性を維持しているため、問題ありません。
117-117: minitest < 6.0 制約は再検討が必要です公式の minitest ドキュメントでは、Rails 8.1 は minitest >= 5.1 を要件としており、< 6.0 という上限制約は記載されていません。また、minitest 6.0.0 はアルファ版としてのみリリースされており、安定版は存在しないため、この制約は予見的かつ根拠のない可能性があります。Rails 8.1 と minitest 6.0 の具体的な互換性問題が確認されない限り、この制約を削除するか、より詳細な根拠を文書化することを検討してください。
db/schema.rb (2)
13-16: スキーマバージョン 8.1 への更新と拡張機能の形式変更は適切です。Rails 8.1 では
ActiveRecord::Schema[8.1]とpg_catalog.plpgsqlの形式が使用されます。これらはbin/rails db:schema:dumpによる自動生成の結果であり、正しい更新です。
18-26: カラムのアルファベット順での並び替えは Rails 8 の新しい挙動です。Rails 8 では
db:schema:dumpがカラムをアルファベット順に出力するようになりました。多くのテーブルで~マークが付いていますが、これはカラムの順序変更のみで、実際のデータベース構造には影響しません。これは想定された動作であり、問題ありません。
config/application.rb (1)
12-12: Rails 8.1.1ではconfig.load_defaults 8.1を使用すべきです。Rails 8.1にアップグレードする場合、
config.load_defaultsをそのバージョンに合わせて設定することが推奨されます。8.0に設定したままだと、Rails 8.1で導入された新しいデフォルト設定(開発・テスト環境でのYJIT無効化など)が有効にならず、アプリケーションが最新のデフォルト動作を活用できません。⛔ Skipped due to learnings
Learnt from: komagata Repo: fjordllc/bootcamp PR: 9101 File: config/initializers/sorcery.rb:0-0 Timestamp: 2025-09-11T16:02:24.782Z Learning: Rails アップグレードPRにおいて、JWT設定の改善では複数のソース(secrets, credentials, ENV)を優先順位付きで検索し、本番環境では未設定時に起動を停止させる実装が推奨される。開発・テスト環境でのみsecret_key_baseフォールバックを許可する構成が安全である。Learnt from: komagata Repo: fjordllc/bootcamp PR: 9101 File: app/notifiers/discord_notifier.rb:52-56 Timestamp: 2025-09-12T21:17:45.295Z Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。Learnt from: komagata Repo: fjordllc/bootcamp PR: 9101 File: app/models/graduation_notifier.rb:23-28 Timestamp: 2025-09-12T21:16:47.639Z Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。Learnt from: komagata Repo: fjordllc/bootcamp PR: 9101 File: app/notifiers/discord_notifier.rb:19-23 Timestamp: 2025-09-12T21:17:26.029Z Learning: Rails アップグレードPRにおいて、config_for(:secrets) を使った webhook URL 設定の shared セクション未参照問題は、設定システム全体の変更として別PRで対応すべきである。Learnt from: mousu-a Repo: fjordllc/bootcamp PR: 8566 File: db/migrate/20250830033535_add_default_to_pair_works_wip.rb:1-5 Timestamp: 2025-08-31T03:17:44.812Z Learning: 新機能のマイグレーションで、まだ本番環境にリリースされていない場合は、既存レコードのバックフィル処理は不要。開発環境でrails db:resetが可能な状況では特に、デフォルト値の変更のみで十分。Learnt from: komagata Repo: fjordllc/bootcamp PR: 9101 File: app/notifiers/discord_notifier.rb:131-135 Timestamp: 2025-09-12T21:18:00.834Z Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。Learnt from: komagata Repo: fjordllc/bootcamp PR: 9101 File: app/models/product.rb:59-61 Timestamp: 2025-09-11T14:47:53.256Z Learning: Rails アップグレードPRでは、アップグレードに直接関連しない性能改善や機能追加の提案は避けるべき。PRのスコープを維持することが重要で、そのような改善提案は別PRで対応すべきである。Learnt from: komagata Repo: fjordllc/bootcamp PR: 9101 File: db/migrate/20250828192202_add_missing_columns_to_good_jobs.rb:4-10 Timestamp: 2025-09-11T14:18:20.194Z Learning: GoodJobやその他の外部gemが生成するマイグレーションファイルは、gem内部のロジックと密接に連携しているため、null制約やデフォルト値の追加などの変更を行うべきではない。gemのアップグレードパスに従い、生成されたマイグレーションをそのまま使用することが適切。
| gem 'jbuilder', '~> 2.7' | ||
| gem 'puma', '~> 6.0' | ||
| gem 'rails', '7.2.2.2' | ||
| gem 'rails', '8.1.1' |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# Examine the Gemfile to understand all the changes
cat Gemfile | head -150Repository: fjordllc/bootcamp
Length of output: 3058
Rails 8.1.1 へのアップグレードを承認します。
Rails 8.1.1 へのメジャーアップグレードです。以下の変更についてはスコープ外のため、別 PR での対応を推奨します:
react-railsを GitHub main ブランチから参照する変更:安定性とメンテナンスの観点から、版指定された gem の使用を推奨します。本番環境への影響を考慮し、別 PR で対応してください。minitest < 6.0制約:アップグレードに必須な理由が明確でないため、追加の根拠があれば説明してください。connection_pool 3.0 互換性問題がある場合、その旨を明記してください。
アップグレードに直結しない変更は、PR スコープ維持のため分離を検討してください。
🤖 Prompt for AI Agents
In Gemfile around line 13, the PR upgrades Rails to 8.1.1 but also introduces
out-of-scope changes (switching react-rails to a GitHub main reference and
altering a minitest constraint); for this PR keep only the Rails version bump
and revert or remove any unrelated changes: restore react-rails to a versioned
gem entry (do not point at GitHub main) or move that change to a separate PR,
and either restore the previous minitest constraint or add a brief rationale
(including any connection_pool 3.0 compatibility notes) and move that
justification or change to its own follow-up PR so this change set stays
narrowly scoped to the Rails upgrade.
There was a problem hiding this comment.
Actionable comments posted: 5
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
Gemfile.lockis excluded by!**/*.lockpublic/icon.pngis excluded by!**/*.pngpublic/icon.svgis excluded by!**/*.svg
📒 Files selected for processing (25)
Gemfileapp/jobs/ai_answer_create_job.rbapp/models/ai/answer_generator.rbapp/models/ai_answer_creator.rbapp/models/report_exporter.rbbin/cibin/devbin/rubocopbin/setupconfig/ci.rbconfig/environments/development.rbconfig/environments/production.rbconfig/environments/test.rbconfig/initializers/active_support_notifications.rbconfig/initializers/assets.rbconfig/initializers/content_security_policy.rbconfig/initializers/filter_parameter_logging.rbconfig/initializers/inflections.rbconfig/initializers/new_framework_defaults_8_1.rbconfig/puma.rbpublic/400.htmlpublic/404.htmlpublic/406-unsupported-browser.htmlpublic/422.htmlpublic/500.html
💤 Files with no reviewable changes (1)
- config/environments/test.rb
✅ Files skipped from review due to trivial changes (2)
- config/initializers/assets.rb
- bin/rubocop
🧰 Additional context used
📓 Path-based instructions (3)
app/**/*.{rb,js,ts,jsx,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Rails app code should be organized in
app/directory with subdirectories:models/,controllers/,views/,jobs/,helpers/, and frontend code underjavascript/(Shakapacker)
Files:
app/jobs/ai_answer_create_job.rbapp/models/ai_answer_creator.rbapp/models/report_exporter.rbapp/models/ai/answer_generator.rb
**/*.rb
📄 CodeRabbit inference engine (AGENTS.md)
Ruby code should use 2-space indentation, snake_case for method names, and CamelCase for class names, enforced by RuboCop (
.rubocop.yml)
Files:
app/jobs/ai_answer_create_job.rbapp/models/ai_answer_creator.rbconfig/initializers/active_support_notifications.rbconfig/environments/development.rbconfig/puma.rbconfig/initializers/inflections.rbapp/models/report_exporter.rbconfig/initializers/filter_parameter_logging.rbconfig/ci.rbconfig/initializers/content_security_policy.rbapp/models/ai/answer_generator.rbconfig/initializers/new_framework_defaults_8_1.rbconfig/environments/production.rb
⚙️ CodeRabbit configuration file
**/*.rb: # refactoring
- まずFat Controllerを避け、次にFat Modelを避ける。
- Serviceクラスの乱用を避ける。
- controller concernを作ろうとしたらPORO(Plain Old Ruby Object)やActiveRecordモデルでの実装で代替できないか検討する。
Rails Patterns
- ViewHelperにメソッドを実装する時にはまずDecoratorパターンを使うことを検討する。(active_decorator gemを導入しているのでそれを使う)
- 複雑なActiveRecordクエリがあり、再利用できそうな場合はQueryObjectパターンを検討する。(rails-patterns gemを導入しているのでそれのQuery機能を使う)
- Viewにpartialを作る場合はViewComponentを使うことを検討する。
- 複数のActiveRecordモデルを操作する1つの責務がある時や外部APIとやりとりする処理がある場合にはInteractorオブジェクトパターンを検討する。(interactor gemを導入しているのでそれを使う)
- 複数のInteractorを実行するような処理がある場合Organizerオブジェクトパターンを検討する。(interactor gemを導入しており、その中にOrganizerの機能があるので使う)
Files:
app/jobs/ai_answer_create_job.rbapp/models/ai_answer_creator.rbconfig/initializers/active_support_notifications.rbconfig/environments/development.rbconfig/puma.rbconfig/initializers/inflections.rbapp/models/report_exporter.rbconfig/initializers/filter_parameter_logging.rbconfig/ci.rbconfig/initializers/content_security_policy.rbapp/models/ai/answer_generator.rbconfig/initializers/new_framework_defaults_8_1.rbconfig/environments/production.rb
config/**
📄 CodeRabbit inference engine (AGENTS.md)
Configuration files in
config/should include environment settings, routes, and lints (.rubocop.yml,config/slim_lint.yml)
Files:
config/initializers/active_support_notifications.rbconfig/environments/development.rbconfig/puma.rbconfig/initializers/inflections.rbconfig/initializers/filter_parameter_logging.rbconfig/ci.rbconfig/initializers/content_security_policy.rbconfig/initializers/new_framework_defaults_8_1.rbconfig/environments/production.rb
🧠 Learnings (21)
📓 Common learnings
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/product.rb:59-61
Timestamp: 2025-09-11T14:47:53.256Z
Learning: Rails アップグレードPRでは、アップグレードに直接関連しない性能改善や機能追加の提案は避けるべき。PRのスコープを維持することが重要で、そのような改善提案は別PRで対応すべきである。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:52-56
Timestamp: 2025-09-12T21:17:45.295Z
Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9115
File: db/migrate/20250902024949_add_unique_index_to_correct_answers.rb:1-5
Timestamp: 2025-11-13T09:20:36.030Z
Learning: fjordllc/bootcamp プロジェクトでは、データの整合性を保つためのデータ修正には data-migrate gem を使用し、db/data/ ディレクトリ配下にデータマイグレーションファイルを作成する運用を採用している。スキーマ変更(db/migrate/)とデータ変更(db/data/)を分離することで、より安全で管理しやすい構成を実現している。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: app/controllers/mentor/buzzes_controller.rb:0-0
Timestamp: 2025-09-04T01:39:22.261Z
Learning: fjordllc/bootcamp プロジェクトでは、更新処理の成功時の通知メッセージについて、I18n を使用せずに日本語文字列を直接記述する方針で一貫性を保っている。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:19-23
Timestamp: 2025-09-12T21:17:26.029Z
Learning: Rails アップグレードPRにおいて、config_for(:secrets) を使った webhook URL 設定の shared セクション未参照問題は、設定システム全体の変更として別PRで対応すべきである。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: config/initializers/sorcery.rb:0-0
Timestamp: 2025-09-11T16:02:24.782Z
Learning: Rails アップグレードPRにおいて、JWT設定の改善では複数のソース(secrets, credentials, ENV)を優先順位付きで検索し、本番環境では未設定時に起動を停止させる実装が推奨される。開発・テスト環境でのみsecret_key_baseフォールバックを許可する構成が安全である。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/migrate/20250831234516_remove_unique_index_from_buzzes_title.rb:1-5
Timestamp: 2025-09-04T01:50:47.773Z
Learning: fjordllc/bootcampプロジェクトでは、マイグレーションにおいてdisable_ddl_transaction!やalgorithm: :concurrentlyは使用せず、標準的なRailsのchangeメソッド内でremove_indexを実行する慣例がある。
Learnt from: mousu-a
Repo: fjordllc/bootcamp PR: 8566
File: db/migrate/20250830033535_add_default_to_pair_works_wip.rb:1-5
Timestamp: 2025-08-31T03:17:44.812Z
Learning: 新機能のマイグレーションで、まだ本番環境にリリースされていない場合は、既存レコードのバックフィル処理は不要。開発環境でrails db:resetが可能な状況では特に、デフォルト値の変更のみで十分。
Learnt from: tyrrell-IH
Repo: fjordllc/bootcamp PR: 8807
File: app/views/welcome/job_support.html.slim:391-392
Timestamp: 2025-06-21T22:30:20.116Z
Learning: このプロジェクトにはRailsの組み込みmarkdownヘルパが利用できないため、markdownのHTML変換には自前でヘルパを実装する必要がある。
📚 Learning: 2025-09-12T12:53:17.172Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: public/500.html:2-64
Timestamp: 2025-09-12T12:53:17.172Z
Learning: エラーページ(404.html、422.html、500.html)について不正確な提案をした場合は、実際のファイル内容を確認してから回答すべき。これらのファイルは既に統一されており、追加のメタタグは不要だった。
Applied to files:
public/500.htmlpublic/400.htmlpublic/422.htmlpublic/404.html
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Use `bin/setup` for local database setup and dependency installation; avoid manual tweaks in `config/` without team discussion
Applied to files:
bin/ciconfig/ci.rbbin/devbin/setupconfig/environments/production.rb
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to test/**/*_test.rb : Use Minitest + Capybara for system tests; place unit and integration tests under matching `test/*` directories
Applied to files:
bin/ciconfig/ci.rbGemfilebin/setup
📚 Learning: 2025-11-25T05:42:10.478Z
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9323
File: app/models/question_auto_closer.rb:45-51
Timestamp: 2025-11-25T05:42:10.478Z
Learning: fjordllc/bootcamp の QuestionAutoCloser において、create_warning_message で発行される 'answer.create' イベントは、システムユーザーによる自動クローズ警告メッセージを質問者と既存の監視者に通知するための意図的な設計である。AnswerNotifier と NotifierToWatchingUser による通知は期待される動作。
Applied to files:
config/initializers/active_support_notifications.rb
📚 Learning: 2025-09-11T16:02:24.782Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: config/initializers/sorcery.rb:0-0
Timestamp: 2025-09-11T16:02:24.782Z
Learning: Rails アップグレードPRにおいて、JWT設定の改善では複数のソース(secrets, credentials, ENV)を優先順位付きで検索し、本番環境では未設定時に起動を停止させる実装が推奨される。開発・テスト環境でのみsecret_key_baseフォールバックを許可する構成が安全である。
Applied to files:
config/environments/development.rbconfig/initializers/filter_parameter_logging.rbconfig/initializers/content_security_policy.rbconfig/initializers/new_framework_defaults_8_1.rbGemfileconfig/environments/production.rb
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to config/** : Configuration files in `config/` should include environment settings, routes, and lints (`.rubocop.yml`, `config/slim_lint.yml`)
Applied to files:
config/environments/development.rbconfig/ci.rbconfig/initializers/new_framework_defaults_8_1.rbconfig/environments/production.rb
📚 Learning: 2025-09-04T01:27:23.422Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/fixtures/buzzes.yml:0-0
Timestamp: 2025-09-04T01:27:23.422Z
Learning: The buzz_controller.rb was indeed deleted, but there are still two remaining items from the old buzz single page implementation that need cleanup: the data migration file db/data/20230726024528_create_buzz.rb and the old buzz route in config/routes.rb line 136. These should be updated/removed to complete the buzz page redesign migration.
Applied to files:
config/initializers/inflections.rb
📚 Learning: 2025-09-04T01:27:23.422Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/fixtures/buzzes.yml:0-0
Timestamp: 2025-09-04T01:27:23.422Z
Learning: The buzz_controller.rb and related data migration files were deleted as part of the Buzz page redesign, not just modified. The old single buzz page was completely replaced with a new buzzes (plural) listing page with year-based navigation and metadata structure.
Applied to files:
config/initializers/inflections.rb
📚 Learning: 2025-09-12T21:17:26.029Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:19-23
Timestamp: 2025-09-12T21:17:26.029Z
Learning: Rails アップグレードPRにおいて、config_for(:secrets) を使った webhook URL 設定の shared セクション未参照問題は、設定システム全体の変更として別PRで対応すべきである。
Applied to files:
config/initializers/filter_parameter_logging.rbconfig/initializers/new_framework_defaults_8_1.rbGemfileconfig/environments/production.rb
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: All linters must pass (`bin/lint` command) and CI (CircleCI) must be green before merging; add or adjust tests when changing behavior
Applied to files:
config/ci.rb
📚 Learning: 2025-09-12T21:17:45.295Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:52-56
Timestamp: 2025-09-12T21:17:45.295Z
Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Applied to files:
config/initializers/new_framework_defaults_8_1.rbGemfileconfig/environments/production.rb
📚 Learning: 2025-09-11T14:47:53.256Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/product.rb:59-61
Timestamp: 2025-09-11T14:47:53.256Z
Learning: Rails アップグレードPRでは、アップグレードに直接関連しない性能改善や機能追加の提案は避けるべき。PRのスコープを維持することが重要で、そのような改善提案は別PRで対応すべきである。
Applied to files:
Gemfile
📚 Learning: 2025-09-12T21:16:47.639Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Applied to files:
Gemfile
📚 Learning: 2025-09-12T21:18:00.834Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Applied to files:
Gemfile
📚 Learning: 2025-11-13T09:20:36.030Z
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9115
File: db/migrate/20250902024949_add_unique_index_to_correct_answers.rb:1-5
Timestamp: 2025-11-13T09:20:36.030Z
Learning: fjordllc/bootcamp プロジェクトでは、データの整合性を保つためのデータ修正には data-migrate gem を使用し、db/data/ ディレクトリ配下にデータマイグレーションファイルを作成する運用を採用している。スキーマ変更(db/migrate/)とデータ変更(db/data/)を分離することで、より安全で管理しやすい構成を実現している。
Applied to files:
Gemfile
📚 Learning: 2025-09-04T01:50:47.773Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/migrate/20250831234516_remove_unique_index_from_buzzes_title.rb:1-5
Timestamp: 2025-09-04T01:50:47.773Z
Learning: fjordllc/bootcampプロジェクトでは、マイグレーションにおいてdisable_ddl_transaction!やalgorithm: :concurrentlyは使用せず、標準的なRailsのchangeメソッド内でremove_indexを実行する慣例がある。
Applied to files:
Gemfile
📚 Learning: 2025-07-07T05:28:03.676Z
Learnt from: su-su-su-su
Repo: fjordllc/bootcamp PR: 0
File: :0-0
Timestamp: 2025-07-07T05:28:03.676Z
Learning: fjordllc/bootcampプロジェクトでは、fixtureファイル内のERB構文で改行制御文字(-)は使用せず、標準的な<% %>と<%= %>のみを使用する方針が統一されている。<% -%>や<%- %>を使用するとSyntaxErrorが発生する。
Applied to files:
Gemfile
📚 Learning: 2025-11-17T00:46:30.794Z
Learnt from: tyrrell-IH
Repo: fjordllc/bootcamp PR: 9306
File: app/javascript/components/Bookmarks.jsx:248-265
Timestamp: 2025-11-17T00:46:30.794Z
Learning: fjordllc/bootcamp プロジェクトでは、Reactからバニラ JavaScript への移行作業が進行中である。そのため、新しいReactファイルの作成は避け、既存のReactコンポーネント内で完結する実装が推奨される。BookmarksInDashboard.jsx は issue #9045 で削除予定。
Applied to files:
Gemfile
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to test/**/*_test.rb : Test suite should use Minitest with structure: `system/`, `models/`, `controllers/`, and fixtures in `test/fixtures/`; test files should be named `*_test.rb`
Applied to files:
Gemfile
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to test/** : Keep tests deterministic and use fixtures stored in `test/fixtures/` for test data
Applied to files:
Gemfile
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build_and_test
🔇 Additional comments (29)
config/initializers/content_security_policy.rb (1)
23-26: LGTM! Rails 8 の標準的なドキュメント追加ですRails 8.1 で追加された
content_security_policy_nonce_autoオプションのドキュメントが適切に追加されています。この設定により、CSP nonce ディレクティブが指定されている場合に、javascript_tag、javascript_include_tag、stylesheet_link_tagへ自動的に nonce が追加されます。すべてコメントアウトされているため、機能的な影響はありません。
public/400.html (1)
1-135: Rails 8.1 のデフォルトエラーページとして適切な構成です。レスポンシブデザイン、ダークモード対応、アクセシビリティ(セマンティックHTML、robots noindex/nofollow)が適切に実装されています。
言語が英語(
lang="en")に変更されていますが、これはrails app:updateによる Rails 8.1 のデフォルト設定です。日本語ユーザー向けにローカライズが必要な場合は、別PRで対応することをご検討ください(PRスコープ維持の観点から)。Based on learnings, Rails upgrade PR のスコープ維持が重要です。public/404.html (1)
1-135: LGTM!404ページが Rails 8.1 のデフォルトスタイルに更新されています。他のエラーページと一貫性のある実装です。
public/500.html (1)
1-135: LGTM!500ページが適切に更新されています。外部依存なしで完全に自己完結しており、サーバーエラー時にも確実に表示できます。
public/422.html (1)
1-135: LGTM!422ページが他のエラーページと一貫したスタイルで更新されています。CSRF トークン検証失敗などの際に適切なメッセージが表示されます。
config/puma.rb (1)
28-29: スレッド設定の動的化は適切です。既にdatabase.ymlでpool: <%= ENV.fetch("RAILS_MAX_THREADS") %>が設定されているため、データベース接続プールは自動的にスレッド数と同期されます。bin/dev (1)
1-2: LGTM! Rails 8.x の標準的な dev サーバー起動スクリプトですシンプルで正しい実装です。
execを使用してプロセスを置き換え、コマンドライン引数を適切に転送しています。bin/setup との統合も適切に行われています。bin/ci (1)
1-6: LGTM! Rails 8.x の標準的な CI 実行スクリプトですActiveSupport::ContinuousIntegration を正しく読み込み、config/ci.rb と連携する構成になっています。Rails 8.x のベストプラクティスに従った実装です。
bin/setup (2)
25-25: LGTM! オプショナルなデータベースリセット機能の追加
--resetフラグにより、開発環境のデータベースをクリーンな状態に戻せるようになっています。bin/setup の冪等性を保ちつつ、必要に応じて完全なリセットを実行できる適切な実装です。
30-34: LGTM! CI 統合のための適切な条件分岐
--skip-serverフラグにより、CI 環境(config/ci.rb で使用)では開発サーバーの起動をスキップできます。STDOUT.flushによる出力の確実な表示と、exec "bin/dev"による新しい Rails 8.x パターンへの移行が適切に実装されています。config/ci.rb (1)
3-12: LGTM! Rails 8.x の CI パイプライン構成が適切ですCI.run DSL を使用した論理的なステップ構成になっています:
- セットアップ(
--skip-serverフラグで CI 環境に対応)- スタイルチェック(RuboCop)
- セキュリティ監査(Importmap)
- テスト実行(通常テストとシステムテスト)
- Seed ファイルの検証
各ステップは適切に分離されており、Rails 8.x のベストプラクティスに従っています。
config/environments/development.rb (4)
70-71: LGTM!新しいリダイレクトログ機能。
verbose_redirect_logsは Rails 8.1 で追加された開発環境向けの機能で、リダイレクトをトリガーしたコードをログでハイライトします。既存のverbose_query_logsやverbose_enqueue_logsと一貫性があり、デバッグに役立ちます。
59-61: Rails 8.1 の query_log_tags_enabled は正しく実装されています。Rails 8.1 で導入された Active Record のクエリログ タグ機能が正しく設定されており、有効化時には SQLCommenter 形式でランタイムタグ(application、controller、action、job、pid など)がSQL コメントとして追加されます。development 環境での設定として適切です。
28-30: Rails 8.1 ではこれが正しい設定です。config.cache_store = :memory_storeとconfig.action_controller.perform_cachingは別の設定で、キャッシュストアの種類を指定する前者と、実際にキャッシュを使用するかどうかを制御する後者は独立しています。perform_caching = falseの場合、メモリストアは使用されません。コメントの:null_storeへの変更は、すべてのキャッシュを完全に無効にしたい場合のオプション提案であり、デフォルト設定として :memory_store を使用することは Rails 8.1 の標準パターンです。
23-23: Rails 8.1では、Rack 3の仕様に基づきHTTPヘッダーキーは小文字に正規化されます。"Cache-Control"から"cache-control"への変更はRails 8.1の標準動作です。app/models/report_exporter.rb (1)
19-19: rubyzip API の更新を承認します。
Zip::File::CREATE定数からcreate: trueキーワード引数への変更は、rubyzip gem の API 更新に対応した標準的な移行です。機能的には同等の動作を維持しています。Gemfile (1)
8-121: Rails 8.1.1 へのアップグレードを承認します。依存関係の更新は Rails 8.1.1 との互換性を確保するための標準的な変更です。
react-railsの GitHub 参照とminitestの制約については、既存のレビューコメントで指摘されています。config/initializers/new_framework_defaults_8_1.rb (1)
1-74: Rails 8.1 フレームワークデフォルトの段階的な移行をサポートします。この初期化ファイルは Rails 8.1 の新しいデフォルト設定を段階的に有効化するための標準的な構成です。すべての設定がコメントアウトされており、アプリケーションの準備が整った段階で個別に有効化できます。
なお、Line 43-44 に記載されているように、
raise_on_missing_required_finder_order_columnsは Rails 8.2 で必須となる予定です。今後のアップグレードに向けて、早めの対応を検討してください。config/initializers/filter_parameter_logging.rb (1)
7-7: パラメータフィルタリングの強化を承認します。
:cvv、:cvcをフィルタ対象に追加することで、ログからの個人情報およびクレジットカード情報の漏洩リスクを低減します。Rails 8.1 のセキュリティとプライバシー保護のベストプラクティスに沿った変更です。config/initializers/active_support_notifications.rb (1)
56-56: クラス参照の更新を承認します。
AIAnswerCreatorからAiAnswerCreatorへの変更は、app/models/ai_answer_creator.rbでのクラス名変更に対応した更新です。名前空間の統一に沿った変更であり、問題ありません。app/models/ai_answer_creator.rb (1)
3-7: クラス名とジョブ参照の更新を承認します。
AIAnswerCreatorからAiAnswerCreatorへのクラス名変更、およびAiAnswerCreateJobへのジョブ参照の更新は、プロジェクト全体の名前空間統一の一部として適切です。関連ファイルとの整合性が取れています。config/initializers/inflections.rb (1)
14-16: インフレクションルール削除時に API と FAQ の影響を確認してください。
AIアクロニムの削除はAi::AnswerGenerator名前空間への移行に必要な変更です。しかし、同時に削除されたAPIとFAQのアクロニム規則は、コードベースで実際に使用されています。コードベースに以下の実装があるため、これらのインフレクションルール削除による影響を検証する必要があります:
- API: 複数の
API::*Controllerクラス(例:API::UsersController,API::SessionControllerなど)が app/controllers/api/ に存在- FAQ:
FAQモデルクラスとそれに関連するルート、ビューが存在(例:app/models/faq.rb, admin/faqs_controller.rb)これらのインフレクションルール削除は Rails のルート生成や URL ヘルパー名に影響を与える可能性があります。
buzzとprogressはアクティブに使用されていないため、削除しても問題ありませんが、APIとFAQに関しては現在のアプリケーションを実際に実行して、ルート生成と URL ヘルパーが正常に機能することを確認してください。app/jobs/ai_answer_create_job.rb (1)
3-9: LGTM! 名前空間の統一が適切に実施されています
AI→Aiへの名前空間変更は、Rubyの命名規則に準拠しており、クラス名とモジュール名が一貫して更新されています。ロジックには変更がなく、安全なリファクタリングです。config/environments/production.rb (6)
9-19: Rails 8.1 のデフォルト設定に適切に対応していますeager load、キャッシング、アセットヘッダーの設定がRails 8.1の推奨設定に更新されています。特に
public_file_server.headersによる遠い未来の有効期限設定は、ダイジェスト付きアセットのキャッシング戦略として適切です。
36-44: Rails 8 のロギング機能が適切に設定されていますSTDOUTへのログ出力とヘルスチェックパスの除外設定は、Cloud Run等のコンテナ環境に最適な構成です。特に
silence_healthcheck_pathはRails 8の新機能で、ヘルスチェックによるログの肥大化を防ぎます。
46-54: 本番環境の設定として適切です非推奨機能のレポートを無効化し、キャッシュとジョブキューの設定コメントを更新しています。Rails 8.1のベストプラクティスに沿った構成です。
59-69: メーラー設定のテンプレートが追加されていますデフォルトのホスト名は
"example.com"ですが、Lines 98-101 でAPP_HOST_NAMEが設定されている場合は上書きされるため、実運用上は問題ありません。SMTPの設定例もコメントで提供されており、ドキュメントとして有用です。
90-95: 本番環境の必須環境変数検証が追加されています
APP_HOST_NAMEの存在チェックにより、本番環境での設定ミスを起動時に検出できます。アセットプリコンパイル時のスキップロジックも適切です。
97-114: 本番環境のURL設定が適切に構成されています
APP_HOST_NAMEに基づく条件付き設定により、メーラーとアセットホストが正しく構成されます。HTTPSプロトコルの強制とCloud Runホストの許可リスト追加も、セキュリティ面で適切な対応です。
| main article br { | ||
| display: none; | ||
|
|
||
| @media(min-width: 48em) { | ||
| display: inline; | ||
| } | ||
| } |
There was a problem hiding this comment.
CSS ネスティングが未対応ブラウザページで使用されています。
このファイルは古いブラウザ向けの 406 ページですが、CSS ネスティング構文(@media をルール内にネスト)は比較的新しい機能です(Chrome 120+、Firefox 117+、Safari 17.2+)。
ターゲットとなる古いブラウザでは、このルールが無視される可能性があります。ただし、影響は <br> の表示切り替えのみであり、ページの主要機能には影響しません。
🔎 従来の構文への修正案
main article br {
display: none;
-
- @media(min-width: 48em) {
- display: inline;
- }
}
+ @media(min-width: 48em) {
+ main article br {
+ display: inline;
+ }
+ }
+
</style>Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In public/406-unsupported-browser.html around lines 108 to 114, the CSS uses
nested @media inside the main article br rule which older browsers may ignore;
change to the traditional syntax by keeping the base rule (main article br {
display: none; }) and moving the media query out as a separate top-level rule:
@media (min-width: 48em) { main article br { display: inline; } } so the display
toggle works on legacy browsers.
5d440f2 to
b550504
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (3)
public/406-unsupported-browser.html (1)
108-114: CSSネスティングの使用は古いブラウザ向けページでは問題があります。この件は既にレビューで指摘されています。古いブラウザ向けの406ページでCSSネスティング構文を使用すると、ターゲットブラウザでルールが無視される可能性があります。
過去のレビューコメントで提案された従来の構文への修正を検討してください。
config/ci.rb (1)
8-8: bin/importmap コマンドが存在しないため CI ステップが失敗します
bin/importmapはリポジトリに存在しないため、このステップはCI実行時に失敗します。importmap を使用する場合は適切にセットアップするか、不要な場合はこのステップを削除してください。config/environments/production.rb (1)
25-25: 本番環境のActive Storageサービスを:googleに変更してください
config.active_storage.service = :localは本番環境に不適切です。Cloud Run環境ではローカルファイルシステムは揮発性であり、コンテナの再起動時にアップロードされたファイルが失われます。
config/storage.ymlで既に
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
public/icon.pngis excluded by!**/*.pngpublic/icon.svgis excluded by!**/*.svg
📒 Files selected for processing (23)
app/jobs/ai_answer_create_job.rbapp/models/ai/answer_generator.rbapp/models/ai_answer_creator.rbbin/cibin/devbin/rubocopbin/setupconfig/ci.rbconfig/environments/development.rbconfig/environments/production.rbconfig/environments/test.rbconfig/initializers/active_support_notifications.rbconfig/initializers/assets.rbconfig/initializers/content_security_policy.rbconfig/initializers/filter_parameter_logging.rbconfig/initializers/inflections.rbconfig/initializers/new_framework_defaults_8_1.rbconfig/puma.rbpublic/400.htmlpublic/404.htmlpublic/406-unsupported-browser.htmlpublic/422.htmlpublic/500.html
💤 Files with no reviewable changes (1)
- config/environments/test.rb
✅ Files skipped from review due to trivial changes (1)
- config/initializers/content_security_policy.rb
🚧 Files skipped from review as they are similar to previous changes (7)
- config/puma.rb
- app/models/ai/answer_generator.rb
- config/initializers/new_framework_defaults_8_1.rb
- config/initializers/active_support_notifications.rb
- public/500.html
- bin/ci
- config/initializers/assets.rb
🧰 Additional context used
📓 Path-based instructions (3)
app/**/*.{rb,js,ts,jsx,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Rails app code should be organized in
app/directory with subdirectories:models/,controllers/,views/,jobs/,helpers/, and frontend code underjavascript/(Shakapacker)
Files:
app/jobs/ai_answer_create_job.rbapp/models/ai_answer_creator.rb
**/*.rb
📄 CodeRabbit inference engine (AGENTS.md)
Ruby code should use 2-space indentation, snake_case for method names, and CamelCase for class names, enforced by RuboCop (
.rubocop.yml)
Files:
app/jobs/ai_answer_create_job.rbconfig/initializers/inflections.rbconfig/environments/development.rbconfig/ci.rbconfig/initializers/filter_parameter_logging.rbapp/models/ai_answer_creator.rbconfig/environments/production.rb
⚙️ CodeRabbit configuration file
**/*.rb: # refactoring
- まずFat Controllerを避け、次にFat Modelを避ける。
- Serviceクラスの乱用を避ける。
- controller concernを作ろうとしたらPORO(Plain Old Ruby Object)やActiveRecordモデルでの実装で代替できないか検討する。
Rails Patterns
- ViewHelperにメソッドを実装する時にはまずDecoratorパターンを使うことを検討する。(active_decorator gemを導入しているのでそれを使う)
- 複雑なActiveRecordクエリがあり、再利用できそうな場合はQueryObjectパターンを検討する。(rails-patterns gemを導入しているのでそれのQuery機能を使う)
- Viewにpartialを作る場合はViewComponentを使うことを検討する。
- 複数のActiveRecordモデルを操作する1つの責務がある時や外部APIとやりとりする処理がある場合にはInteractorオブジェクトパターンを検討する。(interactor gemを導入しているのでそれを使う)
- 複数のInteractorを実行するような処理がある場合Organizerオブジェクトパターンを検討する。(interactor gemを導入しており、その中にOrganizerの機能があるので使う)
Files:
app/jobs/ai_answer_create_job.rbconfig/initializers/inflections.rbconfig/environments/development.rbconfig/ci.rbconfig/initializers/filter_parameter_logging.rbapp/models/ai_answer_creator.rbconfig/environments/production.rb
config/**
📄 CodeRabbit inference engine (AGENTS.md)
Configuration files in
config/should include environment settings, routes, and lints (.rubocop.yml,config/slim_lint.yml)
Files:
config/initializers/inflections.rbconfig/environments/development.rbconfig/ci.rbconfig/initializers/filter_parameter_logging.rbconfig/environments/production.rb
🧠 Learnings (14)
📓 Common learnings
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/product.rb:59-61
Timestamp: 2025-09-11T14:47:53.256Z
Learning: Rails アップグレードPRでは、アップグレードに直接関連しない性能改善や機能追加の提案は避けるべき。PRのスコープを維持することが重要で、そのような改善提案は別PRで対応すべきである。
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9115
File: db/migrate/20250902024949_add_unique_index_to_correct_answers.rb:1-5
Timestamp: 2025-11-13T09:20:36.030Z
Learning: fjordllc/bootcamp プロジェクトでは、データの整合性を保つためのデータ修正には data-migrate gem を使用し、db/data/ ディレクトリ配下にデータマイグレーションファイルを作成する運用を採用している。スキーマ変更(db/migrate/)とデータ変更(db/data/)を分離することで、より安全で管理しやすい構成を実現している。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:52-56
Timestamp: 2025-09-12T21:17:45.295Z
Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: app/controllers/mentor/buzzes_controller.rb:0-0
Timestamp: 2025-09-04T01:39:22.261Z
Learning: fjordllc/bootcamp プロジェクトでは、更新処理の成功時の通知メッセージについて、I18n を使用せずに日本語文字列を直接記述する方針で一貫性を保っている。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/migrate/20250831234516_remove_unique_index_from_buzzes_title.rb:1-5
Timestamp: 2025-09-04T01:50:47.773Z
Learning: fjordllc/bootcampプロジェクトでは、マイグレーションにおいてdisable_ddl_transaction!やalgorithm: :concurrentlyは使用せず、標準的なRailsのchangeメソッド内でremove_indexを実行する慣例がある。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: config/initializers/sorcery.rb:0-0
Timestamp: 2025-09-11T16:02:24.782Z
Learning: Rails アップグレードPRにおいて、JWT設定の改善では複数のソース(secrets, credentials, ENV)を優先順位付きで検索し、本番環境では未設定時に起動を停止させる実装が推奨される。開発・テスト環境でのみsecret_key_baseフォールバックを許可する構成が安全である。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:19-23
Timestamp: 2025-09-12T21:17:26.029Z
Learning: Rails アップグレードPRにおいて、config_for(:secrets) を使った webhook URL 設定の shared セクション未参照問題は、設定システム全体の変更として別PRで対応すべきである。
📚 Learning: 2025-09-04T01:27:23.422Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/fixtures/buzzes.yml:0-0
Timestamp: 2025-09-04T01:27:23.422Z
Learning: The buzz_controller.rb was indeed deleted, but there are still two remaining items from the old buzz single page implementation that need cleanup: the data migration file db/data/20230726024528_create_buzz.rb and the old buzz route in config/routes.rb line 136. These should be updated/removed to complete the buzz page redesign migration.
Applied to files:
config/initializers/inflections.rb
📚 Learning: 2025-09-04T01:27:23.422Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/fixtures/buzzes.yml:0-0
Timestamp: 2025-09-04T01:27:23.422Z
Learning: The buzz_controller.rb and related data migration files were deleted as part of the Buzz page redesign, not just modified. The old single buzz page was completely replaced with a new buzzes (plural) listing page with year-based navigation and metadata structure.
Applied to files:
config/initializers/inflections.rb
📚 Learning: 2025-09-12T21:17:45.295Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:52-56
Timestamp: 2025-09-12T21:17:45.295Z
Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Applied to files:
config/environments/development.rb
📚 Learning: 2025-09-11T16:02:24.782Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: config/initializers/sorcery.rb:0-0
Timestamp: 2025-09-11T16:02:24.782Z
Learning: Rails アップグレードPRにおいて、JWT設定の改善では複数のソース(secrets, credentials, ENV)を優先順位付きで検索し、本番環境では未設定時に起動を停止させる実装が推奨される。開発・テスト環境でのみsecret_key_baseフォールバックを許可する構成が安全である。
Applied to files:
config/environments/development.rbconfig/ci.rbconfig/initializers/filter_parameter_logging.rbconfig/environments/production.rb
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to config/** : Configuration files in `config/` should include environment settings, routes, and lints (`.rubocop.yml`, `config/slim_lint.yml`)
Applied to files:
config/environments/development.rbbin/rubocopconfig/environments/production.rb
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: All linters must pass (`bin/lint` command) and CI (CircleCI) must be green before merging; add or adjust tests when changing behavior
Applied to files:
config/ci.rb
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Use `bin/setup` for local database setup and dependency installation; avoid manual tweaks in `config/` without team discussion
Applied to files:
config/ci.rbbin/setupbin/devconfig/environments/production.rb
📚 Learning: 2025-09-12T21:17:26.029Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:19-23
Timestamp: 2025-09-12T21:17:26.029Z
Learning: Rails アップグレードPRにおいて、config_for(:secrets) を使った webhook URL 設定の shared セクション未参照問題は、設定システム全体の変更として別PRで対応すべきである。
Applied to files:
config/ci.rbconfig/initializers/filter_parameter_logging.rbconfig/environments/production.rb
📚 Learning: 2025-11-13T09:20:36.030Z
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9115
File: db/migrate/20250902024949_add_unique_index_to_correct_answers.rb:1-5
Timestamp: 2025-11-13T09:20:36.030Z
Learning: fjordllc/bootcamp プロジェクトでは、データの整合性を保つためのデータ修正には data-migrate gem を使用し、db/data/ ディレクトリ配下にデータマイグレーションファイルを作成する運用を採用している。スキーマ変更(db/migrate/)とデータ変更(db/data/)を分離することで、より安全で管理しやすい構成を実現している。
Applied to files:
config/ci.rb
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to test/**/*_test.rb : Use Minitest + Capybara for system tests; place unit and integration tests under matching `test/*` directories
Applied to files:
config/ci.rbbin/setup
📚 Learning: 2025-09-12T12:53:17.172Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: public/500.html:2-64
Timestamp: 2025-09-12T12:53:17.172Z
Learning: エラーページ(404.html、422.html、500.html)について不正確な提案をした場合は、実際のファイル内容を確認してから回答すべき。これらのファイルは既に統一されており、追加のメタタグは不要だった。
Applied to files:
public/404.htmlpublic/422.htmlpublic/400.html
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to **/*.rb : Ruby code should use 2-space indentation, snake_case for method names, and CamelCase for class names, enforced by RuboCop (`.rubocop.yml`)
Applied to files:
bin/rubocop
📚 Learning: 2025-08-26T07:31:10.235Z
Learnt from: sekito1107
Repo: fjordllc/bootcamp PR: 9081
File: test/models/transcoder/movie_test.rb:0-0
Timestamp: 2025-08-26T07:31:10.235Z
Learning: Transcoder::Movie クラス(app/models/transcoder/movie.rb)では、Google::Cloud::Storage::FileVerificationError(Storage固有の例外)とGoogle::Cloud::Storage.new(メインクラス)の両方を使用しているため、テストファイルでは完全な google/cloud/storage gem の require が必要。google/cloud/errors gem だけでは不十分。
Applied to files:
config/environments/production.rb
🧬 Code graph analysis (1)
app/models/ai_answer_creator.rb (2)
app/models/ai/answer_generator.rb (1)
call(21-36)app/controllers/api/answers_controller.rb (1)
question(58-60)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build_and_test
🔇 Additional comments (13)
config/initializers/filter_parameter_logging.rb (1)
7-7: Rails 8.1のデフォルトフィルタパラメータの更新です。Rails 8.x以降、
:cvvと:cvcがデフォルトのフィルタパラメータに追加されました。bin/dev (1)
1-2: LGTM!Rails 8の標準的な
bin/devスクリプトです。execでプロセスを置き換え、引数を正しく転送しています。bin/rubocop (1)
5-5: LGTM!コメントのスタイル改善のみで、機能的な変更はありません。
bin/setup (2)
25-25: LGTM!
--resetオプションによるデータベースリセット機能の追加は便利です。
30-34: LGTM!
--skip-serverオプションの追加はCI環境で有用です。STDOUT.flushをexec前に呼び出すのは、出力が確実に表示されるための良いプラクティスです。public/404.html (1)
1-135: エラーページの言語変更について確認してください。404ページが日本語から英語に変更されています。fjordllc/bootcampは日本語のユーザー向けサービスと思われますが、エラーページを英語にする意図を確認してください。
なお、レイアウトとスタイリングについてはモダンでレスポンシブなデザインになっており、ダークモード対応も良好です。
public/400.html (1)
1-135: LGTM!他のエラーページと一貫したスタイリングで、400 Bad Requestページが追加されています。言語に関する確認は404.htmlのコメントを参照してください。
public/422.html (1)
1-135: LGTM!他のエラーページと一貫したスタイリングです。
config/environments/development.rb (4)
23-23: LGTM!HTTPヘッダー名を小文字に変更しています。HTTP/2では小文字が推奨されるため、適切な変更です。
28-29: LGTM!
cache_storeを条件分岐の外に移動し、常に設定されるようになりました。Rails 8.1の標準的な構成です。
59-60: LGTM!
query_log_tags_enabledを有効化することで、SQLクエリログにランタイム情報タグが追加され、デバッグが容易になります。
70-71: LGTM!
verbose_redirect_logsを有効化することで、リダイレクトをトリガーしたコードがログにハイライトされます。デバッグに有用な設定です。app/jobs/ai_answer_create_job.rb (1)
3-3: クラス名とモジュール参照の変更が正しく行われています
AIAnswerCreateJobからAiAnswerCreateJobへの改名、およびAI::AnswerGeneratorからAi::AnswerGeneratorへの参照更新は、inflection設定の削除と整合性が取れています。他のファイル(app/models/ai_answer_creator.rb)でもこのジョブの呼び出しが更新されていることを確認しました。Also applies to: 9-9
b550504 to
9817262
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
config/environments/production.rb (1)
106-107:app_host_nameがnilの場合にconfig.hostsへnilが追加されます。Line 106は
CLOUD_RUN_HOST_NAMEの存在チェックがありますが、Line 107にはapp_host_nameのガードがありません。アセットプリコンパイル時(SECRET_KEY_BASE == "dummy")にapp_host_nameがnilとなる可能性があります。🔎 修正案
config.hosts << ENV["CLOUD_RUN_HOST_NAME"] if ENV["CLOUD_RUN_HOST_NAME"] - config.hosts << app_host_name + config.hosts << app_host_name if app_host_name.present?
♻️ Duplicate comments (2)
config/environments/production.rb (1)
25-25: 本番環境のActive Storageサービス設定を修正してください。
:localは本番環境に不適切です。Cloud Run環境ではコンテナの再起動時にファイルが失われます。config/storage.ymlで定義済みのconfig/ci.rb (1)
8-8:bin/importmapが存在しないためCIが失敗します。このプロジェクトではimportmapを使用していない可能性があります。このステップを削除するか、適切なセキュリティ監査コマンドに置き換えてください。
🧹 Nitpick comments (1)
public/404.html (1)
1-135: エラーページの英語化についてRails 8.1のデフォルトエラーページに更新されていますが、このプロジェクトは日本語アプリケーションのため、エラーページも日本語にすることを検討してもよいかもしれません。ただし、Rails upgradeのスコープを考慮すると、別PRで対応する方が適切です。
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
public/icon.pngis excluded by!**/*.pngpublic/icon.svgis excluded by!**/*.svg
📒 Files selected for processing (18)
bin/cibin/devbin/rubocopbin/setupconfig/ci.rbconfig/environments/development.rbconfig/environments/production.rbconfig/environments/test.rbconfig/initializers/assets.rbconfig/initializers/content_security_policy.rbconfig/initializers/filter_parameter_logging.rbconfig/initializers/new_framework_defaults_8_1.rbconfig/puma.rbpublic/400.htmlpublic/404.htmlpublic/406-unsupported-browser.htmlpublic/422.htmlpublic/500.html
💤 Files with no reviewable changes (1)
- config/environments/test.rb
🚧 Files skipped from review as they are similar to previous changes (5)
- config/initializers/assets.rb
- bin/dev
- config/puma.rb
- config/initializers/content_security_policy.rb
- public/400.html
🧰 Additional context used
📓 Path-based instructions (2)
config/**
📄 CodeRabbit inference engine (AGENTS.md)
Configuration files in
config/should include environment settings, routes, and lints (.rubocop.yml,config/slim_lint.yml)
Files:
config/initializers/filter_parameter_logging.rbconfig/environments/development.rbconfig/ci.rbconfig/initializers/new_framework_defaults_8_1.rbconfig/environments/production.rb
**/*.rb
📄 CodeRabbit inference engine (AGENTS.md)
Ruby code should use 2-space indentation, snake_case for method names, and CamelCase for class names, enforced by RuboCop (
.rubocop.yml)
Files:
config/initializers/filter_parameter_logging.rbconfig/environments/development.rbconfig/ci.rbconfig/initializers/new_framework_defaults_8_1.rbconfig/environments/production.rb
⚙️ CodeRabbit configuration file
**/*.rb: # refactoring
- まずFat Controllerを避け、次にFat Modelを避ける。
- Serviceクラスの乱用を避ける。
- controller concernを作ろうとしたらPORO(Plain Old Ruby Object)やActiveRecordモデルでの実装で代替できないか検討する。
Rails Patterns
- ViewHelperにメソッドを実装する時にはまずDecoratorパターンを使うことを検討する。(active_decorator gemを導入しているのでそれを使う)
- 複雑なActiveRecordクエリがあり、再利用できそうな場合はQueryObjectパターンを検討する。(rails-patterns gemを導入しているのでそれのQuery機能を使う)
- Viewにpartialを作る場合はViewComponentを使うことを検討する。
- 複数のActiveRecordモデルを操作する1つの責務がある時や外部APIとやりとりする処理がある場合にはInteractorオブジェクトパターンを検討する。(interactor gemを導入しているのでそれを使う)
- 複数のInteractorを実行するような処理がある場合Organizerオブジェクトパターンを検討する。(interactor gemを導入しており、その中にOrganizerの機能があるので使う)
Files:
config/initializers/filter_parameter_logging.rbconfig/environments/development.rbconfig/ci.rbconfig/initializers/new_framework_defaults_8_1.rbconfig/environments/production.rb
🧠 Learnings (12)
📓 Common learnings
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/product.rb:59-61
Timestamp: 2025-09-11T14:47:53.256Z
Learning: Rails アップグレードPRでは、アップグレードに直接関連しない性能改善や機能追加の提案は避けるべき。PRのスコープを維持することが重要で、そのような改善提案は別PRで対応すべきである。
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9115
File: db/migrate/20250902024949_add_unique_index_to_correct_answers.rb:1-5
Timestamp: 2025-11-13T09:20:36.030Z
Learning: fjordllc/bootcamp プロジェクトでは、データの整合性を保つためのデータ修正には data-migrate gem を使用し、db/data/ ディレクトリ配下にデータマイグレーションファイルを作成する運用を採用している。スキーマ変更(db/migrate/)とデータ変更(db/data/)を分離することで、より安全で管理しやすい構成を実現している。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:52-56
Timestamp: 2025-09-12T21:17:45.295Z
Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: app/controllers/mentor/buzzes_controller.rb:0-0
Timestamp: 2025-09-04T01:39:22.261Z
Learning: fjordllc/bootcamp プロジェクトでは、更新処理の成功時の通知メッセージについて、I18n を使用せずに日本語文字列を直接記述する方針で一貫性を保っている。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/migrate/20250831234516_remove_unique_index_from_buzzes_title.rb:1-5
Timestamp: 2025-09-04T01:50:47.773Z
Learning: fjordllc/bootcampプロジェクトでは、マイグレーションにおいてdisable_ddl_transaction!やalgorithm: :concurrentlyは使用せず、標準的なRailsのchangeメソッド内でremove_indexを実行する慣例がある。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: config/initializers/sorcery.rb:0-0
Timestamp: 2025-09-11T16:02:24.782Z
Learning: Rails アップグレードPRにおいて、JWT設定の改善では複数のソース(secrets, credentials, ENV)を優先順位付きで検索し、本番環境では未設定時に起動を停止させる実装が推奨される。開発・テスト環境でのみsecret_key_baseフォールバックを許可する構成が安全である。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:19-23
Timestamp: 2025-09-12T21:17:26.029Z
Learning: Rails アップグレードPRにおいて、config_for(:secrets) を使った webhook URL 設定の shared セクション未参照問題は、設定システム全体の変更として別PRで対応すべきである。
Learnt from: mousu-a
Repo: fjordllc/bootcamp PR: 8566
File: db/migrate/20250830033535_add_default_to_pair_works_wip.rb:1-5
Timestamp: 2025-08-31T03:17:44.812Z
Learning: 新機能のマイグレーションで、まだ本番環境にリリースされていない場合は、既存レコードのバックフィル処理は不要。開発環境でrails db:resetが可能な状況では特に、デフォルト値の変更のみで十分。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: db/migrate/20250828192202_add_missing_columns_to_good_jobs.rb:4-10
Timestamp: 2025-09-11T14:18:20.194Z
Learning: GoodJobやその他の外部gemが生成するマイグレーションファイルは、gem内部のロジックと密接に連携しているため、null制約やデフォルト値の追加などの変更を行うべきではない。gemのアップグレードパスに従い、生成されたマイグレーションをそのまま使用することが適切。
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Use `bin/setup` for local database setup and dependency installation; avoid manual tweaks in `config/` without team discussion
Applied to files:
bin/cibin/setupconfig/ci.rbconfig/environments/production.rb
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to test/**/*_test.rb : Use Minitest + Capybara for system tests; place unit and integration tests under matching `test/*` directories
Applied to files:
bin/cibin/setupconfig/ci.rb
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to **/*.rb : Ruby code should use 2-space indentation, snake_case for method names, and CamelCase for class names, enforced by RuboCop (`.rubocop.yml`)
Applied to files:
bin/rubocop
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to config/** : Configuration files in `config/` should include environment settings, routes, and lints (`.rubocop.yml`, `config/slim_lint.yml`)
Applied to files:
bin/rubocopconfig/environments/development.rbconfig/ci.rbconfig/initializers/new_framework_defaults_8_1.rbconfig/environments/production.rb
📚 Learning: 2025-09-11T16:02:24.782Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: config/initializers/sorcery.rb:0-0
Timestamp: 2025-09-11T16:02:24.782Z
Learning: Rails アップグレードPRにおいて、JWT設定の改善では複数のソース(secrets, credentials, ENV)を優先順位付きで検索し、本番環境では未設定時に起動を停止させる実装が推奨される。開発・テスト環境でのみsecret_key_baseフォールバックを許可する構成が安全である。
Applied to files:
config/initializers/filter_parameter_logging.rbconfig/environments/development.rbconfig/ci.rbconfig/initializers/new_framework_defaults_8_1.rbconfig/environments/production.rb
📚 Learning: 2025-09-12T21:17:26.029Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:19-23
Timestamp: 2025-09-12T21:17:26.029Z
Learning: Rails アップグレードPRにおいて、config_for(:secrets) を使った webhook URL 設定の shared セクション未参照問題は、設定システム全体の変更として別PRで対応すべきである。
Applied to files:
config/initializers/filter_parameter_logging.rbconfig/ci.rbconfig/initializers/new_framework_defaults_8_1.rbconfig/environments/production.rb
📚 Learning: 2025-09-12T21:17:45.295Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:52-56
Timestamp: 2025-09-12T21:17:45.295Z
Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Applied to files:
config/environments/development.rbconfig/initializers/new_framework_defaults_8_1.rb
📚 Learning: 2025-11-13T09:20:36.030Z
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9115
File: db/migrate/20250902024949_add_unique_index_to_correct_answers.rb:1-5
Timestamp: 2025-11-13T09:20:36.030Z
Learning: fjordllc/bootcamp プロジェクトでは、データの整合性を保つためのデータ修正には data-migrate gem を使用し、db/data/ ディレクトリ配下にデータマイグレーションファイルを作成する運用を採用している。スキーマ変更(db/migrate/)とデータ変更(db/data/)を分離することで、より安全で管理しやすい構成を実現している。
Applied to files:
config/ci.rb
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: All linters must pass (`bin/lint` command) and CI (CircleCI) must be green before merging; add or adjust tests when changing behavior
Applied to files:
config/ci.rb
📚 Learning: 2025-09-12T12:53:17.172Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: public/500.html:2-64
Timestamp: 2025-09-12T12:53:17.172Z
Learning: エラーページ(404.html、422.html、500.html)について不正確な提案をした場合は、実際のファイル内容を確認してから回答すべき。これらのファイルは既に統一されており、追加のメタタグは不要だった。
Applied to files:
public/404.htmlpublic/500.htmlpublic/422.html
📚 Learning: 2025-08-26T07:31:10.235Z
Learnt from: sekito1107
Repo: fjordllc/bootcamp PR: 9081
File: test/models/transcoder/movie_test.rb:0-0
Timestamp: 2025-08-26T07:31:10.235Z
Learning: Transcoder::Movie クラス(app/models/transcoder/movie.rb)では、Google::Cloud::Storage::FileVerificationError(Storage固有の例外)とGoogle::Cloud::Storage.new(メインクラス)の両方を使用しているため、テストファイルでは完全な google/cloud/storage gem の require が必要。google/cloud/errors gem だけでは不十分。
Applied to files:
config/environments/production.rb
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build_and_test
🔇 Additional comments (14)
public/406-unsupported-browser.html (1)
1-135: エラーページの更新確認Rails 8.1のデフォルトエラーページに更新されています。過去のレビューでCSS nestingについてのコメントがありましたが、Rails 8.1のデフォルトファイルをそのまま採用する方針であれば問題ありません。
public/500.html (1)
1-135: LGTM!Rails 8.1のデフォルト500エラーページへの更新が適切に行われています。モダンなHTML5構造、レスポンシブデザイン、ダークモード対応が含まれています。
public/422.html (1)
1-135: LGTM!Rails 8.1のデフォルト422エラーページへの更新が適切に行われています。他のエラーページと統一された構造とスタイルになっています。
config/initializers/filter_parameter_logging.rb (1)
6-7: Rails 8.1のデフォルト設定に準拠した適切な変更です。
:cvv、:cvcの追加は、PII(個人識別情報)とクレジットカード情報のログ漏洩防止に有効です。bin/rubocop (1)
5-5: LGTM!コメントの表記修正のみで、機能的な変更はありません。
config/initializers/new_framework_defaults_8_1.rb (1)
1-74: Rails 8.1アップグレード用のフレームワークデフォルト設定ファイルです。
rails app:updateで生成された標準的なファイルで、全オプションがコメントアウトされているため段階的な移行が可能です。特にaction_on_path_relative_redirect = :raise(Line 61)は、有効化するとオープンリダイレクト脆弱性の防止に役立ちます。
config.load_defaultsを8.1に更新する準備が整ったら、このファイルを削除してください。config/environments/development.rb (2)
28-29: キャッシュストア設定の変更について確認してください。
cache_storeが条件分岐の外に移動され、常に:memory_storeが使用されるようになりました。以前はcaching-dev.txtが存在しない場合に:null_storeが使用されていましたが、現在はperform_caching = falseでキャッシュ動作を制御します。これはRails 8.1のデフォルトパターンですが、開発環境でのメモリ使用量が若干増加する可能性があります。
59-61: デバッグに有用な設定追加です。
query_log_tags_enabled = trueにより、SQLクエリログにリクエスト情報タグが付与され、クエリの発生元の特定が容易になります。config/environments/production.rb (1)
59-60: プレースホルダーの"example.com"は条件付きで上書きされますが、確認してください。Lines 97-101 で
APP_HOST_NAMEが設定されていれば上書きされますが、そうでない場合はこのプレースホルダーが使用されます。プリコンパイル時以外の本番環境ではAPP_HOST_NAMEの検証(Lines 91-95)により問題は発生しないはずですが、意図した動作か確認してください。bin/setup (2)
25-25:--resetオプションの追加は適切ですが、データ消失のリスクについて注意が必要です。
db:resetは既存データを削除するため、オプトイン方式(--resetフラグ必須)は正しいアプローチです。開発者がこのオプションの影響を理解していることを確認してください。
30-34: Rails 8.1スタイルの開発サーバー起動パターンです。
--skip-serverフラグによりCI環境(config/ci.rb)での使用が可能になり、execにより現在のプロセスが置き換えられる適切な実装です。STDOUT.flushもexec前の正しいパターンです。config/ci.rb (2)
3-6: CI パイプラインのセットアップとスタイルチェックは適切です。
bin/setup --skip-serverでサーバー起動をスキップし、bin/rubocopでコードスタイルをチェックする構成は標準的です。
10-12: テストステップの構成は適切です。Rails テスト、システムテスト、シードデータのテストを個別のステップで実行する構成は、問題の切り分けに有効です。
db:seed:replantによりシードデータの整合性も検証できます。bin/ci (1)
1-6: Rails 8.1の新機能で、このCI実装は適切です。
require "active_support/continuous_integration"とActiveSupport::ContinuousIntegrationはRails 8.1で導入されたCI実行機能です。config/ci.rbで定義されたCI パイプラインを実行するためのシンプルで正しい実装です。
9817262 to
5224b6d
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (2)
public/406-unsupported-browser.html (1)
108-114: CSS ネスティングが未対応ブラウザページで使用されていますこのファイルは古いブラウザ向けの 406 ページですが、CSS ネスティング構文は比較的新しい機能です。ターゲットとなる古いブラウザでは、このルールが無視される可能性があります。
影響は
<br>の表示切り替えのみですが、従来の構文への変更を検討してください。🔎 従来の構文への修正案
main article br { display: none; - - @media(min-width: 48em) { - display: inline; - } } + @media(min-width: 48em) { + main article br { + display: inline; + } + } + </style>config/environments/production.rb (1)
25-25: 本番環境の Active Storage 設定が不適切です
config.active_storage.service = :localは本番環境に不適切です。Cloud Run 環境ではローカルファイルシステムは揮発性であり、コンテナの再起動時にアップロードされたファイルが失われます。
config/storage.ymlで既に🔎 修正案
- config.active_storage.service = :local + config.active_storage.service = :google
🧹 Nitpick comments (2)
public/404.html (1)
108-114: CSS ネスティングの互換性についてCSS ネスティング構文(
@mediaをルール内にネスト)は比較的新しい機能です(Chrome 112+、Firefox 117+、Safari 16.4+)。古いブラウザでは無視される可能性がありますが、影響は<br>の表示切り替えのみで、ページの主要機能には影響しません。より広範な互換性が必要な場合は、従来の構文への変更を検討してください。
🔎 従来の構文への修正案
main article br { display: none; - - @media(min-width: 48em) { - display: inline; - } } + @media(min-width: 48em) { + main article br { + display: inline; + } + } + </style>public/500.html (1)
108-114: CSS ネスティングの互換性についてCSS ネスティング構文(
@mediaをルール内にネスト)は比較的新しい機能です。古いブラウザでは無視される可能性がありますが、影響は<br>の表示切り替えのみで、ページの主要機能には影響しません。より広範な互換性が必要な場合は、従来の構文への変更を検討してください。
🔎 従来の構文への修正案
main article br { display: none; - - @media(min-width: 48em) { - display: inline; - } } + @media(min-width: 48em) { + main article br { + display: inline; + } + } + </style>
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
public/icon.pngis excluded by!**/*.pngpublic/icon.svgis excluded by!**/*.svg
📒 Files selected for processing (18)
bin/cibin/devbin/rubocopbin/setupconfig/ci.rbconfig/environments/development.rbconfig/environments/production.rbconfig/environments/test.rbconfig/initializers/assets.rbconfig/initializers/content_security_policy.rbconfig/initializers/filter_parameter_logging.rbconfig/initializers/new_framework_defaults_8_1.rbconfig/puma.rbpublic/400.htmlpublic/404.htmlpublic/406-unsupported-browser.htmlpublic/422.htmlpublic/500.html
💤 Files with no reviewable changes (1)
- config/environments/test.rb
✅ Files skipped from review due to trivial changes (3)
- config/initializers/content_security_policy.rb
- bin/ci
- public/400.html
🚧 Files skipped from review as they are similar to previous changes (6)
- public/422.html
- config/initializers/assets.rb
- bin/dev
- bin/rubocop
- config/ci.rb
- config/puma.rb
🧰 Additional context used
📓 Path-based instructions (2)
config/**
📄 CodeRabbit inference engine (AGENTS.md)
Configuration files in
config/should include environment settings, routes, and lints (.rubocop.yml,config/slim_lint.yml)
Files:
config/initializers/filter_parameter_logging.rbconfig/environments/production.rbconfig/environments/development.rbconfig/initializers/new_framework_defaults_8_1.rb
**/*.rb
📄 CodeRabbit inference engine (AGENTS.md)
Ruby code should use 2-space indentation, snake_case for method names, and CamelCase for class names, enforced by RuboCop (
.rubocop.yml)
Files:
config/initializers/filter_parameter_logging.rbconfig/environments/production.rbconfig/environments/development.rbconfig/initializers/new_framework_defaults_8_1.rb
⚙️ CodeRabbit configuration file
**/*.rb: # refactoring
- まずFat Controllerを避け、次にFat Modelを避ける。
- Serviceクラスの乱用を避ける。
- controller concernを作ろうとしたらPORO(Plain Old Ruby Object)やActiveRecordモデルでの実装で代替できないか検討する。
Rails Patterns
- ViewHelperにメソッドを実装する時にはまずDecoratorパターンを使うことを検討する。(active_decorator gemを導入しているのでそれを使う)
- 複雑なActiveRecordクエリがあり、再利用できそうな場合はQueryObjectパターンを検討する。(rails-patterns gemを導入しているのでそれのQuery機能を使う)
- Viewにpartialを作る場合はViewComponentを使うことを検討する。
- 複数のActiveRecordモデルを操作する1つの責務がある時や外部APIとやりとりする処理がある場合にはInteractorオブジェクトパターンを検討する。(interactor gemを導入しているのでそれを使う)
- 複数のInteractorを実行するような処理がある場合Organizerオブジェクトパターンを検討する。(interactor gemを導入しており、その中にOrganizerの機能があるので使う)
Files:
config/initializers/filter_parameter_logging.rbconfig/environments/production.rbconfig/environments/development.rbconfig/initializers/new_framework_defaults_8_1.rb
🧠 Learnings (9)
📓 Common learnings
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/product.rb:59-61
Timestamp: 2025-09-11T14:47:53.256Z
Learning: Rails アップグレードPRでは、アップグレードに直接関連しない性能改善や機能追加の提案は避けるべき。PRのスコープを維持することが重要で、そのような改善提案は別PRで対応すべきである。
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9115
File: db/migrate/20250902024949_add_unique_index_to_correct_answers.rb:1-5
Timestamp: 2025-11-13T09:20:36.030Z
Learning: fjordllc/bootcamp プロジェクトでは、データの整合性を保つためのデータ修正には data-migrate gem を使用し、db/data/ ディレクトリ配下にデータマイグレーションファイルを作成する運用を採用している。スキーマ変更(db/migrate/)とデータ変更(db/data/)を分離することで、より安全で管理しやすい構成を実現している。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:52-56
Timestamp: 2025-09-12T21:17:45.295Z
Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: app/controllers/mentor/buzzes_controller.rb:0-0
Timestamp: 2025-09-04T01:39:22.261Z
Learning: fjordllc/bootcamp プロジェクトでは、更新処理の成功時の通知メッセージについて、I18n を使用せずに日本語文字列を直接記述する方針で一貫性を保っている。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/migrate/20250831234516_remove_unique_index_from_buzzes_title.rb:1-5
Timestamp: 2025-09-04T01:50:47.773Z
Learning: fjordllc/bootcampプロジェクトでは、マイグレーションにおいてdisable_ddl_transaction!やalgorithm: :concurrentlyは使用せず、標準的なRailsのchangeメソッド内でremove_indexを実行する慣例がある。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: config/initializers/sorcery.rb:0-0
Timestamp: 2025-09-11T16:02:24.782Z
Learning: Rails アップグレードPRにおいて、JWT設定の改善では複数のソース(secrets, credentials, ENV)を優先順位付きで検索し、本番環境では未設定時に起動を停止させる実装が推奨される。開発・テスト環境でのみsecret_key_baseフォールバックを許可する構成が安全である。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:19-23
Timestamp: 2025-09-12T21:17:26.029Z
Learning: Rails アップグレードPRにおいて、config_for(:secrets) を使った webhook URL 設定の shared セクション未参照問題は、設定システム全体の変更として別PRで対応すべきである。
Learnt from: mousu-a
Repo: fjordllc/bootcamp PR: 8566
File: db/migrate/20250830033535_add_default_to_pair_works_wip.rb:1-5
Timestamp: 2025-08-31T03:17:44.812Z
Learning: 新機能のマイグレーションで、まだ本番環境にリリースされていない場合は、既存レコードのバックフィル処理は不要。開発環境でrails db:resetが可能な状況では特に、デフォルト値の変更のみで十分。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: db/migrate/20250828192202_add_missing_columns_to_good_jobs.rb:4-10
Timestamp: 2025-09-11T14:18:20.194Z
Learning: GoodJobやその他の外部gemが生成するマイグレーションファイルは、gem内部のロジックと密接に連携しているため、null制約やデフォルト値の追加などの変更を行うべきではない。gemのアップグレードパスに従い、生成されたマイグレーションをそのまま使用することが適切。
📚 Learning: 2025-09-12T12:53:17.172Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: public/500.html:2-64
Timestamp: 2025-09-12T12:53:17.172Z
Learning: エラーページ(404.html、422.html、500.html)について不正確な提案をした場合は、実際のファイル内容を確認してから回答すべき。これらのファイルは既に統一されており、追加のメタタグは不要だった。
Applied to files:
public/404.htmlpublic/500.html
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Use `bin/setup` for local database setup and dependency installation; avoid manual tweaks in `config/` without team discussion
Applied to files:
bin/setupconfig/environments/production.rb
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to test/**/*_test.rb : Use Minitest + Capybara for system tests; place unit and integration tests under matching `test/*` directories
Applied to files:
bin/setup
📚 Learning: 2025-09-11T16:02:24.782Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: config/initializers/sorcery.rb:0-0
Timestamp: 2025-09-11T16:02:24.782Z
Learning: Rails アップグレードPRにおいて、JWT設定の改善では複数のソース(secrets, credentials, ENV)を優先順位付きで検索し、本番環境では未設定時に起動を停止させる実装が推奨される。開発・テスト環境でのみsecret_key_baseフォールバックを許可する構成が安全である。
Applied to files:
config/initializers/filter_parameter_logging.rbconfig/environments/production.rbconfig/environments/development.rbconfig/initializers/new_framework_defaults_8_1.rb
📚 Learning: 2025-09-12T21:17:26.029Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:19-23
Timestamp: 2025-09-12T21:17:26.029Z
Learning: Rails アップグレードPRにおいて、config_for(:secrets) を使った webhook URL 設定の shared セクション未参照問題は、設定システム全体の変更として別PRで対応すべきである。
Applied to files:
config/initializers/filter_parameter_logging.rbconfig/environments/production.rbconfig/initializers/new_framework_defaults_8_1.rb
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to config/** : Configuration files in `config/` should include environment settings, routes, and lints (`.rubocop.yml`, `config/slim_lint.yml`)
Applied to files:
config/environments/production.rbconfig/environments/development.rbconfig/initializers/new_framework_defaults_8_1.rb
📚 Learning: 2025-08-26T07:31:10.235Z
Learnt from: sekito1107
Repo: fjordllc/bootcamp PR: 9081
File: test/models/transcoder/movie_test.rb:0-0
Timestamp: 2025-08-26T07:31:10.235Z
Learning: Transcoder::Movie クラス(app/models/transcoder/movie.rb)では、Google::Cloud::Storage::FileVerificationError(Storage固有の例外)とGoogle::Cloud::Storage.new(メインクラス)の両方を使用しているため、テストファイルでは完全な google/cloud/storage gem の require が必要。google/cloud/errors gem だけでは不十分。
Applied to files:
config/environments/production.rb
📚 Learning: 2025-09-12T21:17:45.295Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:52-56
Timestamp: 2025-09-12T21:17:45.295Z
Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Applied to files:
config/environments/development.rbconfig/initializers/new_framework_defaults_8_1.rb
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build_and_test
🔇 Additional comments (9)
config/initializers/filter_parameter_logging.rb (1)
7-7: セキュリティ向上:機密パラメータのフィルタリングを拡張
:cvv、:cvcの追加により、ログから個人情報とクレジットカード情報の漏洩を防ぎます。Rails 8.1 へのアップグレードに適した改善です。bin/setup (1)
25-34: Rails 8.1 に準拠したセットアップスクリプトの改善新しいフラグオプションとサーバー起動方法が適切に実装されています:
--resetフラグによるオプショナルなデータベースリセット--skip-serverフラグによる CI 環境での柔軟な制御exec "bin/dev"による適切なプロセス置換これらの変更は Rails 8.1 の規約と CI ワークフローをサポートしています。
config/environments/development.rb (4)
23-23: Rails 8.1 の規約に準拠したヘッダー名の小文字化
"cache-control"への変更は HTTP/2 規約と Rails 8.1 の推奨事項に準拠しています。
28-29: キャッシュストア設定の明確化
cache_storeを条件分岐の外に移動することで、設定がより明確になりました。Rails 8.1 のベストプラクティスに準拠しています。
60-61: Rails 8.1 のクエリログタグ機能を有効化
query_log_tags_enabledは Rails 8.1 で導入された機能で、SQL クエリにランタイム情報タグを追加します。開発環境でのデバッグに有用です。
74-75: Rails 8.1 の詳細リダイレクトログを有効化
verbose_redirect_logsは Rails 8.1 で導入された機能で、リダイレクトをトリガーしたコードをログに記録します。開発環境でのデバッグに有用です。config/initializers/new_framework_defaults_8_1.rb (1)
1-74: Rails 8.1 デフォルト設定の段階的導入パターンこのファイルは Rails 8.1 アップグレードの標準的なアプローチに従っています:
- 新しいフレームワークデフォルトを詳細なコメントと共にドキュメント化
- すべての設定がコメントアウトされており、段階的な有効化が可能
- 各設定の動作、互換性、推奨使用方法を明確に説明
すべての新しいデフォルトをテストして有効化した後、
config.load_defaultsを8.1に更新できます。config/environments/production.rb (2)
36-44: Rails 8.1 のログ設定とヘルスチェックの改善ログ設定の更新とヘルスチェックパスのサイレンシングが適切に実装されています:
- タグ付きロギングによるリクエスト追跡の向上
/upエンドポイントのログノイズ削減Rails 8.1 のベストプラクティスに準拠しています。
89-107: 本番環境のホスト名検証とセキュリティの強化
APP_HOST_NAMEの起動時検証と各種ホスト設定の統合が適切に実装されています:
- 必須環境変数の起動時検証によるエラーの早期発見
- メーラー、アセット、ルーティングの統一されたホスト設定
- HTTPS の強制による安全な通信
本番環境のセキュリティと設定の堅牢性が向上しています。
19c9121 to
f49bff4
Compare
There was a problem hiding this comment.
Actionable comments posted: 9
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (4)
test/fixtures/users.yml (1)
792-846: 重複したフィクスチャ定義を修正してください
neverloginユーザーが2回定義されています(792-805行目と831-846行目)。YAMLフィクスチャでは重複したキーは許可されず、後の定義が前の定義を上書きします。これにより、最初の定義(country_codeとsubdivision_codeなし)を期待するテストが失敗する可能性があります。以下のいずれかの対応が必要です:
- 最初の定義(792-805行目)を削除して、2番目の定義のみを残す
- 2番目の定義(831-846行目)を削除して、最初の定義に
country_codeとsubdivision_codeを追加する- 2番目の定義を別の名前(例:
neverlogin_us)に変更する🔎 提案される修正(最初の定義を削除)
-neverlogin: # 1度もログインしたことがないユーザー - login_name: neverlogin - email: neverlogin@fjord.jp - crypted_password: $2a$10$n/xv4/1luueN6plzm2OyDezWlZFyGHjQEf4hwAW1r3k.lCm0frPK. # testtest - salt: zW3kQ9ubsxQQtzzzs4ap - name: 根場亜 呂具印 - name_kana: ネバー ログイン - description: "ユーザー登録後、1度もログインしていないユーザーです。" - course: course1 - os: mac - experiences: 6 - updated_at: "2022-07-11 00:00:00" - created_at: "2022-07-11 00:00:00" - sent_student_followup_message: true - kyuukai: login_name: kyuukai ...test/system/regular_events/participation_test.rb (2)
26-32: RegularEvent作成の検証が不足しています。Line 26で作成ボタンをクリックしていますが、
RegularEventが実際に作成されたかどうかの検証がありません。同ファイル内のLine 85の3番目のテストではassert_equal original_count + 1, RegularEvent.countで検証しているのに対し、このテストでは検証が欠けています。テストの網羅性を統一するため、作成カウントの検証を追加することを推奨します。🔎 提案する修正
check('regular_event_all', allow_label_click: true) end - click_button '作成' - assert_text '定期イベントを作成しました。' + assert_difference 'RegularEvent.count', 1 do + click_button '作成' + assert_text '定期イベントを作成しました。' + end
54-60: RegularEvent作成の検証が不足しています。Line 54で作成ボタンをクリックしていますが、
RegularEventが実際に作成されたかどうかの検証がありません。同様の問題がLine 26のテストにもあり、ファイル内で検証パターンが不統一になっています。🔎 提案する修正
check('regular_event_all', allow_label_click: true) end - click_button '作成' - assert_text '定期イベントを作成しました。' + assert_difference 'RegularEvent.count', 1 do + click_button '作成' + assert_text '定期イベントを作成しました。' + endconfig/environments/production.rb (1)
90-96: APP_HOST_NAMEバリデーションのスキップ条件を変更してください
SECRET_KEY_BASE == "dummy"という条件でバリデーションをスキップするのは、Railsの標準的なアプローチではありません。Railsの公式な推奨方法は以下のいずれかです:
- Rails 7.1以上: 環境変数
SECRET_KEY_BASE_DUMMY=1を設定してアセットプリコンパイル時のバリデーションをスキップする- 全バージョン: ビルド環境で実際の
SECRET_KEY_BASEを提供する現在の実装は、本番環境で誤って
SECRET_KEY_BASEが文字列"dummy"に設定された場合、必須のバリデーションがスキップされてしまうため、セキュリティリスクです。代わりに、上記の標準的なRails方式を採用してください。
♻️ Duplicate comments (1)
public/406-unsupported-browser.html (1)
108-114: CSSネスティングの互換性問題(既出)古いブラウザ向けページですが、CSSネスティング構文を使用しています。この問題は以前のレビューで指摘済みです。影響は
<br>の表示切り替えのみですが、必要に応じて従来の構文への修正を検討してください。
🧹 Nitpick comments (5)
test/system/markdown_test.rb (1)
73-88: テストコードが実行されない状態になっています。Line 74の
skipにより、その後のテストコード(lines 76-88)は実行されません。以下のいずれかの対応を推奨します:
- 近いうちに再有効化する予定がない場合: テスト本体(lines 76-88)を削除し、skipのみを残す
- 将来的に再有効化する予定がある場合: テストコードを残し、再有効化の条件や必要な修正をTODOコメントとして明記する
外部APIに依存するテストをskipする判断自体は適切です。
🔎 テスト本体を削除する場合の提案
test 'should expand link card for tweet' do skip 'Twitter embed depends on external API and JavaScript that is unreliable in test environment' - - visit_with_auth new_report_path, 'komagata' - within('form[name=report]') do - fill_in('report[title]', with: 'リンクカードが展開される') - fill_in('report[description]', with: '@[card](https://x.com/fjordbootcamp/status/1866097842483503117)') - fill_in('report[reported_on]', with: Time.current) - - check '学習時間は無し', allow_label_click: true - end - - click_button '提出' - assert_selector '.twitter-tweet', wait: 10 - assert_no_selector 'a.before-replacement-link-card[href="https://x.com/fjordbootcamp/status/1866097842483503117"]', visible: true endtest/system/reset_password_test.rb (2)
19-19: 重複したアサーションを確認してください。同じテキスト「パスワードの再設定について」のアサーションが2箇所にあります(19行目のassert_differenceブロック内と31行目のブロック外)。
19行目のアサーションはページ更新がassert_differenceブロック完了前に完了することを保証し、Rails 8.1のタイミング問題に対応している可能性がありますが、31行目の重複は不要かもしれません。
両方のアサーションがRails 8.1のテスト安定性のために必要かどうかご確認ください。
Also applies to: 31-31
43-43: 最初のテストケースとのパターンの一貫性を確認してください。最初のテストケース(
send email to exist user)では、assert_differenceブロック内(19行目)とブロック外(31行目)の両方で同じアサーションを行っていますが、このテストケースではブロック内のみのアサーションとなっています。この違いが意図的なもの(このテストは後続の処理で別のアサーションを行うため)なのか、それとも一貫性のために調整が必要なのかご確認ください。
config/environments/production.rb (2)
60-61: メーラーのデフォルトURLオプションが後で上書きされます61行目で
config.action_mailer.default_url_options = { host: "example.com" }と設定されていますが、99行目でapp_host_nameを使用して上書きされています。この構造は混乱を招く可能性があります。61行目の設定はRails 8.1のテンプレートデフォルトと思われますが、実際には使用されない値です。以下のいずれかの対応を検討してください:
- 61行目の設定を削除する
- 61行目の後にコメントを追加して「この設定は後で上書きされます」と明示する
107-108: app_host_nameがnilの場合の挙動を確認してください
SECRET_KEY_BASE == "dummy"の場合、APP_HOST_NAMEのバリデーションがスキップされ、app_host_nameがnilまたは空文字列になる可能性があります。その場合:
- 108行目:
config.hosts << app_host_nameでnilを追加- 114行目:
Rails.application.routes.default_url_options[:host] = app_host_nameでnilを設定これらの設定にアクセスされる可能性がある場合、予期しない動作を引き起こす可能性があります。
108行目と114行目を以下のように修正することを検討してください:
config.hosts << app_host_name if app_host_name.present?if app_host_name.present? Rails.application.routes.default_url_options[:host] = app_host_name Rails.application.routes.default_url_options[:protocol] = 'https' endAlso applies to: 114-115
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
public/icon.pngis excluded by!**/*.pngpublic/icon.svgis excluded by!**/*.svg
📒 Files selected for processing (55)
app/models/discord/server.rbapp/models/discord/times_category.rbapp/models/user.rbbin/cibin/claude-system-testbin/devbin/rails-test-all-with-reportbin/rubocopbin/setupconfig/ci.rbconfig/environments/development.rbconfig/environments/production.rbconfig/environments/test.rbconfig/initializers/assets.rbconfig/initializers/content_security_policy.rbconfig/initializers/discord.rbconfig/initializers/filter_parameter_logging.rbconfig/initializers/new_framework_defaults_8_1.rbconfig/puma.rbpublic/400.htmlpublic/404.htmlpublic/406-unsupported-browser.htmlpublic/422.htmlpublic/500.htmltest/fixtures/users.ymltest/models/discord_driver_test.rbtest/supports/mention_helper.rbtest/system/admin/users_test.rbtest/system/corporate_training_inquiry_system_test.rbtest/system/events/crud_test.rbtest/system/events/wip_test.rbtest/system/home/events_test.rbtest/system/markdown_test.rbtest/system/mentor/courses_test.rbtest/system/notification/mention_test.rbtest/system/notification/products_test.rbtest/system/notification/questions_test.rbtest/system/notifications/pagination_test.rbtest/system/notifications_bell_test.rbtest/system/pages/notification_test.rbtest/system/practice/not_logged_in_test.rbtest/system/practices/mentor_test.rbtest/system/practices/summary_test.rbtest/system/product/unchecked_test.rbtest/system/products/wip_test.rbtest/system/questions/wip_test.rbtest/system/questions_test.rbtest/system/regular_events/announcement_test.rbtest/system/regular_events/crud_test.rbtest/system/regular_events/participation_test.rbtest/system/reports/notification_test.rbtest/system/reset_password_test.rbtest/system/users/profile_test.rbtest/system/works_test.rbtest/test_helper.rb
💤 Files with no reviewable changes (1)
- config/environments/test.rb
✅ Files skipped from review due to trivial changes (1)
- app/models/user.rb
🚧 Files skipped from review as they are similar to previous changes (6)
- bin/dev
- bin/ci
- bin/rubocop
- config/initializers/filter_parameter_logging.rb
- config/initializers/new_framework_defaults_8_1.rb
- config/ci.rb
🧰 Additional context used
📓 Path-based instructions (6)
test/**/*_test.rb
📄 CodeRabbit inference engine (AGENTS.md)
test/**/*_test.rb: Test suite should use Minitest with structure:system/,models/,controllers/, and fixtures intest/fixtures/; test files should be named*_test.rb
Use Minitest + Capybara for system tests; place unit and integration tests under matchingtest/*directories
Files:
test/system/practice/not_logged_in_test.rbtest/system/works_test.rbtest/system/practices/summary_test.rbtest/system/regular_events/announcement_test.rbtest/system/notifications_bell_test.rbtest/system/reports/notification_test.rbtest/system/mentor/courses_test.rbtest/system/questions_test.rbtest/system/products/wip_test.rbtest/system/users/profile_test.rbtest/system/questions/wip_test.rbtest/system/regular_events/participation_test.rbtest/system/corporate_training_inquiry_system_test.rbtest/models/discord_driver_test.rbtest/system/admin/users_test.rbtest/system/practices/mentor_test.rbtest/system/home/events_test.rbtest/system/reset_password_test.rbtest/system/notification/products_test.rbtest/system/notifications/pagination_test.rbtest/system/markdown_test.rbtest/system/pages/notification_test.rbtest/system/notification/mention_test.rbtest/system/events/crud_test.rbtest/system/product/unchecked_test.rbtest/system/events/wip_test.rbtest/system/regular_events/crud_test.rbtest/system/notification/questions_test.rb
**/*.rb
📄 CodeRabbit inference engine (AGENTS.md)
Ruby code should use 2-space indentation, snake_case for method names, and CamelCase for class names, enforced by RuboCop (
.rubocop.yml)
Files:
test/system/practice/not_logged_in_test.rbtest/system/works_test.rbtest/system/practices/summary_test.rbtest/system/regular_events/announcement_test.rbconfig/initializers/assets.rbtest/system/notifications_bell_test.rbapp/models/discord/times_category.rbtest/system/reports/notification_test.rbtest/system/mentor/courses_test.rbconfig/initializers/discord.rbconfig/initializers/content_security_policy.rbtest/test_helper.rbtest/supports/mention_helper.rbtest/system/questions_test.rbtest/system/products/wip_test.rbtest/system/users/profile_test.rbtest/system/questions/wip_test.rbtest/system/regular_events/participation_test.rbtest/system/corporate_training_inquiry_system_test.rbapp/models/discord/server.rbtest/models/discord_driver_test.rbtest/system/admin/users_test.rbtest/system/practices/mentor_test.rbtest/system/home/events_test.rbtest/system/reset_password_test.rbtest/system/notification/products_test.rbtest/system/notifications/pagination_test.rbtest/system/markdown_test.rbtest/system/pages/notification_test.rbtest/system/notification/mention_test.rbtest/system/events/crud_test.rbconfig/puma.rbtest/system/product/unchecked_test.rbtest/system/events/wip_test.rbtest/system/regular_events/crud_test.rbconfig/environments/production.rbconfig/environments/development.rbtest/system/notification/questions_test.rb
⚙️ CodeRabbit configuration file
**/*.rb: # refactoring
- まずFat Controllerを避け、次にFat Modelを避ける。
- Serviceクラスの乱用を避ける。
- controller concernを作ろうとしたらPORO(Plain Old Ruby Object)やActiveRecordモデルでの実装で代替できないか検討する。
Rails Patterns
- ViewHelperにメソッドを実装する時にはまずDecoratorパターンを使うことを検討する。(active_decorator gemを導入しているのでそれを使う)
- 複雑なActiveRecordクエリがあり、再利用できそうな場合はQueryObjectパターンを検討する。(rails-patterns gemを導入しているのでそれのQuery機能を使う)
- Viewにpartialを作る場合はViewComponentを使うことを検討する。
- 複数のActiveRecordモデルを操作する1つの責務がある時や外部APIとやりとりする処理がある場合にはInteractorオブジェクトパターンを検討する。(interactor gemを導入しているのでそれを使う)
- 複数のInteractorを実行するような処理がある場合Organizerオブジェクトパターンを検討する。(interactor gemを導入しており、その中にOrganizerの機能があるので使う)
Files:
test/system/practice/not_logged_in_test.rbtest/system/works_test.rbtest/system/practices/summary_test.rbtest/system/regular_events/announcement_test.rbconfig/initializers/assets.rbtest/system/notifications_bell_test.rbapp/models/discord/times_category.rbtest/system/reports/notification_test.rbtest/system/mentor/courses_test.rbconfig/initializers/discord.rbconfig/initializers/content_security_policy.rbtest/test_helper.rbtest/supports/mention_helper.rbtest/system/questions_test.rbtest/system/products/wip_test.rbtest/system/users/profile_test.rbtest/system/questions/wip_test.rbtest/system/regular_events/participation_test.rbtest/system/corporate_training_inquiry_system_test.rbapp/models/discord/server.rbtest/models/discord_driver_test.rbtest/system/admin/users_test.rbtest/system/practices/mentor_test.rbtest/system/home/events_test.rbtest/system/reset_password_test.rbtest/system/notification/products_test.rbtest/system/notifications/pagination_test.rbtest/system/markdown_test.rbtest/system/pages/notification_test.rbtest/system/notification/mention_test.rbtest/system/events/crud_test.rbconfig/puma.rbtest/system/product/unchecked_test.rbtest/system/events/wip_test.rbtest/system/regular_events/crud_test.rbconfig/environments/production.rbconfig/environments/development.rbtest/system/notification/questions_test.rb
test/**
📄 CodeRabbit inference engine (AGENTS.md)
Keep tests deterministic and use fixtures stored in
test/fixtures/for test data
Files:
test/system/practice/not_logged_in_test.rbtest/system/works_test.rbtest/system/practices/summary_test.rbtest/system/regular_events/announcement_test.rbtest/system/notifications_bell_test.rbtest/system/reports/notification_test.rbtest/system/mentor/courses_test.rbtest/test_helper.rbtest/supports/mention_helper.rbtest/system/questions_test.rbtest/system/products/wip_test.rbtest/system/users/profile_test.rbtest/system/questions/wip_test.rbtest/system/regular_events/participation_test.rbtest/system/corporate_training_inquiry_system_test.rbtest/models/discord_driver_test.rbtest/system/admin/users_test.rbtest/system/practices/mentor_test.rbtest/system/home/events_test.rbtest/system/reset_password_test.rbtest/system/notification/products_test.rbtest/system/notifications/pagination_test.rbtest/system/markdown_test.rbtest/system/pages/notification_test.rbtest/system/notification/mention_test.rbtest/system/events/crud_test.rbtest/system/product/unchecked_test.rbtest/system/events/wip_test.rbtest/system/regular_events/crud_test.rbtest/fixtures/users.ymltest/system/notification/questions_test.rb
test/**/*
⚙️ CodeRabbit configuration file
test/**/*: # Test
- TestCase名は英語で書く。
- どうしても避けられない時以外にsystem testでsleepは使わない。
Unit Test
model, helper, decorator, view_componentについてはメソッドを追加した場合は必ず対応したUnit TestのTestCaseを1つは書く。
Files:
test/system/practice/not_logged_in_test.rbtest/system/works_test.rbtest/system/practices/summary_test.rbtest/system/regular_events/announcement_test.rbtest/system/notifications_bell_test.rbtest/system/reports/notification_test.rbtest/system/mentor/courses_test.rbtest/test_helper.rbtest/supports/mention_helper.rbtest/system/questions_test.rbtest/system/products/wip_test.rbtest/system/users/profile_test.rbtest/system/questions/wip_test.rbtest/system/regular_events/participation_test.rbtest/system/corporate_training_inquiry_system_test.rbtest/models/discord_driver_test.rbtest/system/admin/users_test.rbtest/system/practices/mentor_test.rbtest/system/home/events_test.rbtest/system/reset_password_test.rbtest/system/notification/products_test.rbtest/system/notifications/pagination_test.rbtest/system/markdown_test.rbtest/system/pages/notification_test.rbtest/system/notification/mention_test.rbtest/system/events/crud_test.rbtest/system/product/unchecked_test.rbtest/system/events/wip_test.rbtest/system/regular_events/crud_test.rbtest/fixtures/users.ymltest/system/notification/questions_test.rb
config/**
📄 CodeRabbit inference engine (AGENTS.md)
Configuration files in
config/should include environment settings, routes, and lints (.rubocop.yml,config/slim_lint.yml)
Files:
config/initializers/assets.rbconfig/initializers/discord.rbconfig/initializers/content_security_policy.rbconfig/puma.rbconfig/environments/production.rbconfig/environments/development.rb
app/**/*.{rb,js,ts,jsx,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Rails app code should be organized in
app/directory with subdirectories:models/,controllers/,views/,jobs/,helpers/, and frontend code underjavascript/(Shakapacker)
Files:
app/models/discord/times_category.rbapp/models/discord/server.rb
🧠 Learnings (31)
📓 Common learnings
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/product.rb:59-61
Timestamp: 2025-09-11T14:47:53.256Z
Learning: Rails アップグレードPRでは、アップグレードに直接関連しない性能改善や機能追加の提案は避けるべき。PRのスコープを維持することが重要で、そのような改善提案は別PRで対応すべきである。
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9115
File: db/migrate/20250902024949_add_unique_index_to_correct_answers.rb:1-5
Timestamp: 2025-11-13T09:20:36.030Z
Learning: fjordllc/bootcamp プロジェクトでは、データの整合性を保つためのデータ修正には data-migrate gem を使用し、db/data/ ディレクトリ配下にデータマイグレーションファイルを作成する運用を採用している。スキーマ変更(db/migrate/)とデータ変更(db/data/)を分離することで、より安全で管理しやすい構成を実現している。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:52-56
Timestamp: 2025-09-12T21:17:45.295Z
Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: app/controllers/mentor/buzzes_controller.rb:0-0
Timestamp: 2025-09-04T01:39:22.261Z
Learning: fjordllc/bootcamp プロジェクトでは、更新処理の成功時の通知メッセージについて、I18n を使用せずに日本語文字列を直接記述する方針で一貫性を保っている。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/migrate/20250831234516_remove_unique_index_from_buzzes_title.rb:1-5
Timestamp: 2025-09-04T01:50:47.773Z
Learning: fjordllc/bootcampプロジェクトでは、マイグレーションにおいてdisable_ddl_transaction!やalgorithm: :concurrentlyは使用せず、標準的なRailsのchangeメソッド内でremove_indexを実行する慣例がある。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: config/initializers/sorcery.rb:0-0
Timestamp: 2025-09-11T16:02:24.782Z
Learning: Rails アップグレードPRにおいて、JWT設定の改善では複数のソース(secrets, credentials, ENV)を優先順位付きで検索し、本番環境では未設定時に起動を停止させる実装が推奨される。開発・テスト環境でのみsecret_key_baseフォールバックを許可する構成が安全である。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:19-23
Timestamp: 2025-09-12T21:17:26.029Z
Learning: Rails アップグレードPRにおいて、config_for(:secrets) を使った webhook URL 設定の shared セクション未参照問題は、設定システム全体の変更として別PRで対応すべきである。
Learnt from: mousu-a
Repo: fjordllc/bootcamp PR: 8566
File: db/migrate/20250830033535_add_default_to_pair_works_wip.rb:1-5
Timestamp: 2025-08-31T03:17:44.812Z
Learning: 新機能のマイグレーションで、まだ本番環境にリリースされていない場合は、既存レコードのバックフィル処理は不要。開発環境でrails db:resetが可能な状況では特に、デフォルト値の変更のみで十分。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: db/migrate/20250828192202_add_missing_columns_to_good_jobs.rb:4-10
Timestamp: 2025-09-11T14:18:20.194Z
Learning: GoodJobやその他の外部gemが生成するマイグレーションファイルは、gem内部のロジックと密接に連携しているため、null制約やデフォルト値の追加などの変更を行うべきではない。gemのアップグレードパスに従い、生成されたマイグレーションをそのまま使用することが適切。
📚 Learning: 2025-07-23T21:11:21.826Z
Learnt from: jun-kondo
Repo: fjordllc/bootcamp PR: 0
File: :0-0
Timestamp: 2025-07-23T21:11:21.826Z
Learning: fjordllc/bootcampプロジェクトの`app/models/work_notification_destroyer.rb`において、このクラスは`app/controllers/works_controller.rb`の`destroy`アクションから呼び出され、`before_action :set_my_work`でIDの妥当性チェックが事前に行われるため、payloadのworkオブジェクトは常に有効であることが保証されている。そのためエラーハンドリングは不要。
Applied to files:
test/system/works_test.rb
📚 Learning: 2025-09-04T01:39:22.261Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: app/controllers/mentor/buzzes_controller.rb:0-0
Timestamp: 2025-09-04T01:39:22.261Z
Learning: fjordllc/bootcamp プロジェクトでは、更新処理の成功時の通知メッセージについて、I18n を使用せずに日本語文字列を直接記述する方針で一貫性を保っている。
Applied to files:
test/system/practices/summary_test.rbtest/system/corporate_training_inquiry_system_test.rb
📚 Learning: 2025-09-12T01:00:58.452Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: app/views/mentor/buzzes/edit.html.slim:1-0
Timestamp: 2025-09-12T01:00:58.452Z
Learning: app/views/mentor/buzzes/edit.html.slim では `- title` と `- set_meta_tags` の両方が正しく設定されており、タイトルは削除されていない。変更内容はメタディスクリプションの追加のみ。
Applied to files:
test/system/practices/summary_test.rbtest/system/mentor/courses_test.rbtest/system/practices/mentor_test.rb
📚 Learning: 2025-08-31T23:39:23.210Z
Learnt from: mousu-a
Repo: fjordllc/bootcamp PR: 8566
File: app/views/pair_works/_body.html.slim:111-117
Timestamp: 2025-08-31T23:39:23.210Z
Learning: PairWorkモデルにreserved_at_in_schedules?カスタムバリデーション(on: :update)が実装されており、reserved_atが必ずschedules.map(&:proposed_at)に含まれることを検証している。これにより、フォームから任意の日時を送信することを防いでいる。
Applied to files:
test/system/regular_events/announcement_test.rbtest/system/regular_events/participation_test.rbtest/system/admin/users_test.rbtest/system/home/events_test.rbtest/system/events/crud_test.rbtest/system/events/wip_test.rbtest/system/regular_events/crud_test.rb
📚 Learning: 2025-10-22T06:04:36.036Z
Learnt from: sjabcdefin
Repo: fjordllc/bootcamp PR: 9247
File: app/controllers/checks_controller.rb:0-0
Timestamp: 2025-10-22T06:04:36.036Z
Learning: ChecksController#createおよび#destroyでは、Checkの作成・削除とActiveSupport::Notifications.instrumentによるイベント発行(プラクティスのステータス更新)を同一トランザクション内で実行し、いずれかが失敗した場合は両方をロールバックする。これによりWebUI表示とDB状態の整合性を保証している。
Applied to files:
test/system/regular_events/announcement_test.rbtest/system/mentor/courses_test.rbtest/system/regular_events/participation_test.rbtest/system/pages/notification_test.rbtest/system/events/crud_test.rbtest/system/events/wip_test.rbtest/system/regular_events/crud_test.rb
📚 Learning: 2025-09-12T12:53:17.172Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: public/500.html:2-64
Timestamp: 2025-09-12T12:53:17.172Z
Learning: エラーページ(404.html、422.html、500.html)について不正確な提案をした場合は、実際のファイル内容を確認してから回答すべき。これらのファイルは既に統一されており、追加のメタタグは不要だった。
Applied to files:
public/500.htmlpublic/404.htmlpublic/422.htmlpublic/400.html
📚 Learning: 2025-09-11T16:02:24.782Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: config/initializers/sorcery.rb:0-0
Timestamp: 2025-09-11T16:02:24.782Z
Learning: Rails アップグレードPRにおいて、JWT設定の改善では複数のソース(secrets, credentials, ENV)を優先順位付きで検索し、本番環境では未設定時に起動を停止させる実装が推奨される。開発・テスト環境でのみsecret_key_baseフォールバックを許可する構成が安全である。
Applied to files:
config/initializers/assets.rbconfig/initializers/content_security_policy.rbconfig/puma.rbconfig/environments/production.rbconfig/environments/development.rb
📚 Learning: 2025-07-15T12:58:02.735Z
Learnt from: reckyy
Repo: fjordllc/bootcamp PR: 8356
File: app/models/notification.rb:45-47
Timestamp: 2025-07-15T12:58:02.735Z
Learning: fjordllc/bootcampプロジェクトの`app/models/notification.rb`において、`training_completed`通知種別は`TARGETS_TO_KINDS`ハッシュに含めない設計になっている。これは`training_completed`が通知一覧のフィルタ対象ではないためで、意図的な設計判断である。
Applied to files:
test/system/notifications_bell_test.rbtest/system/pages/notification_test.rb
📚 Learning: 2025-07-23T21:11:21.826Z
Learnt from: jun-kondo
Repo: fjordllc/bootcamp PR: 0
File: :0-0
Timestamp: 2025-07-23T21:11:21.826Z
Learning: fjordllc/bootcampプロジェクトの`app/models/inquiry_notifier.rb`において、`NOTIFICATION_SENDER_NAME`で指定される管理者ユーザーは必ず存在することがシステムの前提条件として保証されているため、senderがnilになることは想定されておらず、エラーハンドリングは不要である。
Applied to files:
test/system/notifications_bell_test.rbtest/system/corporate_training_inquiry_system_test.rb
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to test/**/*_test.rb : Use Minitest + Capybara for system tests; place unit and integration tests under matching `test/*` directories
Applied to files:
test/system/reports/notification_test.rbbin/rails-test-all-with-reporttest/test_helper.rbtest/system/questions_test.rbtest/system/questions/wip_test.rbbin/setuptest/system/corporate_training_inquiry_system_test.rbtest/system/admin/users_test.rbtest/system/practices/mentor_test.rbtest/system/notifications/pagination_test.rbtest/system/markdown_test.rbtest/system/notification/questions_test.rb
📚 Learning: 2025-07-23T20:31:13.856Z
Learnt from: jun-kondo
Repo: fjordllc/bootcamp PR: 8977
File: app/controllers/reports_controller.rb:63-63
Timestamp: 2025-07-23T20:31:13.856Z
Learning: fjordllc/bootcampプロジェクトの`app/controllers/reports_controller.rb`において、`create`と`update`アクションは両方とも`report.save_uniquely`を使用し、同じ`:report_save`イベントと`'report.save'`イベントを発行する。これは両方とも本質的に「レポートの保存」操作であり、作成と更新を区別する必要がないためである。
Applied to files:
test/system/reports/notification_test.rbtest/system/regular_events/crud_test.rb
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to test/**/*_test.rb : Test suite should use Minitest with structure: `system/`, `models/`, `controllers/`, and fixtures in `test/fixtures/`; test files should be named `*_test.rb`
Applied to files:
bin/rails-test-all-with-reporttest/test_helper.rbtest/system/practices/mentor_test.rbtest/system/notifications/pagination_test.rbtest/system/notification/questions_test.rb
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to test/** : Keep tests deterministic and use fixtures stored in `test/fixtures/` for test data
Applied to files:
test/test_helper.rb
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Use `bin/setup` for local database setup and dependency installation; avoid manual tweaks in `config/` without team discussion
Applied to files:
test/test_helper.rbbin/setupconfig/environments/production.rb
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: All linters must pass (`bin/lint` command) and CI (CircleCI) must be green before merging; add or adjust tests when changing behavior
Applied to files:
test/test_helper.rb
📚 Learning: 2025-09-12T21:18:00.834Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Applied to files:
test/system/products/wip_test.rbtest/models/discord_driver_test.rbtest/system/notification/products_test.rbconfig/puma.rbtest/system/product/unchecked_test.rb
📚 Learning: 2025-09-04T01:27:23.422Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/fixtures/buzzes.yml:0-0
Timestamp: 2025-09-04T01:27:23.422Z
Learning: The buzz_controller.rb was indeed deleted, but there are still two remaining items from the old buzz single page implementation that need cleanup: the data migration file db/data/20230726024528_create_buzz.rb and the old buzz route in config/routes.rb line 136. These should be updated/removed to complete the buzz page redesign migration.
Applied to files:
test/system/questions/wip_test.rbtest/system/pages/notification_test.rb
📚 Learning: 2025-09-01T22:31:57.345Z
Learnt from: matuaya
Repo: fjordllc/bootcamp PR: 9108
File: app/models/after_user_retirement.rb:0-0
Timestamp: 2025-09-01T22:31:57.345Z
Learning: fjordllc/bootcampプロジェクトにおいて、`Newspaper.publish(:retirement_create, { user: user })`はUnfinishedDataDestroyer(未チェックProduct・WIP Report削除、career_pathリセット)とTimesChannelDestroyer(Discord分報チャンネル削除)による重要なデータクリーンアップ処理を実行するため、退会のトリガーが何であろうと(admin、hibernation、user)必ず実行する必要がある。
Applied to files:
test/system/questions/wip_test.rbtest/system/admin/users_test.rbtest/system/pages/notification_test.rb
📚 Learning: 2025-09-01T22:31:57.345Z
Learnt from: matuaya
Repo: fjordllc/bootcamp PR: 9108
File: app/models/after_user_retirement.rb:0-0
Timestamp: 2025-09-01T22:31:57.345Z
Learning: fjordllc/bootcampプロジェクトにおいて、`Newspaper.publish(:retirement_create, { user: user })`は通知処理ではなく、UnfinishedDataDestroyerやTimesChannelDestroyer等による重要なデータクリーンアップ処理を実行するため、管理者による退会(triggered_by: 'admin')の場合でも必ず実行する必要がある。
Applied to files:
test/system/admin/users_test.rbtest/system/pages/notification_test.rb
📚 Learning: 2025-08-31T12:08:33.904Z
Learnt from: thmz337
Repo: fjordllc/bootcamp PR: 9103
File: app/views/generations/_user.html.slim:6-14
Timestamp: 2025-08-31T12:08:33.904Z
Learning: app/views/generations/_user.html.slimの非アクティブメッセージ表示では、退会・休会・非アクティブの3つの条件が独立して評価され、複数のメッセージが同時に表示される仕様になっている。これは意図的な設計である。
Applied to files:
test/system/admin/users_test.rb
📚 Learning: 2025-07-15T12:33:04.885Z
Learnt from: reckyy
Repo: fjordllc/bootcamp PR: 8356
File: db/fixtures/users.yml:823-826
Timestamp: 2025-07-15T12:33:04.885Z
Learning: fjordllc/bootcampプロジェクトでは、`trainee: true`は「研修に所属していたユーザー」全体を示すフラグであり、研修中のユーザーと研修を終了したユーザーの両方を含む。そのため、`trainee: true`と`training_completed_at`の併存は意図された仕様であり、排他的な関係ではない。
Applied to files:
test/system/admin/users_test.rb
📚 Learning: 2025-09-04T01:27:23.422Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/fixtures/buzzes.yml:0-0
Timestamp: 2025-09-04T01:27:23.422Z
Learning: The buzz_controller.rb and related data migration files were deleted as part of the Buzz page redesign, not just modified. The old single buzz page was completely replaced with a new buzzes (plural) listing page with year-based navigation and metadata structure.
Applied to files:
test/system/pages/notification_test.rb
📚 Learning: 2025-09-12T21:16:47.639Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Applied to files:
config/puma.rbconfig/environments/development.rb
📚 Learning: 2025-09-12T21:17:26.029Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:19-23
Timestamp: 2025-09-12T21:17:26.029Z
Learning: Rails アップグレードPRにおいて、config_for(:secrets) を使った webhook URL 設定の shared セクション未参照問題は、設定システム全体の変更として別PRで対応すべきである。
Applied to files:
config/puma.rbconfig/environments/production.rb
📚 Learning: 2025-09-12T21:17:45.295Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:52-56
Timestamp: 2025-09-12T21:17:45.295Z
Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Applied to files:
config/puma.rbconfig/environments/development.rb
📚 Learning: 2025-11-13T09:20:36.030Z
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9115
File: db/migrate/20250902024949_add_unique_index_to_correct_answers.rb:1-5
Timestamp: 2025-11-13T09:20:36.030Z
Learning: fjordllc/bootcamp プロジェクトでは、データの整合性を保つためのデータ修正には data-migrate gem を使用し、db/data/ ディレクトリ配下にデータマイグレーションファイルを作成する運用を採用している。スキーマ変更(db/migrate/)とデータ変更(db/data/)を分離することで、より安全で管理しやすい構成を実現している。
Applied to files:
config/puma.rb
📚 Learning: 2025-08-24T13:40:16.118Z
Learnt from: sjabcdefin
Repo: fjordllc/bootcamp PR: 9090
File: app/javascript/user_sns.js:36-45
Timestamp: 2025-08-24T13:40:16.118Z
Learning: app/javascript/user_sns.js で使用される SNS フィールド(github_account, twitter_account, facebook_url, blog_url)は db/fixtures/users.yml の読み取り専用データで、ユーザーや管理者による編集機能は存在しない
Applied to files:
test/fixtures/users.yml
📚 Learning: 2025-08-24T13:40:16.118Z
Learnt from: sjabcdefin
Repo: fjordllc/bootcamp PR: 9090
File: app/javascript/user_sns.js:36-45
Timestamp: 2025-08-24T13:40:16.118Z
Learning: app/javascript/user_sns.js では baseUrl は固定値、url は db/fixtures/users.yml で定義されているフィクスチャデータを使用している
Applied to files:
test/fixtures/users.yml
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to config/** : Configuration files in `config/` should include environment settings, routes, and lints (`.rubocop.yml`, `config/slim_lint.yml`)
Applied to files:
config/environments/production.rbconfig/environments/development.rb
📚 Learning: 2025-09-15T07:39:39.350Z
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9155
File: app/controllers/api/correct_answers_controller.rb:20-22
Timestamp: 2025-09-15T07:39:39.350Z
Learning: API::CorrectAnswersController#update では、ベストアンサー取り下げという単純な状態変更のため、update! を使用して DB エラー時に 500 を返し、成功時はデフォルトレスポンスを使用するのが適切。クライアント側のバリデーションエラーは発生しにくく、明示的なエラーハンドリングは不要。
Applied to files:
test/system/notification/questions_test.rb
🧬 Code graph analysis (10)
test/system/reports/notification_test.rb (2)
test/models/discord_driver_test.rb (1)
test(5-17)test/system/notifications_bell_test.rb (1)
test(5-78)
test/system/questions_test.rb (1)
test/models/discord_driver_test.rb (1)
test(5-17)
test/system/questions/wip_test.rb (2)
test/system/events/wip_test.rb (1)
test(6-41)test/system/products/wip_test.rb (1)
test(6-135)
test/system/corporate_training_inquiry_system_test.rb (1)
test/system/notification/assigned_as_checker_test.rb (1)
deliveries(15-17)
app/models/discord/server.rb (1)
app/models/discord/times_category.rb (1)
class_attribute(4-19)
test/system/notifications/pagination_test.rb (4)
test/system/admin/users_test.rb (1)
test(5-442)test/system/mentor/courses_test.rb (1)
test(5-54)test/system/notifications_bell_test.rb (1)
test(5-78)test/system/users/profile_test.rb (1)
test(6-214)
test/system/pages/notification_test.rb (2)
test/models/discord_driver_test.rb (1)
test(5-17)test/system/notifications_bell_test.rb (1)
test(5-78)
test/system/notification/mention_test.rb (1)
test/supports/mock_helper.rb (1)
mock_openai_chat_completion(4-17)
config/environments/production.rb (1)
config/application.rb (1)
config(10-46)
test/system/notification/questions_test.rb (1)
test/models/discord_driver_test.rb (1)
test(5-17)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build_and_test
🔇 Additional comments (44)
config/initializers/assets.rb (1)
4-4: 問題ありません。クォートのスタイル変更のみで、機能的な影響はありません。
rails app:updateによる自動生成の変更と思われます。test/system/admin/users_test.rb (3)
183-199: LGTM! テストのリファクタリングが適切です。
update_columnsを使用して Stripe API 呼び出しを回避する方法は適切です(コールバックをスキップ)times_idのセットアップと退会後のクリア検証が明確になりました- アサーションを stub ブロック外に移動したことで、DB 状態の検証が適切に行われています
235-252: LGTM! Stripe API モックが適切に実装されています。
stub_requestによる明示的な API モックは VCR カセットより制御しやすく、Rails 8.1 環境でのテスト安定性向上に寄与しますassert_requestedでcancel_at_period_end=trueパラメータの送信を検証している点も良いですCard.destroy_allのスタブと組み合わせて、外部依存を適切に分離しています
320-322: セレクタの変更について確認が必要です。他のテスト(例: lines 92, 108, 128, 262 など)では
click_on '更新する'を使用していますが、このテストのみfind('#user_submit').clickに変更されています。Rails 8.1 アップグレードで特定の問題が発生したため変更したのであれば問題ありませんが、デバッグ時の一時的な変更であれば、一貫性のため
click_on '更新する'に戻すことを検討してください。test/system/users/profile_test.rb (1)
165-165: LGTM! ランタイム機能チェックへの改善により、テストの信頼性が向上しています。CI環境変数による判定から、実際のHEICサポート機能の有無を確認する方式に変更されており、以下の点で優れています:
- より正確:環境を仮定するのではなく、実際の機能を検証
- より柔軟:HEICサポートが利用可能な環境であれば、CI環境でもテストを実行可能
- より保守性が高い:環境に依存せず、実際の機能に基づいてテストの実行/スキップを判断
heic_supported?メソッドの実装も適切で、Vips::Errorを正しくキャッチし、ファイルパスもテストで使用されているものと一致しています。Also applies to: 205-213
test/system/products/wip_test.rb (1)
118-118: LGTM! UI検証の追加により、テストカバレッジが向上しています。WIP提出物を「提出する」に変更した後、レビュースケジュールメッセージが表示されることを検証するアサーションが追加されました。これは、92〜95行目のテスト(WIP状態ではメッセージが表示されないことを確認)と対になる適切な検証です。部分的なテキストマッチを使用することで、テストが文言の細かい変更に対してより堅牢になっています。
AI要約に記載されているように、提出後のUI検証を追加するパターンと一致しています。
public/400.html (1)
1-135: エラーページが英語化されています。意図的な変更か確認してください。Rails 8.1 のデフォルトエラーページは英語です。このプロジェクトは日本語が主言語のため、ユーザー体験を考慮して日本語版へのローカライズが必要かどうかを確認することをお勧めします。
なお、モダンなHTML5構造、レスポンシブデザイン、ダークモード対応など、技術的な実装は適切です。
Based on learnings, Rails アップグレードPRのため、エラーページの言語変更のみを確認事項として指摘し、それ以外の改善提案は控えます。
public/404.html (1)
1-135: 日本語版から英語版への置き換えを確認してください。既存の日本語404ページがRails 8のデフォルト英語ページに置き換えられています。
rails app:updateの結果と思われますが、日本語ユーザー向けのメッセージに戻す必要があるかどうかを検討してください。技術的には、レスポンシブデザインやダークモード対応など、モダンな実装になっています。
Based on learnings, エラーページの実際の内容を確認してから言語変更のみを指摘しています。
public/406-unsupported-browser.html (1)
1-135: エラーページの言語を確認してください。サポート対象外ブラウザ向けのメッセージが英語になっています。日本語ユーザー向けの表示が必要かどうかを確認してください。
public/422.html (1)
1-135: 日本語版から英語版への変更を確認してください。既存の日本語422エラーページがRails 8デフォルトの英語版に置き換えられています。ユーザー向けメッセージの言語が適切かどうかを確認してください。
モダンなHTML5構造とアクセシビリティ対応は適切に実装されています。
public/500.html (1)
1-135: 重要:500エラーページの言語変更を確認してください。500エラーページは最も頻繁に表示される可能性があるエラーページです。Rails 8デフォルトの英語版に置き換えられていますが、日本語ユーザー向けのメッセージが必要かどうかを確認することを強くお勧めします。
技術的な実装(レスポンシブデザイン、ダークモード対応、アクセシビリティ)は適切です。
Based on learnings, エラーページの実際の内容を確認し、言語変更のみを指摘しています。
bin/claude-system-test (1)
1-33: 全体構造は良好スクリプト全体の構造とロジックは適切です:
set -eo pipefailによる堅牢なエラーハンドリング- プロジェクトルートへの移動
- 環境変数の適切な設定
- テストワークフローに沿った明確なシステムプロンプト
Rails 8.1 アップグレードにおけるシステムテスト支援ツールとして適切なスコープです。
test/fixtures/users.yml (1)
818-818: kyuukaiフィクスチャの変更は既存テストに影響しません
kyuukaiフィクスチャの以下の変更により、既存テストが破損することはありません:
customer_idの変更:新しいID(cus_JhRfQ7G68L2k8R)はVCRカセットに記録されており、既存テストで直接assertされていないcountry_codeとsubdivision_codeの追加:kyuukaiを使用するテスト49件以上がありますが、これらのテストは主に休会ユーザー機能、ユーザー検索、プロフィール閲覧、通知機能などの動作検証であり、これらの新規フィールドには依存していないtest/system/notifications_bell_test.rb (1)
25-25: LGTM!通知ページにアクセスした後、通知テキストが表示されることを検証するアサーションの追加は適切です。これによりテストの堅牢性が向上します。
test/models/discord_driver_test.rb (1)
13-15: LGTM!VCRカセットからWebMockスタブへの移行は適切です。この変更により、外部ファイルへの依存がなくなり、テストがより直接的で保守しやすくなります。
test/system/mentor/courses_test.rb (2)
37-37: LGTM!コース更新後の成功メッセージを検証するアサーションの追加は適切です。これにより、UIフィードバックが正しく表示されることを確認できます。
44-44: LGTM!コース更新後の成功メッセージを検証するアサーションの追加は適切です。30行目と同様に、ユーザーへのフィードバックが正しく表示されることを確認できます。
test/system/notifications/pagination_test.rb (2)
24-24: LGTM!
visit_with_authヘルパーの使用により、認証フローが統一され、テストの一貫性が向上しています。この変更は、関連する他のシステムテスト(test/system/notifications_bell_test.rb、test/system/mentor/courses_test.rbなど)とも整合性が取れています。Also applies to: 40-40, 53-53, 70-70, 88-88, 100-100
33-33: LGTM!
assert_current_pathからassert_matchとcurrent_urlへの変更は適切です。正規表現ベースのマッチングにより、クエリパラメータの順序に依存しない柔軟な検証が可能になります。特に複数のクエリパラメータを含むURLの検証において、この方法はより堅牢です。Also applies to: 62-63, 79-81
config/initializers/content_security_policy.rb (1)
23-26: LGTM!Rails 8.1のContent Security Policyに関するドキュメントの追加です。
content_security_policy_nonce_auto設定についての説明が追加され、開発者にとって有用な情報となっています。test/system/regular_events/crud_test.rb (1)
26-29: LGTM!成功メッセージの検証を
assert_differenceブロック内に移動することで、データベースの変更とUI表示の整合性を同一トランザクション内で確認できるようになっています。これはテストの信頼性向上につながる良い変更です。test/system/home/events_test.rb (1)
140-141: このテストファイルは新規作成されたもので、以前のバージョンは存在しません。Line 140は新しいテストコードであり、
click_button 'WIP'から変更されたわけではなく、最初からfind('#js-shortcut-wip').clickで実装されています。テストの修正とDRbハング問題解決の一環として新規追加されたファイルです。一般的には、テキストベースのセレクタが保守性が高いという原則は妥当ですが、複数のWIPボタンが異なるフォーム(questions、reports、products等)に存在するため、IDベースのセレクタで明示的に指定することは適切です。Line 141の成功メッセージ検証も良い改善です。
test/system/questions/wip_test.rb (1)
135-153: LGTM: テストの簡素化が適切ですテスト名を「通知」から「アクション」にフォーカスするよう変更し、Discord/ログ検証を削除したことは適切です。システムテストはUIの振る舞いに集中すべきで、実装詳細(ログ出力やDiscord通知)のテストは単体テストで行うべきです。Rails 8アップグレードに伴うテストクリーンアップとして妥当な変更です。
test/system/pages/notification_test.rb (1)
7-27: LGTM: questions/wip_test.rbと同様の適切な簡素化Docの作成・公開フローに関するテストについても、テスト名から「通知」の文言を削除し、コア機能の検証に集中する変更は適切です。この一貫したパターンはテストスイート全体の保守性を向上させます。
test/system/events/wip_test.rb (1)
19-22: LGTM: トランザクション境界内でのアサーションが適切成功メッセージのアサーションを
assert_differenceブロック内に移動したことで、イベント作成とUI確認が同じスコープ内で検証されるようになり、テストの堅牢性が向上しています。PRの他のテストファイルとも一貫したパターンになっています。test/system/reports/notification_test.rb (1)
14-33: LGTM: レポート作成テストの適切な簡素化日報作成テストについても、テスト名から通知に関する文言を削除し、コア機能の検証に集中する変更は一貫性があり適切です。Discord webhookのスタブは外部HTTPコールを防ぐために残しつつ、実装詳細の検証を削除する判断は妥当です。
bin/setup (2)
25-25: LGTM: オプショナルなデータベースリセット機能の追加
--resetフラグによるオプショナルなデータベースリセット機能は、開発環境の初期化やトラブルシューティング時に有用です。デフォルトではdb:prepareのみ実行し、必要時にのみリセットできる設計は適切です。
30-34: LGTM: CI対応とdev serverの起動改善
--skip-serverフラグの追加により、CI環境でのbin/setup利用が可能になっています(bin/ciで使用)。また、execを使用した開発サーバーの起動は、プロセスを置き換えるため適切です。STDOUT.flushによりexec前の出力が確実に表示される点も良い実装です。bin/rails-test-all-with-report (1)
1-87: テストオーケストレーションスクリプトの実装が適切です。新しいテスト実行・レポート生成スクリプトが正しく実装されています。
PARALLEL_WORKERSとMINITEST_RETRY_COUNT環境変数のデフォルト値がtest/test_helper.rbの設定と整合しており、PIPESTATUSを使用した終了コードの取得も正確です。Rails 8.1アップグレードに伴うテスト基盤の強化として適切です。test/system/practices/summary_test.rb (1)
30-30: テストカバレッジの向上。更新成功メッセージの検証が追加され、テストの信頼性が向上しています。
test/system/notification/mention_test.rb (2)
14-14: OpenAIモックの追加が適切です。質問作成フローでAI機能が呼び出される可能性に対応するため、
mock_openai_chat_completionのセットアップが追加されています。
65-65: テストカバレッジの向上。質問作成成功メッセージの検証が追加され、テストの信頼性が向上しています。
test/test_helper.rb (2)
22-26: テストリトライ設定の柔軟性向上。CI環境だけでなく、
MINITEST_RETRY_COUNT環境変数が設定されている場合もリトライを有効化するように変更されています。これにより、ローカル環境でもflakyなテストのデバッグが容易になります。bin/rails-test-all-with-reportスクリプトとの統合も適切です。
31-35: 並列実行設定の改善。
PARALLEL_WORKERS環境変数による並列実行の制御が追加され、デフォルト値1により並列化が無効化されています。コメントで説明されている通り、DRb/forkの問題(Rails issue #55513)を回避しつつ、必要に応じて有効化できる柔軟な設計です。test/system/notification/questions_test.rb (1)
153-154: フォームフィールドのクリア処理の使用パターンを確認してください。
fill_options: { clear: :backspace }がこのテストケース(WIP更新後の公開)のみに適用されている一方で、同じファイル内の他の質問更新シナリオ(57-60行目、129-132行目、198-201行目、244-247行目)では使用されていません。ただし、このテストケースには重要な特徴があります。153-154行目の
fill_inは、同じテスト内で145-150行目の最初のfill_inに続いて実行されており、同じフォームを2回連続で埋める唯一のケースです。他の更新シナリオはフォームを1回のみ埋めています。この差異が意図的なもの(double-fillでのみクリアが必要)なのか、それとも他の更新シナリオでも同様にクリアが必要なのか、確認してください。
test/system/notification/products_test.rb (1)
92-92: LGTM!提出物作成後の成功メッセージを検証する assertion が追加されています。同ファイル内の他のテストケース(37行目、57行目など)と一貫したパターンであり、UIフィードバックの検証を強化する良い変更です。
test/system/questions_test.rb (1)
21-29: LGTM!テストが簡略化され、Discord通知のログ検証からUI動作の検証に焦点を移しています。システムテストではユーザーから見える動作(成功メッセージの表示)を検証し、Discord統合の詳細は別のユニットテストで検証する設計は適切です。
test/system/events/crud_test.rb (1)
19-22: LGTM!
assert_differenceブロック内に成功メッセージの検証が移動されています。Capybaraのassert_textは待機機能を持つため、UIフィードバックとDB変更の両方が完了することを確認できる適切な構造です。test/supports/mention_helper.rb (1)
14-14: LGTM!ログイン後にダッシュボードのテキストが表示されることを確認する assertion が追加されています。これにより、メンション投稿の前にログインが完了していることを明示的に検証でき、テストの堅牢性が向上します。
Also applies to: 19-19
app/models/discord/server.rb (1)
5-5: Rails 8.2での非推奨化に対応する適切な変更です。
ActiveSupport::Configurableのconfig_accessorからclass_attributeへの移行は、PRの目的に記載されている非推奨警告に対応するものです。instance_accessor: falseにより、クラスレベルでのみアクセス可能な属性として、元のconfig_accessorの動作を維持しています。初期化ファイル(
config/initializers/discord.rb)では、これらの属性が正しくクラスレベルで設定されており、クラス内のすべての使用箇所(class << selfブロック内でguild_idとauthorize_tokenにアクセス)も一貫してクラスレベルのアクセスとなっているため、変更は完全に正しく実装されています。app/models/discord/times_category.rb (1)
5-5: ActiveSupport::Configurable の廃止に適切に対応しています。
class_attributeへの移行は Rails 8.2 でのActiveSupport::Configurable廃止予定に対応した適切な変更です。instance_accessor: falseによりクラスレベルのアクセスのみを維持しており、既存の動作を保持しています。test/system/practices/mentor_test.rb (1)
113-113: フィールドのクリア方法が改善されています。
fill_options: { clear: :backspace }の使用により、既存の値を確実にクリアしてから新しい値を入力できるようになり、テストの信頼性が向上しています。config/initializers/discord.rb (1)
7-12: 設定方式の移行が適切に実施されています。
configureブロックから直接的なクラス属性への代入に変更されており、class_attributeへの移行と整合性が取れています。authorize_tokenへの "Bot " プレフィックスの付与など、既存のロジックも正しく保持されています。config/environments/development.rb (1)
23-23: Rails 8.1 の標準設定に適切に更新されています。以下の変更は
rails app:updateにより生成された Rails 8.1 の標準設定です:
- HTTPヘッダーキーの小文字化("cache-control")
cache_storeの構造改善(条件文の外側への移動)- 開発環境での SQL クエリログタグの有効化(
query_log_tags_enabled)- リダイレクトの詳細ログ出力の有効化(
verbose_redirect_logs)これらの変更により、開発環境での可観測性が向上します。
Also applies to: 28-29, 42-43, 60-61, 74-75
| export PROMPT_COMMAND="${PROMPT_COMMAND:-}" | ||
|
|
||
| # Ensure mise is activated for proper Ruby/Node versions | ||
| eval "$(mise activate bash)" |
There was a problem hiding this comment.
mise コマンドの存在確認を追加すべき
mise が未インストールの場合や実行に失敗した場合、このスクリプトは不明瞭なエラーで失敗します。Rails アップグレードのテスト作業中に混乱を招く可能性があります。
🔎 依存関係チェックの追加案
+# Check if mise is available
+if ! command -v mise &> /dev/null; then
+ echo "Error: mise command not found. Please install mise first." >&2
+ exit 1
+fi
+
# Ensure mise is activated for proper Ruby/Node versions
eval "$(mise activate bash)"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| eval "$(mise activate bash)" | |
| # Check if mise is available | |
| if ! command -v mise &> /dev/null; then | |
| echo "Error: mise command not found. Please install mise first." >&2 | |
| exit 1 | |
| fi | |
| # Ensure mise is activated for proper Ruby/Node versions | |
| eval "$(mise activate bash)" |
🤖 Prompt for AI Agents
In bin/claude-system-test around line 11, the script blindly runs eval "$(mise
activate bash)"; add a check to ensure the mise command exists and is executable
before calling it, and handle failure of the eval: if mise is not found, print a
clear error message with remediation (how to install or that tests require mise)
and exit with a non-zero status; if eval returns a non-zero status, print an
explanatory error and exit non-zero as well so the script fails fast with a
clear message.
| # Replace the default in-process memory cache store with a durable alternative. | ||
| config.cache_store = :memory_store |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
git log --oneline --all -- config/environments/production.rb | head -20Repository: fjordllc/bootcamp
Length of output: 159
🏁 Script executed:
git show HEAD:config/environments/production.rb | sed -n '45,55p'Repository: fjordllc/bootcamp
Length of output: 438
🏁 Script executed:
git show HEAD~1:config/environments/production.rb 2>/dev/null | sed -n '45,55p' || echo "Previous commit file not found or doesn't exist"Repository: fjordllc/bootcamp
Length of output: 43
🏁 Script executed:
git diff HEAD -- config/environments/production.rb | head -100Repository: fjordllc/bootcamp
Length of output: 43
🏁 Script executed:
git log --all -S "memory_store" --oneline -- config/environments/production.rbRepository: fjordllc/bootcamp
Length of output: 159
🏁 Script executed:
git diff HEAD~5..HEAD -- config/environments/production.rb | grep -A 3 -B 3 "cache_store"Repository: fjordllc/bootcamp
Length of output: 95
🏁 Script executed:
git log --all -p -- config/environments/production.rb | head -200Repository: fjordllc/bootcamp
Length of output: 8293
🏁 Script executed:
git show f49bff4f5:config/environments/production.rb | sed -n '45,55p'Repository: fjordllc/bootcamp
Length of output: 438
🏁 Script executed:
git show 60de05e6c:config/environments/production.rb 2>/dev/null | sed -n '45,55p' || echo "File content not available in 60de05e6c"Repository: fjordllc/bootcamp
Length of output: 561
キャッシュストア設定とコメントの矛盾を修正してください
49行目のコメントは「durable alternative(永続的な代替手段)」への変更を推奨していますが、50行目の実装は :memory_store(非永続的なインメモリキャッシュ)のままです。
以下のいずれかで対応してください:
- コメントの意図通り、Redis や Memcached などの永続的なキャッシュストアに変更する
- または、
memory_storeが意図的な選択であれば、49行目のコメントを実装に合わせて更新する
🤖 Prompt for AI Agents
config/environments/production.rb lines 49-50: コメントは「durable
alternative」を要求していますが実装は依然として :memory_store になっているため整合性が取れていません。対応はどちらかを選んでください
— 永続的なキャッシュを意図しているなら Redis または Memcached に切り替え(例: redis/memcached の接続 URL を用いて
production 用の cache_store を設定)し、適切な接続設定と初期化を追加する;あるいは :memory_store
が正しい意図なら行49のコメントを「in-memory cache を使用している」など実装に合う説明に書き換える。
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (3)
Gemfile (2)
71-71: react-rails の GitHub main ブランチ参照について。過去のレビューで指摘された通り、特定のコミット SHA へのピン留めを検討してください。
118-118: minitest < 6.0 制約について。過去のレビューで既に指摘されています。この制約が Rails 8.1 との互換性に必須である理由を明確にしてください。
config/environments/production.rb (1)
49-50: キャッシュストア設定とコメントの矛盾について。過去のレビューで指摘された通り、コメントは「durable alternative(永続的な代替手段)」を示唆していますが、実装は
:memory_store(非永続的)のままです。
🧹 Nitpick comments (1)
config/recurring.yml (1)
12-15: 完了済みジョブのクリーンアップタスクは適切です。
sleep_between_batches: 0.3によりデータベース負荷を軽減しつつ、定期的にクリーンアップが行われます。開発環境でもジョブのクリーンアップ動作を確認したい場合は、
development環境にも同様のタスクを追加することを検討してください。ただし、これはオプションです。🔎 開発環境用の設定例
production: clear_solid_queue_finished_jobs: command: "SolidQueue::Job.clear_finished_in_batches(sleep_between_batches: 0.3)" schedule: every hour at minute 12 + +development: + clear_solid_queue_finished_jobs: + command: "SolidQueue::Job.clear_finished_in_batches(sleep_between_batches: 0.3)" + schedule: every day at 3am
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
Gemfile.lockis excluded by!**/*.lock
📒 Files selected for processing (13)
Gemfilebin/jobsconfig/environments/development.rbconfig/environments/production.rbconfig/initializers/good_job.rbconfig/initializers/mission_control.rbconfig/queue.ymlconfig/recurring.ymlconfig/routes.rbdb/migrate/20250828192201_create_good_jobs.rbdb/migrate/20260104051844_create_solid_queue_tables.rbdb/migrate/20260104051945_drop_good_job_tables.rbdb/schema.rb
💤 Files with no reviewable changes (2)
- config/initializers/good_job.rb
- db/migrate/20250828192201_create_good_jobs.rb
🧰 Additional context used
📓 Path-based instructions (3)
config/**
📄 CodeRabbit inference engine (AGENTS.md)
Configuration files in
config/should include environment settings, routes, and lints (.rubocop.yml,config/slim_lint.yml)
Files:
config/routes.rbconfig/environments/development.rbconfig/recurring.ymlconfig/queue.ymlconfig/environments/production.rbconfig/initializers/mission_control.rb
**/*.rb
📄 CodeRabbit inference engine (AGENTS.md)
Ruby code should use 2-space indentation, snake_case for method names, and CamelCase for class names, enforced by RuboCop (
.rubocop.yml)
Files:
config/routes.rbdb/migrate/20260104051844_create_solid_queue_tables.rbconfig/environments/development.rbdb/migrate/20260104051945_drop_good_job_tables.rbconfig/environments/production.rbdb/schema.rbconfig/initializers/mission_control.rb
⚙️ CodeRabbit configuration file
**/*.rb: # refactoring
- まずFat Controllerを避け、次にFat Modelを避ける。
- Serviceクラスの乱用を避ける。
- controller concernを作ろうとしたらPORO(Plain Old Ruby Object)やActiveRecordモデルでの実装で代替できないか検討する。
Rails Patterns
- ViewHelperにメソッドを実装する時にはまずDecoratorパターンを使うことを検討する。(active_decorator gemを導入しているのでそれを使う)
- 複雑なActiveRecordクエリがあり、再利用できそうな場合はQueryObjectパターンを検討する。(rails-patterns gemを導入しているのでそれのQuery機能を使う)
- Viewにpartialを作る場合はViewComponentを使うことを検討する。
- 複数のActiveRecordモデルを操作する1つの責務がある時や外部APIとやりとりする処理がある場合にはInteractorオブジェクトパターンを検討する。(interactor gemを導入しているのでそれを使う)
- 複数のInteractorを実行するような処理がある場合Organizerオブジェクトパターンを検討する。(interactor gemを導入しており、その中にOrganizerの機能があるので使う)
Files:
config/routes.rbdb/migrate/20260104051844_create_solid_queue_tables.rbconfig/environments/development.rbdb/migrate/20260104051945_drop_good_job_tables.rbconfig/environments/production.rbdb/schema.rbconfig/initializers/mission_control.rb
db/**
📄 CodeRabbit inference engine (AGENTS.md)
Database migrations and schema should be stored in
db/directory; app-specific utilities inlib/; static assets inpublic/
Files:
db/migrate/20260104051844_create_solid_queue_tables.rbdb/migrate/20260104051945_drop_good_job_tables.rbdb/schema.rb
🧠 Learnings (20)
📓 Common learnings
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9115
File: db/migrate/20250902024949_add_unique_index_to_correct_answers.rb:1-5
Timestamp: 2025-11-13T09:20:36.030Z
Learning: fjordllc/bootcamp プロジェクトでは、データの整合性を保つためのデータ修正には data-migrate gem を使用し、db/data/ ディレクトリ配下にデータマイグレーションファイルを作成する運用を採用している。スキーマ変更(db/migrate/)とデータ変更(db/data/)を分離することで、より安全で管理しやすい構成を実現している。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: config/initializers/sorcery.rb:0-0
Timestamp: 2025-09-11T16:02:24.782Z
Learning: Rails アップグレードPRにおいて、JWT設定の改善では複数のソース(secrets, credentials, ENV)を優先順位付きで検索し、本番環境では未設定時に起動を停止させる実装が推奨される。開発・テスト環境でのみsecret_key_baseフォールバックを許可する構成が安全である。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/product.rb:59-61
Timestamp: 2025-09-11T14:47:53.256Z
Learning: Rails アップグレードPRでは、アップグレードに直接関連しない性能改善や機能追加の提案は避けるべき。PRのスコープを維持することが重要で、そのような改善提案は別PRで対応すべきである。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:52-56
Timestamp: 2025-09-12T21:17:45.295Z
Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/migrate/20250831234516_remove_unique_index_from_buzzes_title.rb:1-5
Timestamp: 2025-09-04T01:50:47.773Z
Learning: fjordllc/bootcampプロジェクトでは、マイグレーションにおいてdisable_ddl_transaction!やalgorithm: :concurrentlyは使用せず、標準的なRailsのchangeメソッド内でremove_indexを実行する慣例がある。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:19-23
Timestamp: 2025-09-12T21:17:26.029Z
Learning: Rails アップグレードPRにおいて、config_for(:secrets) を使った webhook URL 設定の shared セクション未参照問題は、設定システム全体の変更として別PRで対応すべきである。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: app/controllers/mentor/buzzes_controller.rb:0-0
Timestamp: 2025-09-04T01:39:22.261Z
Learning: fjordllc/bootcamp プロジェクトでは、更新処理の成功時の通知メッセージについて、I18n を使用せずに日本語文字列を直接記述する方針で一貫性を保っている。
Learnt from: matuaya
Repo: fjordllc/bootcamp PR: 9108
File: app/models/after_user_retirement.rb:0-0
Timestamp: 2025-09-01T22:31:57.345Z
Learning: fjordllc/bootcampプロジェクトにおいて、`Newspaper.publish(:retirement_create, { user: user })`はUnfinishedDataDestroyer(未チェックProduct・WIP Report削除、career_pathリセット)とTimesChannelDestroyer(Discord分報チャンネル削除)による重要なデータクリーンアップ処理を実行するため、退会のトリガーが何であろうと(admin、hibernation、user)必ず実行する必要がある。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: db/migrate/20250828192202_add_missing_columns_to_good_jobs.rb:4-10
Timestamp: 2025-09-11T14:18:20.194Z
Learning: GoodJobやその他の外部gemが生成するマイグレーションファイルは、gem内部のロジックと密接に連携しているため、null制約やデフォルト値の追加などの変更を行うべきではない。gemのアップグレードパスに従い、生成されたマイグレーションをそのまま使用することが適切。
Learnt from: mousu-a
Repo: fjordllc/bootcamp PR: 8566
File: db/migrate/20250830033535_add_default_to_pair_works_wip.rb:1-5
Timestamp: 2025-08-31T03:17:44.812Z
Learning: 新機能のマイグレーションで、まだ本番環境にリリースされていない場合は、既存レコードのバックフィル処理は不要。開発環境でrails db:resetが可能な状況では特に、デフォルト値の変更のみで十分。
📚 Learning: 2025-09-04T01:27:23.422Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/fixtures/buzzes.yml:0-0
Timestamp: 2025-09-04T01:27:23.422Z
Learning: The buzz_controller.rb was indeed deleted, but there are still two remaining items from the old buzz single page implementation that need cleanup: the data migration file db/data/20230726024528_create_buzz.rb and the old buzz route in config/routes.rb line 136. These should be updated/removed to complete the buzz page redesign migration.
Applied to files:
config/routes.rbdb/schema.rb
📚 Learning: 2025-09-12T21:17:45.295Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:52-56
Timestamp: 2025-09-12T21:17:45.295Z
Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Applied to files:
config/environments/development.rbconfig/environments/production.rbGemfile
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to config/** : Configuration files in `config/` should include environment settings, routes, and lints (`.rubocop.yml`, `config/slim_lint.yml`)
Applied to files:
config/environments/development.rbconfig/environments/production.rb
📚 Learning: 2025-09-11T16:02:24.782Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: config/initializers/sorcery.rb:0-0
Timestamp: 2025-09-11T16:02:24.782Z
Learning: Rails アップグレードPRにおいて、JWT設定の改善では複数のソース(secrets, credentials, ENV)を優先順位付きで検索し、本番環境では未設定時に起動を停止させる実装が推奨される。開発・テスト環境でのみsecret_key_baseフォールバックを許可する構成が安全である。
Applied to files:
config/environments/development.rbconfig/environments/production.rbconfig/initializers/mission_control.rbGemfile
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Use `bin/setup` for local database setup and dependency installation; avoid manual tweaks in `config/` without team discussion
Applied to files:
config/environments/development.rbconfig/environments/production.rb
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to **/*.rb : Ruby code should use 2-space indentation, snake_case for method names, and CamelCase for class names, enforced by RuboCop (`.rubocop.yml`)
Applied to files:
config/environments/development.rb
📚 Learning: 2025-09-11T14:18:20.194Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: db/migrate/20250828192202_add_missing_columns_to_good_jobs.rb:4-10
Timestamp: 2025-09-11T14:18:20.194Z
Learning: GoodJobやその他の外部gemが生成するマイグレーションファイルは、gem内部のロジックと密接に連携しているため、null制約やデフォルト値の追加などの変更を行うべきではない。gemのアップグレードパスに従い、生成されたマイグレーションをそのまま使用することが適切。
Applied to files:
db/migrate/20260104051945_drop_good_job_tables.rb
📚 Learning: 2025-09-04T01:50:47.773Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/migrate/20250831234516_remove_unique_index_from_buzzes_title.rb:1-5
Timestamp: 2025-09-04T01:50:47.773Z
Learning: fjordllc/bootcampプロジェクトでは、マイグレーションにおいてdisable_ddl_transaction!やalgorithm: :concurrentlyは使用せず、標準的なRailsのchangeメソッド内でremove_indexを実行する慣例がある。
Applied to files:
db/migrate/20260104051945_drop_good_job_tables.rbGemfile
📚 Learning: 2025-09-12T21:17:26.029Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:19-23
Timestamp: 2025-09-12T21:17:26.029Z
Learning: Rails アップグレードPRにおいて、config_for(:secrets) を使った webhook URL 設定の shared セクション未参照問題は、設定システム全体の変更として別PRで対応すべきである。
Applied to files:
config/environments/production.rbGemfile
📚 Learning: 2025-09-12T21:18:00.834Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Applied to files:
config/environments/production.rbGemfile
📚 Learning: 2025-09-12T21:16:47.639Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Applied to files:
config/environments/production.rbGemfile
📚 Learning: 2025-09-08T04:55:46.649Z
Learnt from: sharoa119
Repo: fjordllc/bootcamp PR: 8711
File: db/schema.rb:0-0
Timestamp: 2025-09-08T04:55:46.649Z
Learning: In this PR, the removal of length limits from companies.name and companies.website columns in db/schema.rb was unintentional - it was a case of accidentally lost constraints that needed to be restored to their original limits, not a deliberate design change.
Applied to files:
db/schema.rb
📚 Learning: 2025-09-11T14:47:53.256Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/product.rb:59-61
Timestamp: 2025-09-11T14:47:53.256Z
Learning: Rails アップグレードPRでは、アップグレードに直接関連しない性能改善や機能追加の提案は避けるべき。PRのスコープを維持することが重要で、そのような改善提案は別PRで対応すべきである。
Applied to files:
Gemfile
📚 Learning: 2025-11-13T09:20:36.030Z
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9115
File: db/migrate/20250902024949_add_unique_index_to_correct_answers.rb:1-5
Timestamp: 2025-11-13T09:20:36.030Z
Learning: fjordllc/bootcamp プロジェクトでは、データの整合性を保つためのデータ修正には data-migrate gem を使用し、db/data/ ディレクトリ配下にデータマイグレーションファイルを作成する運用を採用している。スキーマ変更(db/migrate/)とデータ変更(db/data/)を分離することで、より安全で管理しやすい構成を実現している。
Applied to files:
Gemfile
📚 Learning: 2025-07-07T05:28:03.676Z
Learnt from: su-su-su-su
Repo: fjordllc/bootcamp PR: 0
File: :0-0
Timestamp: 2025-07-07T05:28:03.676Z
Learning: fjordllc/bootcampプロジェクトでは、fixtureファイル内のERB構文で改行制御文字(-)は使用せず、標準的な<% %>と<%= %>のみを使用する方針が統一されている。<% -%>や<%- %>を使用するとSyntaxErrorが発生する。
Applied to files:
Gemfile
📚 Learning: 2025-11-17T00:46:30.794Z
Learnt from: tyrrell-IH
Repo: fjordllc/bootcamp PR: 9306
File: app/javascript/components/Bookmarks.jsx:248-265
Timestamp: 2025-11-17T00:46:30.794Z
Learning: fjordllc/bootcamp プロジェクトでは、Reactからバニラ JavaScript への移行作業が進行中である。そのため、新しいReactファイルの作成は避け、既存のReactコンポーネント内で完結する実装が推奨される。BookmarksInDashboard.jsx は issue #9045 で削除予定。
Applied to files:
Gemfile
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to test/**/*_test.rb : Use Minitest + Capybara for system tests; place unit and integration tests under matching `test/*` directories
Applied to files:
Gemfile
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to test/**/*_test.rb : Test suite should use Minitest with structure: `system/`, `models/`, `controllers/`, and fixtures in `test/fixtures/`; test files should be named `*_test.rb`
Applied to files:
Gemfile
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to test/** : Keep tests deterministic and use fixtures stored in `test/fixtures/` for test data
Applied to files:
Gemfile
🧬 Code graph analysis (2)
config/environments/development.rb (1)
config/application.rb (1)
config(10-46)
config/environments/production.rb (1)
config/application.rb (1)
config(10-46)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build_and_test
🔇 Additional comments (13)
db/migrate/20260104051844_create_solid_queue_tables.rb (1)
4-137: LGTM! SolidQueue の標準的なマイグレーションパターンに従っています。すべてのテーブルに適切なインデックスが設定されており、外部キーには
on_delete: :cascadeが正しく設定されています。これにより、ジョブ削除時に関連する実行レコードも自動的にクリーンアップされます。config/environments/development.rb (2)
23-23: HTTP/2 準拠のため、小文字のcache-controlヘッダーキーは正しい変更です。
92-93: SolidQueue への移行設定が正しく完了しています。
connects_to設定によってプライマリデータベースの使用が明示されており、本番環境(config/environments/production.rb行 53-54)でも同じ設定が適用されています。テスト環境では:inlineアダプターが使用されており、全環境での設定が一貫性を保っています。config/queue.yml (1)
1-18: LGTM! SolidQueue の設定は適切です。デフォルト設定を YAML アンカーで共有し、環境変数
JOB_CONCURRENCYでプロセス数を制御できる柔軟な構成です。bin/jobs (1)
1-6: LGTM! SolidQueue CLIスクリプトは正しく実装されています。SolidQueue の標準的なパターンに従った実装で、実行権限も既に適切に設定されています。特に修正は不要です。
config/routes.rb (1)
137-137: LGTM! GoodJob から MissionControl への移行が正しく行われています。ジョブダッシュボードのパスが
/jobsに変更されています。これは破壊的変更のため、既存のブックマークやドキュメントの更新が必要になる可能性があります。認証設定もconfig/mission_control.rbで適切に構成されています。db/migrate/20260104051945_drop_good_job_tables.rb (1)
1-15: LGTM! GoodJob テーブル削除マイグレーションは適切に実装されています。
if_exists: trueにより、テーブルが既に削除されている場合のエラーを防止しています。downメソッドでIrreversibleMigrationを発生させるのは、データ損失を伴う破壊的マイグレーションとして適切です。- プロジェクトの慣例に従い、標準的な Rails マイグレーション手法を使用しています。
Gemfile (1)
37-38: GoodJob から SolidQueue への移行は適切です。
solid_queueとmission_control-jobsの追加は、Rails 8 のデフォルトジョブキューバックエンドへの移行として適切な選択です。SolidQueue は Rails チームが公式にサポートしており、Rails 8 との統合がスムーズです。config/environments/production.rb (2)
52-54: SolidQueue の設定は適切です。
queue_adapterを:solid_queueに設定し、プライマリデータベースへの接続を指定しています。これは GoodJob から SolidQueue への移行として正しい構成です。
90-116: ホスト設定とバリデーションは適切に実装されています。
- アセットプリコンパイル時(
SECRET_KEY_BASE == "dummy")の APP_HOST_NAME チェックスキップは適切です。- CLOUD_RUN_HOST_NAME と app_host_name の両方を
config.hostsに追加しているのは、Cloud Run 環境での柔軟性を確保しています。- メーラーとアセットホストの HTTPS 設定も正しく構成されています。
db/schema.rb (3)
13-16: Rails 8.1 スキーマフォーマットへの更新を確認しました。
ActiveRecord::Schema[8.1]への更新とpg_catalog.plpgsql拡張の宣言形式は、Rails 8.1 の標準に準拠しています。
754-873: SolidQueue テーブル構造は適切です。
- SolidQueue gem の標準スキーマに準拠したテーブル構造です。
index_solid_queue_poll_all、index_solid_queue_poll_by_queue、index_solid_queue_dispatch_allなどのインデックスは、キュー操作のパフォーマンスを最適化します。- based on learnings: 外部 gem が生成するマイグレーションは gem 内部のロジックと連携しているため、そのまま使用することが適切です。
1135-1140: SolidQueue 外部キー制約は適切に設定されています。
on_delete: :cascadeにより、ジョブ削除時に関連する実行レコードが自動的にクリーンアップされます。これはキューシステムのデータ整合性を維持するための正しいアプローチです。
| Rails.application.configure do | ||
| config.mission_control.jobs.http_basic_auth_enabled = Rails.env.production? | ||
| config.mission_control.jobs.http_basic_auth_user = ENV.fetch('MISSION_CONTROL_USER', nil) | ||
| config.mission_control.jobs.http_basic_auth_password = ENV.fetch('MISSION_CONTROL_PASSWORD', nil) | ||
| end |
There was a problem hiding this comment.
本番環境で認証情報が未設定の場合のセキュリティリスク
http_basic_auth_enabled = true(本番環境)の状態で、MISSION_CONTROL_USER / MISSION_CONTROL_PASSWORD が未設定の場合、予期しない動作を引き起こす可能性があります。本番環境では認証情報が必須であることを明示的に検証することを推奨します。
Based on learnings, 本番環境では未設定時に起動を停止させる実装が推奨されます。
🔎 本番環境での認証情報検証の提案
Rails.application.configure do
config.mission_control.jobs.http_basic_auth_enabled = Rails.env.production?
- config.mission_control.jobs.http_basic_auth_user = ENV.fetch('MISSION_CONTROL_USER', nil)
- config.mission_control.jobs.http_basic_auth_password = ENV.fetch('MISSION_CONTROL_PASSWORD', nil)
+
+ if Rails.env.production?
+ config.mission_control.jobs.http_basic_auth_user = ENV.fetch('MISSION_CONTROL_USER')
+ config.mission_control.jobs.http_basic_auth_password = ENV.fetch('MISSION_CONTROL_PASSWORD')
+ else
+ config.mission_control.jobs.http_basic_auth_user = ENV.fetch('MISSION_CONTROL_USER', nil)
+ config.mission_control.jobs.http_basic_auth_password = ENV.fetch('MISSION_CONTROL_PASSWORD', nil)
+ end
endこれにより、本番環境で認証情報が未設定の場合はアプリケーション起動時に KeyError が発生し、意図しない状態でのデプロイを防げます。
🤖 Prompt for AI Agents
config/initializers/mission_control.rb lines 3-7: Currently
http_basic_auth_enabled is true in production but user/password are fetched with
defaults, allowing nil credentials; update so that in production the initializer
enforces presence by using ENV.fetch('MISSION_CONTROL_USER') and
ENV.fetch('MISSION_CONTROL_PASSWORD') (no default) or explicitly raise a clear
error if either is blank, so app boot fails on missing credentials in
production.
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
Gemfile.lockis excluded by!**/*.lock
📒 Files selected for processing (1)
Gemfile
🧰 Additional context used
🧠 Learnings (14)
📓 Common learnings
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/product.rb:59-61
Timestamp: 2025-09-11T14:47:53.256Z
Learning: Rails アップグレードPRでは、アップグレードに直接関連しない性能改善や機能追加の提案は避けるべき。PRのスコープを維持することが重要で、そのような改善提案は別PRで対応すべきである。
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9115
File: db/migrate/20250902024949_add_unique_index_to_correct_answers.rb:1-5
Timestamp: 2025-11-13T09:20:36.030Z
Learning: fjordllc/bootcamp プロジェクトでは、データの整合性を保つためのデータ修正には data-migrate gem を使用し、db/data/ ディレクトリ配下にデータマイグレーションファイルを作成する運用を採用している。スキーマ変更(db/migrate/)とデータ変更(db/data/)を分離することで、より安全で管理しやすい構成を実現している。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:52-56
Timestamp: 2025-09-12T21:17:45.295Z
Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: config/initializers/sorcery.rb:0-0
Timestamp: 2025-09-11T16:02:24.782Z
Learning: Rails アップグレードPRにおいて、JWT設定の改善では複数のソース(secrets, credentials, ENV)を優先順位付きで検索し、本番環境では未設定時に起動を停止させる実装が推奨される。開発・テスト環境でのみsecret_key_baseフォールバックを許可する構成が安全である。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/migrate/20250831234516_remove_unique_index_from_buzzes_title.rb:1-5
Timestamp: 2025-09-04T01:50:47.773Z
Learning: fjordllc/bootcampプロジェクトでは、マイグレーションにおいてdisable_ddl_transaction!やalgorithm: :concurrentlyは使用せず、標準的なRailsのchangeメソッド内でremove_indexを実行する慣例がある。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:19-23
Timestamp: 2025-09-12T21:17:26.029Z
Learning: Rails アップグレードPRにおいて、config_for(:secrets) を使った webhook URL 設定の shared セクション未参照問題は、設定システム全体の変更として別PRで対応すべきである。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: app/controllers/mentor/buzzes_controller.rb:0-0
Timestamp: 2025-09-04T01:39:22.261Z
Learning: fjordllc/bootcamp プロジェクトでは、更新処理の成功時の通知メッセージについて、I18n を使用せずに日本語文字列を直接記述する方針で一貫性を保っている。
Learnt from: hirokiej
Repo: fjordllc/bootcamp PR: 8740
File: app/helpers/reports_helper.rb:56-64
Timestamp: 2025-06-29T03:44:15.179Z
Learning: このプロジェクト(fjordllc/bootcamp)では、ja.ymlファイルで一部の単語や文章のみI18n対応されているが、多くのテキストは日本語でハードコーディングされており、完全な国際化対応は行われていない。新しい機能でもI18n対応は不要と判断される。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: db/migrate/20250828192202_add_missing_columns_to_good_jobs.rb:4-10
Timestamp: 2025-09-11T14:18:20.194Z
Learning: GoodJobやその他の外部gemが生成するマイグレーションファイルは、gem内部のロジックと密接に連携しているため、null制約やデフォルト値の追加などの変更を行うべきではない。gemのアップグレードパスに従い、生成されたマイグレーションをそのまま使用することが適切。
Learnt from: mousu-a
Repo: fjordllc/bootcamp PR: 8566
File: db/migrate/20250830033535_add_default_to_pair_works_wip.rb:1-5
Timestamp: 2025-08-31T03:17:44.812Z
Learning: 新機能のマイグレーションで、まだ本番環境にリリースされていない場合は、既存レコードのバックフィル処理は不要。開発環境でrails db:resetが可能な状況では特に、デフォルト値の変更のみで十分。
📚 Learning: 2025-09-11T14:47:53.256Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/product.rb:59-61
Timestamp: 2025-09-11T14:47:53.256Z
Learning: Rails アップグレードPRでは、アップグレードに直接関連しない性能改善や機能追加の提案は避けるべき。PRのスコープを維持することが重要で、そのような改善提案は別PRで対応すべきである。
Applied to files:
Gemfile
📚 Learning: 2025-09-12T21:16:47.639Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Applied to files:
Gemfile
📚 Learning: 2025-09-12T21:17:45.295Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:52-56
Timestamp: 2025-09-12T21:17:45.295Z
Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Applied to files:
Gemfile
📚 Learning: 2025-09-11T16:02:24.782Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: config/initializers/sorcery.rb:0-0
Timestamp: 2025-09-11T16:02:24.782Z
Learning: Rails アップグレードPRにおいて、JWT設定の改善では複数のソース(secrets, credentials, ENV)を優先順位付きで検索し、本番環境では未設定時に起動を停止させる実装が推奨される。開発・テスト環境でのみsecret_key_baseフォールバックを許可する構成が安全である。
Applied to files:
Gemfile
📚 Learning: 2025-09-12T21:17:26.029Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:19-23
Timestamp: 2025-09-12T21:17:26.029Z
Learning: Rails アップグレードPRにおいて、config_for(:secrets) を使った webhook URL 設定の shared セクション未参照問題は、設定システム全体の変更として別PRで対応すべきである。
Applied to files:
Gemfile
📚 Learning: 2025-09-12T21:18:00.834Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Applied to files:
Gemfile
📚 Learning: 2025-11-13T09:20:36.030Z
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9115
File: db/migrate/20250902024949_add_unique_index_to_correct_answers.rb:1-5
Timestamp: 2025-11-13T09:20:36.030Z
Learning: fjordllc/bootcamp プロジェクトでは、データの整合性を保つためのデータ修正には data-migrate gem を使用し、db/data/ ディレクトリ配下にデータマイグレーションファイルを作成する運用を採用している。スキーマ変更(db/migrate/)とデータ変更(db/data/)を分離することで、より安全で管理しやすい構成を実現している。
Applied to files:
Gemfile
📚 Learning: 2025-09-04T01:50:47.773Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/migrate/20250831234516_remove_unique_index_from_buzzes_title.rb:1-5
Timestamp: 2025-09-04T01:50:47.773Z
Learning: fjordllc/bootcampプロジェクトでは、マイグレーションにおいてdisable_ddl_transaction!やalgorithm: :concurrentlyは使用せず、標準的なRailsのchangeメソッド内でremove_indexを実行する慣例がある。
Applied to files:
Gemfile
📚 Learning: 2025-07-07T05:28:03.676Z
Learnt from: su-su-su-su
Repo: fjordllc/bootcamp PR: 0
File: :0-0
Timestamp: 2025-07-07T05:28:03.676Z
Learning: fjordllc/bootcampプロジェクトでは、fixtureファイル内のERB構文で改行制御文字(-)は使用せず、標準的な<% %>と<%= %>のみを使用する方針が統一されている。<% -%>や<%- %>を使用するとSyntaxErrorが発生する。
Applied to files:
Gemfile
📚 Learning: 2025-11-17T00:46:30.794Z
Learnt from: tyrrell-IH
Repo: fjordllc/bootcamp PR: 9306
File: app/javascript/components/Bookmarks.jsx:248-265
Timestamp: 2025-11-17T00:46:30.794Z
Learning: fjordllc/bootcamp プロジェクトでは、Reactからバニラ JavaScript への移行作業が進行中である。そのため、新しいReactファイルの作成は避け、既存のReactコンポーネント内で完結する実装が推奨される。BookmarksInDashboard.jsx は issue #9045 で削除予定。
Applied to files:
Gemfile
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to test/**/*_test.rb : Use Minitest + Capybara for system tests; place unit and integration tests under matching `test/*` directories
Applied to files:
Gemfile
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to test/**/*_test.rb : Test suite should use Minitest with structure: `system/`, `models/`, `controllers/`, and fixtures in `test/fixtures/`; test files should be named `*_test.rb`
Applied to files:
Gemfile
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to test/** : Keep tests deterministic and use fixtures stored in `test/fixtures/` for test data
Applied to files:
Gemfile
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build_and_test
🔇 Additional comments (2)
Gemfile (2)
106-106: LGTM! Ruby 3.5 対応のための benchmark gem 追加。コミットメッセージに記載の通り、rubocop 実行時の警告解消のための追加です。
require: falseにより明示的に require するまで読み込まれないため、影響は最小限です。
10-10:image_processingの制約~> 1.2は Rails 8.1.1 で適切です。Rails 8.1.1 は
image_processingの特定バージョンを要求せず、現在の 1.x リリースであれば対応します。Gemfile.lock で実際に解決されているバージョンは 1.14.0 であり、制約~> 1.2の範囲内で問題なく機能しています。このバージョン指定に懸念はありません。
f6d583d to
19800ce
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
config/environments/production.rb (1)
90-108: 本番環境の起動を破壊する可能性:config.hostsへの nil 追加を防いでくださいLine 108 で
app_host_nameを無条件にconfig.hostsへ追加していますが、SECRET_KEY_BASE == "dummy"の場合(アセットプリコンパイル時を想定)、Lines 92-96 の検証がスキップされapp_host_nameがnilのままです。これにより nil がconfig.hostsに追加され、予期しない動作を引き起こす可能性があります。🔎 修正案
config.hosts << ENV["CLOUD_RUN_HOST_NAME"] if ENV["CLOUD_RUN_HOST_NAME"] - config.hosts << app_host_name + config.hosts << app_host_name if app_host_name.present?追加の懸念点:
SECRET_KEY_BASE == "dummy"チェックによるアセットプリコンパイル検出は脆弱です。Rails 8.1 ではRails.env.production?と組み合わせた明示的な環境変数(例:SKIP_HOST_VALIDATION)を使用する方が安全かもしれません。
♻️ Duplicate comments (7)
test/system/works_test.rb (1)
79-79: テストの一貫性について過去の指摘が未解決です58-64行目の「destroy my work」テストと74-81行目の「admin can destroy a work」テストは、どちらも同じ
work1(kimuraユーザーの唯一の作品)を削除しています。削除後のページ状態は同一のはずですが、管理者テストにのみ空状態メッセージ「作品はまだありません。」のアサーションが追加されています。両テストで一貫性を保つため、以下のいずれかを検討してください:
- 「destroy my work」テストにも同じ空状態メッセージのアサーションを追加する
- 管理者テストのみこのアサーションを行う明確な理由を文書化する
public/406-unsupported-browser.html (1)
108-114: CSSネスティングの互換性問題(既報)このCSSネスティング構文は過去のレビューで既に指摘されています。古いブラウザでは動作しない可能性がありますが、影響は
<br>の表示切り替えのみです。public/422.html (1)
1-135: エラーページの統一された実装。422エラーページも500エラーページと同じ構造とスタイルで実装されており、一貫性が保たれています。言語変更に関する懸念はpublic/500.htmlのレビューコメントを参照してください。
public/404.html (1)
1-135: エラーページの一貫性を確認。404エラーページも他のエラーページ(500.html、422.html)と同じモダンな構造で実装されており、優れた一貫性を保っています。言語変更の懸念はpublic/500.htmlのレビューコメントを参照してください。
config/ci.rb (1)
8-8: bin/importmap が存在しないため CI ステップが失敗する以前のレビューコメントで指摘された通り、
bin/importmapスクリプトが存在しないため、このステップは実行時に失敗します。importmapを使用する場合は適切にセットアップするか、使用しない場合はこのステップを削除してください。Gemfile (1)
37-38: ジョブ基盤の移行について。既に過去のレビューで指摘されていますが、GoodJob から SolidQueue/MissionControl への移行は大規模なインフラ変更です。Rails アップグレードと同時に行う場合は、問題発生時の切り分けが困難になる可能性があります。
PR 説明に移行計画やロールバック手順が記載されていることを確認してください。
config/environments/production.rb (1)
49-50: キャッシュストア設定とコメントの矛盾この問題は過去のレビューコメントで既に指摘されています。
🧹 Nitpick comments (4)
test/system/products/wip_test.rb (1)
112-121: LGTM! UI フィードバックの検証が適切です。WIP提出物を「提出する」ボタンで送信した後、レビュー予定メッセージが表示されることを検証しており、Rails アップグレード後の UI 動作確認として適切です。部分文字列マッチを使用することで、メッセージの細かな文言変更に対して柔軟なテストになっています。
任意の改善案: 明示的な待機パラメータの追加
このファイル内の他のアサーション(84行目、89行目)では明示的に
wait:パラメータを指定しています。システムテストの安定性を高めるため、118行目にも追加を検討できます:assert_text '6日以内にメンターがレビューしますので', wait: 10ただし、Capybara はデフォルトで待機処理を行うため、必須ではありません。
db/migrate/20260104051945_drop_good_job_tables.rb (1)
3-14: GoodJob テーブル削除マイグレーションを承認します。
if_exists: trueにより、テーブルが存在しない場合でも安全に実行できます。IrreversibleMigrationの使用は、gem 固有のスキーマを手動で再作成することが困難なため適切です。デプロイメント時の注意点:
- SolidQueue テーブル作成マイグレーション(
20260104051844_create_solid_queue_tables.rb)が先に実行されることを確認してください。- 本番環境では、GoodJob のジョブが完全に処理されてからこのマイグレーションを実行することを推奨します。
bin/rails-test-all-with-report (1)
28-29: trap 文のクォーティングを改善してください。現在の実装では、
$TEST_OUTPUTが trap 設定時に展開されます。trap コマンド内で変数を使用する場合、シングルクォートを使用し、変数参照をダブルクォートで囲むことで、スクリプトの堅牢性が向上します。🔎 推奨される修正
TEST_OUTPUT=$(mktemp) -trap "rm -f $TEST_OUTPUT" EXIT +trap 'rm -f "$TEST_OUTPUT"' EXITconfig/environments/production.rb (1)
60-62: プレースホルダー値 "example.com" を削除してくださいLine 61 でハードコーディングされた
"example.com"は、Lines 99 でAPP_HOST_NAMEにより即座に上書きされるため無意味です。混乱を避けるため、この設定行を削除するか、コメントアウトしてください。🔎 修正案
- # Set host to be used by links generated in mailer templates. - config.action_mailer.default_url_options = { host: "example.com" } - + # Set host to be used by links generated in mailer templates. + # (Configured below using APP_HOST_NAME environment variable) +
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
Gemfile.lockis excluded by!**/*.lockpublic/icon.pngis excluded by!**/*.pngpublic/icon.svgis excluded by!**/*.svg
📒 Files selected for processing (67)
Gemfileapp/models/discord/server.rbapp/models/discord/times_category.rbapp/models/report_exporter.rbapp/models/user.rbbin/cibin/claude-system-testbin/devbin/jobsbin/rails-test-all-with-reportbin/rubocopbin/setupconfig/ci.rbconfig/environments/development.rbconfig/environments/production.rbconfig/environments/test.rbconfig/initializers/assets.rbconfig/initializers/content_security_policy.rbconfig/initializers/discord.rbconfig/initializers/filter_parameter_logging.rbconfig/initializers/good_job.rbconfig/initializers/mission_control.rbconfig/initializers/new_framework_defaults_8_1.rbconfig/puma.rbconfig/queue.ymlconfig/recurring.ymlconfig/routes.rbdb/migrate/20250828192201_create_good_jobs.rbdb/migrate/20260104051844_create_solid_queue_tables.rbdb/migrate/20260104051945_drop_good_job_tables.rbdb/schema.rbpublic/400.htmlpublic/404.htmlpublic/406-unsupported-browser.htmlpublic/422.htmlpublic/500.htmltest/fixtures/users.ymltest/models/discord_driver_test.rbtest/supports/mention_helper.rbtest/system/admin/users_test.rbtest/system/corporate_training_inquiry_system_test.rbtest/system/events/crud_test.rbtest/system/events/wip_test.rbtest/system/home/events_test.rbtest/system/markdown_test.rbtest/system/mentor/courses_test.rbtest/system/notification/mention_test.rbtest/system/notification/products_test.rbtest/system/notification/questions_test.rbtest/system/notifications/pagination_test.rbtest/system/notifications_bell_test.rbtest/system/pages/notification_test.rbtest/system/practice/not_logged_in_test.rbtest/system/practices/mentor_test.rbtest/system/practices/summary_test.rbtest/system/product/unchecked_test.rbtest/system/products/wip_test.rbtest/system/questions/wip_test.rbtest/system/questions_test.rbtest/system/regular_events/announcement_test.rbtest/system/regular_events/crud_test.rbtest/system/regular_events/participation_test.rbtest/system/reports/notification_test.rbtest/system/reset_password_test.rbtest/system/users/profile_test.rbtest/system/works_test.rbtest/test_helper.rb
💤 Files with no reviewable changes (3)
- config/initializers/good_job.rb
- config/environments/test.rb
- db/migrate/20250828192201_create_good_jobs.rb
🚧 Files skipped from review as they are similar to previous changes (35)
- test/system/mentor/courses_test.rb
- config/initializers/filter_parameter_logging.rb
- config/initializers/mission_control.rb
- config/recurring.yml
- test/system/product/unchecked_test.rb
- test/system/events/crud_test.rb
- test/system/markdown_test.rb
- config/puma.rb
- test/system/questions_test.rb
- bin/claude-system-test
- test/system/corporate_training_inquiry_system_test.rb
- app/models/discord/server.rb
- test/system/reset_password_test.rb
- public/400.html
- test/system/users/profile_test.rb
- test/system/reports/notification_test.rb
- test/system/notifications/pagination_test.rb
- config/initializers/content_security_policy.rb
- test/system/notification/products_test.rb
- test/system/regular_events/crud_test.rb
- test/system/notification/mention_test.rb
- config/queue.yml
- app/models/user.rb
- test/system/regular_events/announcement_test.rb
- config/routes.rb
- config/initializers/new_framework_defaults_8_1.rb
- test/system/home/events_test.rb
- test/fixtures/users.yml
- bin/ci
- test/system/notification/questions_test.rb
- bin/rubocop
- test/system/practice/not_logged_in_test.rb
- test/models/discord_driver_test.rb
- config/initializers/assets.rb
- test/system/questions/wip_test.rb
🧰 Additional context used
📓 Path-based instructions (7)
test/**/*_test.rb
📄 CodeRabbit inference engine (AGENTS.md)
test/**/*_test.rb: Test suite should use Minitest with structure:system/,models/,controllers/, and fixtures intest/fixtures/; test files should be named*_test.rb
Use Minitest + Capybara for system tests; place unit and integration tests under matchingtest/*directories
Files:
test/system/practices/summary_test.rbtest/system/regular_events/participation_test.rbtest/system/practices/mentor_test.rbtest/system/products/wip_test.rbtest/system/events/wip_test.rbtest/system/admin/users_test.rbtest/system/pages/notification_test.rbtest/system/works_test.rbtest/system/notifications_bell_test.rb
**/*.rb
📄 CodeRabbit inference engine (AGENTS.md)
Ruby code should use 2-space indentation, snake_case for method names, and CamelCase for class names, enforced by RuboCop (
.rubocop.yml)
Files:
test/system/practices/summary_test.rbdb/migrate/20260104051844_create_solid_queue_tables.rbapp/models/report_exporter.rbconfig/initializers/discord.rbtest/system/regular_events/participation_test.rbtest/system/practices/mentor_test.rbtest/system/products/wip_test.rbtest/test_helper.rbtest/system/events/wip_test.rbdb/migrate/20260104051945_drop_good_job_tables.rbconfig/ci.rbtest/system/admin/users_test.rbtest/system/pages/notification_test.rbtest/system/works_test.rbconfig/environments/production.rbdb/schema.rbtest/system/notifications_bell_test.rbconfig/environments/development.rbtest/supports/mention_helper.rbapp/models/discord/times_category.rb
⚙️ CodeRabbit configuration file
**/*.rb: # refactoring
- まずFat Controllerを避け、次にFat Modelを避ける。
- Serviceクラスの乱用を避ける。
- controller concernを作ろうとしたらPORO(Plain Old Ruby Object)やActiveRecordモデルでの実装で代替できないか検討する。
Rails Patterns
- ViewHelperにメソッドを実装する時にはまずDecoratorパターンを使うことを検討する。(active_decorator gemを導入しているのでそれを使う)
- 複雑なActiveRecordクエリがあり、再利用できそうな場合はQueryObjectパターンを検討する。(rails-patterns gemを導入しているのでそれのQuery機能を使う)
- Viewにpartialを作る場合はViewComponentを使うことを検討する。
- 複数のActiveRecordモデルを操作する1つの責務がある時や外部APIとやりとりする処理がある場合にはInteractorオブジェクトパターンを検討する。(interactor gemを導入しているのでそれを使う)
- 複数のInteractorを実行するような処理がある場合Organizerオブジェクトパターンを検討する。(interactor gemを導入しており、その中にOrganizerの機能があるので使う)
Files:
test/system/practices/summary_test.rbdb/migrate/20260104051844_create_solid_queue_tables.rbapp/models/report_exporter.rbconfig/initializers/discord.rbtest/system/regular_events/participation_test.rbtest/system/practices/mentor_test.rbtest/system/products/wip_test.rbtest/test_helper.rbtest/system/events/wip_test.rbdb/migrate/20260104051945_drop_good_job_tables.rbconfig/ci.rbtest/system/admin/users_test.rbtest/system/pages/notification_test.rbtest/system/works_test.rbconfig/environments/production.rbdb/schema.rbtest/system/notifications_bell_test.rbconfig/environments/development.rbtest/supports/mention_helper.rbapp/models/discord/times_category.rb
test/**
📄 CodeRabbit inference engine (AGENTS.md)
Keep tests deterministic and use fixtures stored in
test/fixtures/for test data
Files:
test/system/practices/summary_test.rbtest/system/regular_events/participation_test.rbtest/system/practices/mentor_test.rbtest/system/products/wip_test.rbtest/test_helper.rbtest/system/events/wip_test.rbtest/system/admin/users_test.rbtest/system/pages/notification_test.rbtest/system/works_test.rbtest/system/notifications_bell_test.rbtest/supports/mention_helper.rb
test/**/*
⚙️ CodeRabbit configuration file
test/**/*: # Test
- TestCase名は英語で書く。
- どうしても避けられない時以外にsystem testでsleepは使わない。
Unit Test
model, helper, decorator, view_componentについてはメソッドを追加した場合は必ず対応したUnit TestのTestCaseを1つは書く。
Files:
test/system/practices/summary_test.rbtest/system/regular_events/participation_test.rbtest/system/practices/mentor_test.rbtest/system/products/wip_test.rbtest/test_helper.rbtest/system/events/wip_test.rbtest/system/admin/users_test.rbtest/system/pages/notification_test.rbtest/system/works_test.rbtest/system/notifications_bell_test.rbtest/supports/mention_helper.rb
db/**
📄 CodeRabbit inference engine (AGENTS.md)
Database migrations and schema should be stored in
db/directory; app-specific utilities inlib/; static assets inpublic/
Files:
db/migrate/20260104051844_create_solid_queue_tables.rbdb/migrate/20260104051945_drop_good_job_tables.rbdb/schema.rb
app/**/*.{rb,js,ts,jsx,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Rails app code should be organized in
app/directory with subdirectories:models/,controllers/,views/,jobs/,helpers/, and frontend code underjavascript/(Shakapacker)
Files:
app/models/report_exporter.rbapp/models/discord/times_category.rb
config/**
📄 CodeRabbit inference engine (AGENTS.md)
Configuration files in
config/should include environment settings, routes, and lints (.rubocop.yml,config/slim_lint.yml)
Files:
config/initializers/discord.rbconfig/ci.rbconfig/environments/production.rbconfig/environments/development.rb
🧠 Learnings (37)
📓 Common learnings
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/product.rb:59-61
Timestamp: 2025-09-11T14:47:53.256Z
Learning: Rails アップグレードPRでは、アップグレードに直接関連しない性能改善や機能追加の提案は避けるべき。PRのスコープを維持することが重要で、そのような改善提案は別PRで対応すべきである。
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9115
File: db/migrate/20250902024949_add_unique_index_to_correct_answers.rb:1-5
Timestamp: 2025-11-13T09:20:36.030Z
Learning: fjordllc/bootcamp プロジェクトでは、データの整合性を保つためのデータ修正には data-migrate gem を使用し、db/data/ ディレクトリ配下にデータマイグレーションファイルを作成する運用を採用している。スキーマ変更(db/migrate/)とデータ変更(db/data/)を分離することで、より安全で管理しやすい構成を実現している。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:52-56
Timestamp: 2025-09-12T21:17:45.295Z
Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: config/initializers/sorcery.rb:0-0
Timestamp: 2025-09-11T16:02:24.782Z
Learning: Rails アップグレードPRにおいて、JWT設定の改善では複数のソース(secrets, credentials, ENV)を優先順位付きで検索し、本番環境では未設定時に起動を停止させる実装が推奨される。開発・テスト環境でのみsecret_key_baseフォールバックを許可する構成が安全である。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/migrate/20250831234516_remove_unique_index_from_buzzes_title.rb:1-5
Timestamp: 2025-09-04T01:50:47.773Z
Learning: fjordllc/bootcampプロジェクトでは、マイグレーションにおいてdisable_ddl_transaction!やalgorithm: :concurrentlyは使用せず、標準的なRailsのchangeメソッド内でremove_indexを実行する慣例がある。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: app/controllers/mentor/buzzes_controller.rb:0-0
Timestamp: 2025-09-04T01:39:22.261Z
Learning: fjordllc/bootcamp プロジェクトでは、更新処理の成功時の通知メッセージについて、I18n を使用せずに日本語文字列を直接記述する方針で一貫性を保っている。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:19-23
Timestamp: 2025-09-12T21:17:26.029Z
Learning: Rails アップグレードPRにおいて、config_for(:secrets) を使った webhook URL 設定の shared セクション未参照問題は、設定システム全体の変更として別PRで対応すべきである。
Learnt from: hirokiej
Repo: fjordllc/bootcamp PR: 8740
File: app/helpers/reports_helper.rb:56-64
Timestamp: 2025-06-29T03:44:15.179Z
Learning: このプロジェクト(fjordllc/bootcamp)では、ja.ymlファイルで一部の単語や文章のみI18n対応されているが、多くのテキストは日本語でハードコーディングされており、完全な国際化対応は行われていない。新しい機能でもI18n対応は不要と判断される。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: db/migrate/20250828192202_add_missing_columns_to_good_jobs.rb:4-10
Timestamp: 2025-09-11T14:18:20.194Z
Learning: GoodJobやその他の外部gemが生成するマイグレーションファイルは、gem内部のロジックと密接に連携しているため、null制約やデフォルト値の追加などの変更を行うべきではない。gemのアップグレードパスに従い、生成されたマイグレーションをそのまま使用することが適切。
Learnt from: mousu-a
Repo: fjordllc/bootcamp PR: 8566
File: db/migrate/20250830033535_add_default_to_pair_works_wip.rb:1-5
Timestamp: 2025-08-31T03:17:44.812Z
Learning: 新機能のマイグレーションで、まだ本番環境にリリースされていない場合は、既存レコードのバックフィル処理は不要。開発環境でrails db:resetが可能な状況では特に、デフォルト値の変更のみで十分。
📚 Learning: 2025-09-12T21:18:00.834Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Applied to files:
test/system/practices/summary_test.rbtest/system/products/wip_test.rbGemfileconfig/environments/production.rb
📚 Learning: 2025-09-12T01:00:58.452Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: app/views/mentor/buzzes/edit.html.slim:1-0
Timestamp: 2025-09-12T01:00:58.452Z
Learning: app/views/mentor/buzzes/edit.html.slim では `- title` と `- set_meta_tags` の両方が正しく設定されており、タイトルは削除されていない。変更内容はメタディスクリプションの追加のみ。
Applied to files:
test/system/practices/summary_test.rbtest/system/practices/mentor_test.rb
📚 Learning: 2025-10-22T06:04:36.036Z
Learnt from: sjabcdefin
Repo: fjordllc/bootcamp PR: 9247
File: app/controllers/checks_controller.rb:0-0
Timestamp: 2025-10-22T06:04:36.036Z
Learning: ChecksController#createおよび#destroyでは、Checkの作成・削除とActiveSupport::Notifications.instrumentによるイベント発行(プラクティスのステータス更新)を同一トランザクション内で実行し、いずれかが失敗した場合は両方をロールバックする。これによりWebUI表示とDB状態の整合性を保証している。
Applied to files:
test/system/regular_events/participation_test.rbtest/system/events/wip_test.rbtest/system/pages/notification_test.rbtest/system/works_test.rb
📚 Learning: 2025-08-31T23:39:23.210Z
Learnt from: mousu-a
Repo: fjordllc/bootcamp PR: 8566
File: app/views/pair_works/_body.html.slim:111-117
Timestamp: 2025-08-31T23:39:23.210Z
Learning: PairWorkモデルにreserved_at_in_schedules?カスタムバリデーション(on: :update)が実装されており、reserved_atが必ずschedules.map(&:proposed_at)に含まれることを検証している。これにより、フォームから任意の日時を送信することを防いでいる。
Applied to files:
test/system/regular_events/participation_test.rbtest/system/events/wip_test.rbtest/system/admin/users_test.rb
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to test/**/*_test.rb : Use Minitest + Capybara for system tests; place unit and integration tests under matching `test/*` directories
Applied to files:
test/test_helper.rbconfig/ci.rbGemfilebin/setupbin/rails-test-all-with-report
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to test/**/*_test.rb : Test suite should use Minitest with structure: `system/`, `models/`, `controllers/`, and fixtures in `test/fixtures/`; test files should be named `*_test.rb`
Applied to files:
test/test_helper.rbGemfilebin/rails-test-all-with-report
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to test/** : Keep tests deterministic and use fixtures stored in `test/fixtures/` for test data
Applied to files:
test/test_helper.rbGemfile
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Use `bin/setup` for local database setup and dependency installation; avoid manual tweaks in `config/` without team discussion
Applied to files:
test/test_helper.rbconfig/ci.rbbin/devconfig/environments/production.rbbin/setupconfig/environments/development.rb
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: All linters must pass (`bin/lint` command) and CI (CircleCI) must be green before merging; add or adjust tests when changing behavior
Applied to files:
test/test_helper.rbconfig/ci.rb
📚 Learning: 2025-09-11T14:18:20.194Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: db/migrate/20250828192202_add_missing_columns_to_good_jobs.rb:4-10
Timestamp: 2025-09-11T14:18:20.194Z
Learning: GoodJobやその他の外部gemが生成するマイグレーションファイルは、gem内部のロジックと密接に連携しているため、null制約やデフォルト値の追加などの変更を行うべきではない。gemのアップグレードパスに従い、生成されたマイグレーションをそのまま使用することが適切。
Applied to files:
db/migrate/20260104051945_drop_good_job_tables.rbGemfile
📚 Learning: 2025-09-08T04:55:46.649Z
Learnt from: sharoa119
Repo: fjordllc/bootcamp PR: 8711
File: db/schema.rb:0-0
Timestamp: 2025-09-08T04:55:46.649Z
Learning: In this PR, the removal of length limits from companies.name and companies.website columns in db/schema.rb was unintentional - it was a case of accidentally lost constraints that needed to be restored to their original limits, not a deliberate design change.
Applied to files:
db/migrate/20260104051945_drop_good_job_tables.rbdb/schema.rb
📚 Learning: 2025-09-04T01:50:47.773Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/migrate/20250831234516_remove_unique_index_from_buzzes_title.rb:1-5
Timestamp: 2025-09-04T01:50:47.773Z
Learning: fjordllc/bootcampプロジェクトでは、マイグレーションにおいてdisable_ddl_transaction!やalgorithm: :concurrentlyは使用せず、標準的なRailsのchangeメソッド内でremove_indexを実行する慣例がある。
Applied to files:
db/migrate/20260104051945_drop_good_job_tables.rbGemfile
📚 Learning: 2025-09-12T21:17:26.029Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:19-23
Timestamp: 2025-09-12T21:17:26.029Z
Learning: Rails アップグレードPRにおいて、config_for(:secrets) を使った webhook URL 設定の shared セクション未参照問題は、設定システム全体の変更として別PRで対応すべきである。
Applied to files:
config/ci.rbGemfileconfig/environments/production.rb
📚 Learning: 2025-11-13T09:20:36.030Z
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9115
File: db/migrate/20250902024949_add_unique_index_to_correct_answers.rb:1-5
Timestamp: 2025-11-13T09:20:36.030Z
Learning: fjordllc/bootcamp プロジェクトでは、データの整合性を保つためのデータ修正には data-migrate gem を使用し、db/data/ ディレクトリ配下にデータマイグレーションファイルを作成する運用を採用している。スキーマ変更(db/migrate/)とデータ変更(db/data/)を分離することで、より安全で管理しやすい構成を実現している。
Applied to files:
config/ci.rbGemfile
📚 Learning: 2025-09-11T16:02:24.782Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: config/initializers/sorcery.rb:0-0
Timestamp: 2025-09-11T16:02:24.782Z
Learning: Rails アップグレードPRにおいて、JWT設定の改善では複数のソース(secrets, credentials, ENV)を優先順位付きで検索し、本番環境では未設定時に起動を停止させる実装が推奨される。開発・テスト環境でのみsecret_key_baseフォールバックを許可する構成が安全である。
Applied to files:
config/ci.rbGemfileconfig/environments/production.rbconfig/environments/development.rb
📚 Learning: 2025-09-12T12:53:17.172Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: public/500.html:2-64
Timestamp: 2025-09-12T12:53:17.172Z
Learning: エラーページ(404.html、422.html、500.html)について不正確な提案をした場合は、実際のファイル内容を確認してから回答すべき。これらのファイルは既に統一されており、追加のメタタグは不要だった。
Applied to files:
public/500.htmlpublic/422.htmlpublic/404.html
📚 Learning: 2025-09-01T22:31:57.345Z
Learnt from: matuaya
Repo: fjordllc/bootcamp PR: 9108
File: app/models/after_user_retirement.rb:0-0
Timestamp: 2025-09-01T22:31:57.345Z
Learning: fjordllc/bootcampプロジェクトにおいて、`Newspaper.publish(:retirement_create, { user: user })`はUnfinishedDataDestroyer(未チェックProduct・WIP Report削除、career_pathリセット)とTimesChannelDestroyer(Discord分報チャンネル削除)による重要なデータクリーンアップ処理を実行するため、退会のトリガーが何であろうと(admin、hibernation、user)必ず実行する必要がある。
Applied to files:
test/system/admin/users_test.rbtest/system/pages/notification_test.rbtest/system/works_test.rb
📚 Learning: 2025-09-01T22:31:57.345Z
Learnt from: matuaya
Repo: fjordllc/bootcamp PR: 9108
File: app/models/after_user_retirement.rb:0-0
Timestamp: 2025-09-01T22:31:57.345Z
Learning: fjordllc/bootcampプロジェクトにおいて、`Newspaper.publish(:retirement_create, { user: user })`は通知処理ではなく、UnfinishedDataDestroyerやTimesChannelDestroyer等による重要なデータクリーンアップ処理を実行するため、管理者による退会(triggered_by: 'admin')の場合でも必ず実行する必要がある。
Applied to files:
test/system/admin/users_test.rbtest/system/pages/notification_test.rbtest/system/works_test.rb
📚 Learning: 2025-08-31T12:08:33.904Z
Learnt from: thmz337
Repo: fjordllc/bootcamp PR: 9103
File: app/views/generations/_user.html.slim:6-14
Timestamp: 2025-08-31T12:08:33.904Z
Learning: app/views/generations/_user.html.slimの非アクティブメッセージ表示では、退会・休会・非アクティブの3つの条件が独立して評価され、複数のメッセージが同時に表示される仕様になっている。これは意図的な設計である。
Applied to files:
test/system/admin/users_test.rb
📚 Learning: 2025-07-15T12:33:04.885Z
Learnt from: reckyy
Repo: fjordllc/bootcamp PR: 8356
File: db/fixtures/users.yml:823-826
Timestamp: 2025-07-15T12:33:04.885Z
Learning: fjordllc/bootcampプロジェクトでは、`trainee: true`は「研修に所属していたユーザー」全体を示すフラグであり、研修中のユーザーと研修を終了したユーザーの両方を含む。そのため、`trainee: true`と`training_completed_at`の併存は意図された仕様であり、排他的な関係ではない。
Applied to files:
test/system/admin/users_test.rb
📚 Learning: 2025-09-04T01:27:23.422Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/fixtures/buzzes.yml:0-0
Timestamp: 2025-09-04T01:27:23.422Z
Learning: The buzz_controller.rb was indeed deleted, but there are still two remaining items from the old buzz single page implementation that need cleanup: the data migration file db/data/20230726024528_create_buzz.rb and the old buzz route in config/routes.rb line 136. These should be updated/removed to complete the buzz page redesign migration.
Applied to files:
test/system/pages/notification_test.rbdb/schema.rb
📚 Learning: 2025-07-15T12:58:02.735Z
Learnt from: reckyy
Repo: fjordllc/bootcamp PR: 8356
File: app/models/notification.rb:45-47
Timestamp: 2025-07-15T12:58:02.735Z
Learning: fjordllc/bootcampプロジェクトの`app/models/notification.rb`において、`training_completed`通知種別は`TARGETS_TO_KINDS`ハッシュに含めない設計になっている。これは`training_completed`が通知一覧のフィルタ対象ではないためで、意図的な設計判断である。
Applied to files:
test/system/pages/notification_test.rbtest/system/notifications_bell_test.rb
📚 Learning: 2025-09-11T14:47:53.256Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/product.rb:59-61
Timestamp: 2025-09-11T14:47:53.256Z
Learning: Rails アップグレードPRでは、アップグレードに直接関連しない性能改善や機能追加の提案は避けるべき。PRのスコープを維持することが重要で、そのような改善提案は別PRで対応すべきである。
Applied to files:
Gemfile
📚 Learning: 2025-09-12T21:16:47.639Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Applied to files:
Gemfileconfig/environments/production.rb
📚 Learning: 2025-09-12T21:17:45.295Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:52-56
Timestamp: 2025-09-12T21:17:45.295Z
Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Applied to files:
Gemfileconfig/environments/production.rbconfig/environments/development.rb
📚 Learning: 2025-07-07T05:28:03.676Z
Learnt from: su-su-su-su
Repo: fjordllc/bootcamp PR: 0
File: :0-0
Timestamp: 2025-07-07T05:28:03.676Z
Learning: fjordllc/bootcampプロジェクトでは、fixtureファイル内のERB構文で改行制御文字(-)は使用せず、標準的な<% %>と<%= %>のみを使用する方針が統一されている。<% -%>や<%- %>を使用するとSyntaxErrorが発生する。
Applied to files:
Gemfileconfig/environments/production.rb
📚 Learning: 2025-11-17T00:46:30.794Z
Learnt from: tyrrell-IH
Repo: fjordllc/bootcamp PR: 9306
File: app/javascript/components/Bookmarks.jsx:248-265
Timestamp: 2025-11-17T00:46:30.794Z
Learning: fjordllc/bootcamp プロジェクトでは、Reactからバニラ JavaScript への移行作業が進行中である。そのため、新しいReactファイルの作成は避け、既存のReactコンポーネント内で完結する実装が推奨される。BookmarksInDashboard.jsx は issue #9045 で削除予定。
Applied to files:
Gemfile
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Pull requests should include clear description, linked issues, screenshots for UI changes, migration notes, and rollback plan if relevant
Applied to files:
Gemfile
📚 Learning: 2025-07-23T21:11:21.826Z
Learnt from: jun-kondo
Repo: fjordllc/bootcamp PR: 0
File: :0-0
Timestamp: 2025-07-23T21:11:21.826Z
Learning: fjordllc/bootcampプロジェクトの`app/models/work_notification_destroyer.rb`において、このクラスは`app/controllers/works_controller.rb`の`destroy`アクションから呼び出され、`before_action :set_my_work`でIDの妥当性チェックが事前に行われるため、payloadのworkオブジェクトは常に有効であることが保証されている。そのためエラーハンドリングは不要。
Applied to files:
test/system/works_test.rb
📚 Learning: 2025-08-31T03:39:07.792Z
Learnt from: mousu-a
Repo: fjordllc/bootcamp PR: 8566
File: app/views/pair_works/_body.html.slim:85-85
Timestamp: 2025-08-31T03:39:07.792Z
Learning: app/views/pair_works/_body.html.slimテンプレートには2つの独立したif pair_work.solved?条件分岐があり、user変数は最初の分岐でのみ設定されるため、2番目の分岐での参照には注意が必要。
Applied to files:
test/system/works_test.rb
📚 Learning: 2025-07-10T12:59:27.807Z
Learnt from: kitarou888
Repo: fjordllc/bootcamp PR: 8277
File: test/models/searcher_test.rb:326-331
Timestamp: 2025-07-10T12:59:27.807Z
Learning: モデルテストにおいて、1つのクラスメソッドの複数の挙動を検証する場合、機能の異なる側面を同じテストメソッドでテストすることは、包括的なテストとして適切である。特に`only_me`のような機能では、異なる検索条件(空文字と具体的な検索語)を使い分けることで、より広範囲な動作保証が可能となる。
Applied to files:
test/system/works_test.rb
📚 Learning: 2025-08-28T00:34:28.541Z
Learnt from: mousu-a
Repo: fjordllc/bootcamp PR: 8566
File: app/views/application/_global_nav.slim:48-54
Timestamp: 2025-08-28T00:34:28.541Z
Learning: app/views/application/_global_nav.slim のQ&A/ペアワークバッジの環境分岐は、ペアワーク機能の本番リリース後に削除される一時的な実装である。その際、メンター・管理者のみに表示する制限仕様も撤廃される予定のため、現在の実装にはアクセス権限ガードを追加する必要がない。
Applied to files:
test/system/works_test.rb
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to config/** : Configuration files in `config/` should include environment settings, routes, and lints (`.rubocop.yml`, `config/slim_lint.yml`)
Applied to files:
config/environments/production.rbconfig/environments/development.rb
📚 Learning: 2025-09-05T03:16:53.387Z
Learnt from: sharoa119
Repo: fjordllc/bootcamp PR: 9012
File: app/queries/grass_learning_time_query.rb:30-37
Timestamp: 2025-09-05T03:16:53.387Z
Learning: reports テーブルには既に (user_id, reported_on) の一意制約インデックス index_reports_on_user_id_and_reported_on が存在するため、学習時間集計クエリのパフォーマンス最適化には追加のインデックスは不要。
Applied to files:
db/schema.rb
📚 Learning: 2025-07-23T21:11:21.826Z
Learnt from: jun-kondo
Repo: fjordllc/bootcamp PR: 0
File: :0-0
Timestamp: 2025-07-23T21:11:21.826Z
Learning: fjordllc/bootcampプロジェクトの`app/models/inquiry_notifier.rb`において、`NOTIFICATION_SENDER_NAME`で指定される管理者ユーザーは必ず存在することがシステムの前提条件として保証されているため、senderがnilになることは想定されておらず、エラーハンドリングは不要である。
Applied to files:
test/system/notifications_bell_test.rb
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to **/*.rb : Ruby code should use 2-space indentation, snake_case for method names, and CamelCase for class names, enforced by RuboCop (`.rubocop.yml`)
Applied to files:
config/environments/development.rb
🧬 Code graph analysis (1)
app/models/discord/times_category.rb (1)
app/models/discord/server.rb (1)
class_attribute(4-89)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build_and_test
🔇 Additional comments (34)
app/models/discord/times_category.rb (1)
5-5: Rails 8.1 対応の変更として適切です。
ActiveSupport::Configurableからclass_attributeへの移行は、Rails 8.2 での削除予定に対応した正しい変更です。instance_accessor: falseの指定により、クラスレベルでのアクセスのみに制限され、discord/server.rbのパターンとも一貫性があります。config/initializers/discord.rb (1)
6-13:class_attributeへの移行に対応した適切な初期化処理です。
configureブロックから直接代入への変更は、ActiveSupport::Configurableの非推奨化に対応した正しい実装です。Line 10 の条件分岐により、bot_tokenが存在しない場合に不正な "Bot " プレフィックスが設定されることを防いでいます。test/system/events/wip_test.rb (1)
19-22: テスト構造の改善を確認しました。成功メッセージのアサーションを
assert_differenceブロック内に移動することで、イベント作成のアクションとUIフィードバックの検証を同一の原子的な処理として扱えるようになっています。これにより、テストの凝集性が向上し、より堅牢なテストになっています。他のテストファイルでも同様のパターンが適用されており、一貫性も保たれています。test/system/admin/users_test.rb (3)
181-200: テスト更新が適切です退会処理のテストが Rails 8 に合わせて更新されています。主な変更点:
- Discord の times_id を事前に設定し、退会後にクリアされることを検証
- Stripe API 呼び出しを避けるために subscription_id と customer_id を事前にクリア(Line 186 のコメントで説明済み)
- VCR カセットの削除により、テストがシンプルに
update_columnsの使用はコールバックをバイパスしますが、テストコードでの外部 API 呼び出し回避という目的のため、コメント付きで明示されており適切です。
232-253: 卒業処理のテスト更新が適切ですRails 8 に対応して以下の変更が行われています:
- Stripe API を WebMock でスタブ化(Lines 236-239)
- Card.destroy_all をスタブでラップ
- サブスクリプションキャンセルが正しく呼び出されることを検証(Lines 250-252)
外部 API との統合を適切にテストしており、ビジネスロジック(卒業時の Stripe サブスクリプションキャンセル)の検証も維持されています。
315-323: 研修終了日更新テストの改善以下の改善が行われています:
- より具体的な要素選択(
find('#user_submit').click)により、Rails 8 での JavaScript ハンドリングに対応- 成功メッセージと保存値の両方を検証することで、テストの信頼性が向上
シンプルで効果的な変更です。
bin/jobs (1)
1-6: LGTM!SolidQueue CLIラッパーの実装は正しく、GoodJobからの移行に適切に対応しています。
bin/dev (1)
1-2: LGTM!開発サーバー起動スクリプトの実装はシンプルで適切です。
test/system/regular_events/participation_test.rb (2)
26-27: LGTM!
assert_differenceブロックの削除は、他のsystem testと一貫したパターンであり、Rails 8.1でのテスト動作に適合しています。
54-55: LGTM!こちらも同様のパターンで、一貫性があります。
app/models/report_exporter.rb (1)
19-19: rubyzip APIの変更は正しく互換性があります。rubyzip 3.2.2は
Zip::File.open(@zip_filename, create: true)のcreate:キーワード引数をサポートしており、旧来のZip::File::CREATE定数から新しいキーワード引数への変更は有効です。test/system/practices/summary_test.rb (1)
30-30: 更新成功メッセージの検証を追加。プラクティス更新後に成功メッセージが表示されることを確認するアサーションの追加は、テストの信頼性を向上させます。他のシステムテストでも同様のパターンが適用されており、一貫性があります。
test/system/notifications_bell_test.rb (1)
25-25: 通知テキストの存在確認を追加。既読にする前に通知が実際に表示されていることを確認するアサーションの追加により、テストがより堅牢になります。期待される状態を検証してからアクションを実行する良いパターンです。
public/500.html (1)
1-135: エラーページは日本語ユーザーをサポートすることを想定して実装すべき。これらのエラーページは新規作成で、すべて英語で統一されています。このプロジェクトは日本語テキストを主に使用しており、学習から国際化対応は行われていないとのことです。
英語のエラーメッセージはユーザーベースに対して適切か確認してください。プロジェクト全体の方針と一貫性があるか検討が必要です。
技術的実装(レスポンシブデザイン、ダークモード対応、セマンティックHTML、インラインSVG)は優れています。
Likely an incorrect or invalid review comment.
test/supports/mention_helper.rb (1)
14-14: LGTM - ログイン後のページ読み込み確認を追加ログイン後にダッシュボードのテキストを確認することで、ページが完全に読み込まれてから次の操作に進むことを保証しています。Rails 8へのアップグレードに伴うテストの安定性向上として適切な変更です。
Also applies to: 19-19
test/test_helper.rb (2)
22-26: LGTM - テストリトライの設定を環境変数で制御可能にCI環境のみでなく、ローカル環境でも
MINITEST_RETRY_COUNT環境変数を使ってリトライ回数を制御できるようになりました。柔軟性が向上し、Rails 8.1アップグレード後のテスト実行環境の改善として適切です。
31-35: LGTM - 並列テスト実行を環境変数で制御可能に
PARALLEL_WORKERS環境変数で並列実行数を制御でき、デフォルトは1(無効)に設定されています。コメントでRails issue #55513に言及し、ローカル環境での並列実行時の問題を明示している点も良いです。また、
MINITEST_RETRY_COUNT環境変数も同じファイル内で設定されており、両方の環境変数とも、READMEの使用例とコード内のコメントで適切にドキュメント化されています。test/system/pages/notification_test.rb (1)
7-18: LGTM - テスト名の簡潔化とログ検証の削除テスト名を簡潔にし、ログベースの検証を削除することで、テストの焦点が明確になっています。UI上の動作確認(成功メッセージやWatch状態)は維持されており、Rails 8.1アップグレードに伴うテストクリーンアップとして適切な変更です。
Also applies to: 20-27
config/ci.rb (2)
1-7: LGTM - CI パイプライン定義の追加ActiveSupport::ContinuousIntegrationのDSLを使用した新しいCIパイプライン定義です。セットアップ、スタイルチェック、テスト実行の各ステップが明確に定義されており、Rails 8.1で導入された新しいCI機能の活用として適切です。
Also applies to: 9-13
14-21: オプションのサインオフ機能についてGitHub CLIを使ったサインオフ機能がコメントアウトされており、必要に応じて有効化できる構成になっています。現時点では無効化されているため問題ありません。
bin/setup (2)
25-25: LGTM - オプションのデータベースリセット機能
--resetフラグによるデータベースリセット機能の追加は、開発環境のクリーンアップに便利です。オプション扱いのため既存のワークフローに影響を与えません。
30-34: LGTM - 開発サーバーの条件付き起動
--skip-serverフラグにより、CI環境などでサーバー起動をスキップできるようになりました。exec "bin/dev"を使用することで、プロセスを置き換えて起動する実装も適切です。config/ci.rbのbin/setup --skip-serverの呼び出しと連携しています。test/system/practices/mentor_test.rb (2)
97-101: テストの改善を確認しました。成功メッセージ
'プラクティスを更新しました。'のアサーション追加は、更新処理の完了確認として適切です。Line 99 の
visitについて:Line 92 でvisit_with_authを使用してログインセッションが確立されているため、同一テスト内での後続のvisitはセッションを維持します。Capybara のシステムテストでは、テスト内でセッションが保持されるため、この実装は正しく動作します。ただし、コードの可読性と意図の明確化のために、コメントを追加するか、
visit_with_authを使用することも検討できます。
113-118: フォーム入力処理の改善を承認します。
fill_options: { clear: :backspace }の追加により、既存の値を確実にクリアしてから新しい値を入力できます。click_button '更新する'をwithinブロックの外に移動したことで、フォーム内の操作と送信アクションが明確に分離されました。db/migrate/20260104051844_create_solid_queue_tables.rb (1)
3-137: SolidQueue テーブル作成マイグレーションを承認します。このマイグレーションは SolidQueue gem の標準的なスキーマ構造に従っています。Retrieved learnings に基づき、外部 gem が生成するマイグレーションファイルは gem 内部のロジックと密接に連携しているため、そのまま使用することが適切です。
主要なポイント:
- 適切なインデックス設計(ポーリング、フィルタリング、メンテナンス用)
on_delete: :cascadeによる適切な外部キー制約- 同時実行制御のためのセマフォテーブル
bin/rails-test-all-with-report (2)
1-86: テストレポート生成スクリプトの追加を承認します。スクリプト全体として、以下の点が適切に実装されています:
- 環境変数によるパラレルワーカー数とリトライ回数の設定
- 一時ファイルの適切なクリーンアップ
- 失敗テストコマンドの抽出と出力
- 成功・失敗時の明確なフィードバック
55-68: AWK パターンは既に適切な空白処理を実装しています。
/^[[:space:]]*(Failure|Error):$/のパターンは、[[:space:]]*で先頭の空白(ゼロ個以上)を既に処理しており、余分な空白に対応しています。Minitest の標準出力フォーマットは一貫性があり、現在の実装で適切に失敗ブロックをキャプチャできます。Likely an incorrect or invalid review comment.
config/environments/development.rb (2)
43-43: letter_opener_web の追加を承認します。開発環境でのメールプレビュー機能として適切な設定です。送信されたメールは
/letter_openerで確認できます。
92-93: SolidQueue の設定は適切に実装されています。設定が確認されました:
config/active_job.queue_adapter = :solid_queueでアダプタを設定config.solid_queue.connects_toでプライマリデータベースを指定config/queue.ymlが正しく設定され、ディスパッチャーとワーカーの設定が完備されているbin/jobsスクリプトが SolidQueue CLI を適切に起動Gemfile (2)
109-109: benchmark gem の追加を承認します。コミットメッセージによると、Ruby 3.5 対応のため rubocop 実行時の警告を解消するために追加されています。Ruby 3.4+ では benchmark が bundled gem に移行されたため、明示的な依存追加は適切です。
122-122: Minitest 6.0 は 2025 年 12 月 17 日にリリースされているため、記述を修正してください。現在の最新版は Minitest 6.0.1(2025 年 12 月 26 日リリース)です。したがって、
< 6.0の制約は実質的な意味を持ちます。ただし、Rails 8.1 と Minitest 6.x の互換性が検証されているか、または 5.x に固定することが意図的なのかを確認する必要があります。互換性が確認されている場合は、この制約の根拠をコメントで明記することを推奨します。Likely an incorrect or invalid review comment.
db/schema.rb (3)
13-16: Rails 8.1 スキーマフォーマットを承認します。
ActiveRecord::Schema[8.1]への更新は適切です。pg_catalog.plpgsqlの明示的な有効化は Rails 8.1 の新しいフォーマットに従っています。
754-873: SolidQueue テーブルのスキーマを確認しました。マイグレーションファイル
20260104051844_create_solid_queue_tables.rbと一致しています。インデックスと外部キー制約が適切に定義されています。
1136-1141: SolidQueue 外部キー制約を承認します。すべての SolidQueue 実行テーブルに
on_delete: :cascadeが設定されており、ジョブ削除時に関連する実行レコードが自動的にクリーンアップされます。これは SolidQueue の期待される動作です。
| # Replace the default in-process and non-durable queuing backend for Active Job. | ||
| config.active_job.queue_adapter = :solid_queue | ||
| config.solid_queue.connects_to = { database: { writing: :primary } } |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
Rails 8.1 SolidQueue connects_to configuration syntax official documentation
💡 Result:
The official syntax is:
config.solid_queue.connects_to = { database: { writing: :queue } }
(You can use any of the ActiveRecord multiple-database options — Solid Queue accepts the same connects_to/database mapping.) [1][2]
Sources:
- rails/solid_queue README (configuration section). [1]
- Rails Active Job guide (example showing config.solid_queue.connects_to). [2]
config.solid_queue.connects_to の設定値を修正してください
公式ドキュメント(Rails solid_queue README および Active Job ガイド)によると、正しい設定は以下の通りです:
config.solid_queue.connects_to = { database: { writing: :queue } }
現在のコードは writing: :primary となっていますが、これは :queue に修正する必要があります。この設定はSolidQueueが接続するデータベースを指定する重要な部分であり、不正な値を使用するとキューの処理に支障が出ます。
🤖 Prompt for AI Agents
In config/environments/production.rb around lines 52 to 54, the SolidQueue DB
mapping is incorrect: change the connects_to mapping from writing: :primary to
writing: :queue so SolidQueue connects to the correct database; update the line
to use writing: :queue (matching the Rails SolidQueue/Active Job docs) and
ensure the rest of the queue_adapter configuration remains unchanged.
f121242 to
2328d3f
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
Gemfile.lockis excluded by!**/*.lock
📒 Files selected for processing (14)
.cloudbuild/cloudbuild-staging.yaml.cloudbuild/cloudbuild.yaml.traceroute.ymlGemfileapp/jobs/ai_answer_create_job.rbapp/models/ai/answer_generator.rbapp/models/ai_answer_creator.rbconfig/ci.rbconfig/initializers/active_support_notifications.rbconfig/initializers/inflections.rbdb/schema.rbtest/jobs/ai_answer_create_job_test.rbtest/system/admin/users_test.rbtest/test_helper.rb
🧰 Additional context used
📓 Path-based instructions (7)
app/**/*.{rb,js,ts,jsx,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Rails app code should be organized in
app/directory with subdirectories:models/,controllers/,views/,jobs/,helpers/, and frontend code underjavascript/(Shakapacker)
Files:
app/models/ai_answer_creator.rbapp/jobs/ai_answer_create_job.rbapp/models/ai/answer_generator.rb
**/*.rb
📄 CodeRabbit inference engine (AGENTS.md)
Ruby code should use 2-space indentation, snake_case for method names, and CamelCase for class names, enforced by RuboCop (
.rubocop.yml)
Files:
app/models/ai_answer_creator.rbapp/jobs/ai_answer_create_job.rbtest/jobs/ai_answer_create_job_test.rbtest/test_helper.rbapp/models/ai/answer_generator.rbconfig/ci.rbconfig/initializers/inflections.rbconfig/initializers/active_support_notifications.rbtest/system/admin/users_test.rbdb/schema.rb
⚙️ CodeRabbit configuration file
**/*.rb: # refactoring
- まずFat Controllerを避け、次にFat Modelを避ける。
- Serviceクラスの乱用を避ける。
- controller concernを作ろうとしたらPORO(Plain Old Ruby Object)やActiveRecordモデルでの実装で代替できないか検討する。
Rails Patterns
- ViewHelperにメソッドを実装する時にはまずDecoratorパターンを使うことを検討する。(active_decorator gemを導入しているのでそれを使う)
- 複雑なActiveRecordクエリがあり、再利用できそうな場合はQueryObjectパターンを検討する。(rails-patterns gemを導入しているのでそれのQuery機能を使う)
- Viewにpartialを作る場合はViewComponentを使うことを検討する。
- 複数のActiveRecordモデルを操作する1つの責務がある時や外部APIとやりとりする処理がある場合にはInteractorオブジェクトパターンを検討する。(interactor gemを導入しているのでそれを使う)
- 複数のInteractorを実行するような処理がある場合Organizerオブジェクトパターンを検討する。(interactor gemを導入しており、その中にOrganizerの機能があるので使う)
Files:
app/models/ai_answer_creator.rbapp/jobs/ai_answer_create_job.rbtest/jobs/ai_answer_create_job_test.rbtest/test_helper.rbapp/models/ai/answer_generator.rbconfig/ci.rbconfig/initializers/inflections.rbconfig/initializers/active_support_notifications.rbtest/system/admin/users_test.rbdb/schema.rb
test/**/*_test.rb
📄 CodeRabbit inference engine (AGENTS.md)
test/**/*_test.rb: Test suite should use Minitest with structure:system/,models/,controllers/, and fixtures intest/fixtures/; test files should be named*_test.rb
Use Minitest + Capybara for system tests; place unit and integration tests under matchingtest/*directories
Files:
test/jobs/ai_answer_create_job_test.rbtest/system/admin/users_test.rb
test/**
📄 CodeRabbit inference engine (AGENTS.md)
Keep tests deterministic and use fixtures stored in
test/fixtures/for test data
Files:
test/jobs/ai_answer_create_job_test.rbtest/test_helper.rbtest/system/admin/users_test.rb
test/**/*
⚙️ CodeRabbit configuration file
test/**/*: # Test
- TestCase名は英語で書く。
- どうしても避けられない時以外にsystem testでsleepは使わない。
Unit Test
model, helper, decorator, view_componentについてはメソッドを追加した場合は必ず対応したUnit TestのTestCaseを1つは書く。
Files:
test/jobs/ai_answer_create_job_test.rbtest/test_helper.rbtest/system/admin/users_test.rb
config/**
📄 CodeRabbit inference engine (AGENTS.md)
Configuration files in
config/should include environment settings, routes, and lints (.rubocop.yml,config/slim_lint.yml)
Files:
config/ci.rbconfig/initializers/inflections.rbconfig/initializers/active_support_notifications.rb
db/**
📄 CodeRabbit inference engine (AGENTS.md)
Database migrations and schema should be stored in
db/directory; app-specific utilities inlib/; static assets inpublic/
Files:
db/schema.rb
🧠 Learnings (28)
📓 Common learnings
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/product.rb:59-61
Timestamp: 2025-09-11T14:47:53.256Z
Learning: Rails アップグレードPRでは、アップグレードに直接関連しない性能改善や機能追加の提案は避けるべき。PRのスコープを維持することが重要で、そのような改善提案は別PRで対応すべきである。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:52-56
Timestamp: 2025-09-12T21:17:45.295Z
Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9115
File: db/migrate/20250902024949_add_unique_index_to_correct_answers.rb:1-5
Timestamp: 2025-11-13T09:20:36.030Z
Learning: fjordllc/bootcamp プロジェクトでは、データの整合性を保つためのデータ修正には data-migrate gem を使用し、db/data/ ディレクトリ配下にデータマイグレーションファイルを作成する運用を採用している。スキーマ変更(db/migrate/)とデータ変更(db/data/)を分離することで、より安全で管理しやすい構成を実現している。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:19-23
Timestamp: 2025-09-12T21:17:26.029Z
Learning: Rails アップグレードPRにおいて、config_for(:secrets) を使った webhook URL 設定の shared セクション未参照問題は、設定システム全体の変更として別PRで対応すべきである。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: config/initializers/sorcery.rb:0-0
Timestamp: 2025-09-11T16:02:24.782Z
Learning: Rails アップグレードPRにおいて、JWT設定の改善では複数のソース(secrets, credentials, ENV)を優先順位付きで検索し、本番環境では未設定時に起動を停止させる実装が推奨される。開発・テスト環境でのみsecret_key_baseフォールバックを許可する構成が安全である。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/migrate/20250831234516_remove_unique_index_from_buzzes_title.rb:1-5
Timestamp: 2025-09-04T01:50:47.773Z
Learning: fjordllc/bootcampプロジェクトでは、マイグレーションにおいてdisable_ddl_transaction!やalgorithm: :concurrentlyは使用せず、標準的なRailsのchangeメソッド内でremove_indexを実行する慣例がある。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: app/controllers/mentor/buzzes_controller.rb:0-0
Timestamp: 2025-09-04T01:39:22.261Z
Learning: fjordllc/bootcamp プロジェクトでは、更新処理の成功時の通知メッセージについて、I18n を使用せずに日本語文字列を直接記述する方針で一貫性を保っている。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: db/migrate/20250828192202_add_missing_columns_to_good_jobs.rb:4-10
Timestamp: 2025-09-11T14:18:20.194Z
Learning: GoodJobやその他の外部gemが生成するマイグレーションファイルは、gem内部のロジックと密接に連携しているため、null制約やデフォルト値の追加などの変更を行うべきではない。gemのアップグレードパスに従い、生成されたマイグレーションをそのまま使用することが適切。
Learnt from: mousu-a
Repo: fjordllc/bootcamp PR: 8566
File: db/migrate/20250830033535_add_default_to_pair_works_wip.rb:1-5
Timestamp: 2025-08-31T03:17:44.812Z
Learning: 新機能のマイグレーションで、まだ本番環境にリリースされていない場合は、既存レコードのバックフィル処理は不要。開発環境でrails db:resetが可能な状況では特に、デフォルト値の変更のみで十分。
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to test/**/*_test.rb : Use Minitest + Capybara for system tests; place unit and integration tests under matching `test/*` directories
Applied to files:
test/test_helper.rbconfig/ci.rbGemfile
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to test/**/*_test.rb : Test suite should use Minitest with structure: `system/`, `models/`, `controllers/`, and fixtures in `test/fixtures/`; test files should be named `*_test.rb`
Applied to files:
test/test_helper.rb
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to test/** : Keep tests deterministic and use fixtures stored in `test/fixtures/` for test data
Applied to files:
test/test_helper.rb
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Use `bin/setup` for local database setup and dependency installation; avoid manual tweaks in `config/` without team discussion
Applied to files:
test/test_helper.rbconfig/ci.rb
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: All linters must pass (`bin/lint` command) and CI (CircleCI) must be green before merging; add or adjust tests when changing behavior
Applied to files:
test/test_helper.rbconfig/ci.rb
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to config/** : Configuration files in `config/` should include environment settings, routes, and lints (`.rubocop.yml`, `config/slim_lint.yml`)
Applied to files:
config/ci.rb
📚 Learning: 2025-09-12T21:17:26.029Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:19-23
Timestamp: 2025-09-12T21:17:26.029Z
Learning: Rails アップグレードPRにおいて、config_for(:secrets) を使った webhook URL 設定の shared セクション未参照問題は、設定システム全体の変更として別PRで対応すべきである。
Applied to files:
config/ci.rbGemfile
📚 Learning: 2025-11-13T09:20:36.030Z
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9115
File: db/migrate/20250902024949_add_unique_index_to_correct_answers.rb:1-5
Timestamp: 2025-11-13T09:20:36.030Z
Learning: fjordllc/bootcamp プロジェクトでは、データの整合性を保つためのデータ修正には data-migrate gem を使用し、db/data/ ディレクトリ配下にデータマイグレーションファイルを作成する運用を採用している。スキーマ変更(db/migrate/)とデータ変更(db/data/)を分離することで、より安全で管理しやすい構成を実現している。
Applied to files:
config/ci.rbGemfile
📚 Learning: 2025-09-11T16:02:24.782Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: config/initializers/sorcery.rb:0-0
Timestamp: 2025-09-11T16:02:24.782Z
Learning: Rails アップグレードPRにおいて、JWT設定の改善では複数のソース(secrets, credentials, ENV)を優先順位付きで検索し、本番環境では未設定時に起動を停止させる実装が推奨される。開発・テスト環境でのみsecret_key_baseフォールバックを許可する構成が安全である。
Applied to files:
config/ci.rbGemfile
📚 Learning: 2025-07-26T15:24:14.799Z
Learnt from: su-su-su-su
Repo: fjordllc/bootcamp PR: 0
File: :0-0
Timestamp: 2025-07-26T15:24:14.799Z
Learning: fjordllc/bootcampプロジェクトでは、Rubyの述語メソッドには?を付ける命名規則(例: can_be_checker?)を徹底している。
Applied to files:
config/initializers/inflections.rb
📚 Learning: 2025-11-25T05:42:10.478Z
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9323
File: app/models/question_auto_closer.rb:45-51
Timestamp: 2025-11-25T05:42:10.478Z
Learning: fjordllc/bootcamp の QuestionAutoCloser において、create_warning_message で発行される 'answer.create' イベントは、システムユーザーによる自動クローズ警告メッセージを質問者と既存の監視者に通知するための意図的な設計である。AnswerNotifier と NotifierToWatchingUser による通知は期待される動作。
Applied to files:
config/initializers/active_support_notifications.rb
📚 Learning: 2025-09-01T22:31:57.345Z
Learnt from: matuaya
Repo: fjordllc/bootcamp PR: 9108
File: app/models/after_user_retirement.rb:0-0
Timestamp: 2025-09-01T22:31:57.345Z
Learning: fjordllc/bootcampプロジェクトにおいて、`Newspaper.publish(:retirement_create, { user: user })`はUnfinishedDataDestroyer(未チェックProduct・WIP Report削除、career_pathリセット)とTimesChannelDestroyer(Discord分報チャンネル削除)による重要なデータクリーンアップ処理を実行するため、退会のトリガーが何であろうと(admin、hibernation、user)必ず実行する必要がある。
Applied to files:
test/system/admin/users_test.rb
📚 Learning: 2025-09-01T22:31:57.345Z
Learnt from: matuaya
Repo: fjordllc/bootcamp PR: 9108
File: app/models/after_user_retirement.rb:0-0
Timestamp: 2025-09-01T22:31:57.345Z
Learning: fjordllc/bootcampプロジェクトにおいて、`Newspaper.publish(:retirement_create, { user: user })`は通知処理ではなく、UnfinishedDataDestroyerやTimesChannelDestroyer等による重要なデータクリーンアップ処理を実行するため、管理者による退会(triggered_by: 'admin')の場合でも必ず実行する必要がある。
Applied to files:
test/system/admin/users_test.rb
📚 Learning: 2025-08-31T12:08:33.904Z
Learnt from: thmz337
Repo: fjordllc/bootcamp PR: 9103
File: app/views/generations/_user.html.slim:6-14
Timestamp: 2025-08-31T12:08:33.904Z
Learning: app/views/generations/_user.html.slimの非アクティブメッセージ表示では、退会・休会・非アクティブの3つの条件が独立して評価され、複数のメッセージが同時に表示される仕様になっている。これは意図的な設計である。
Applied to files:
test/system/admin/users_test.rb
📚 Learning: 2025-07-15T12:33:04.885Z
Learnt from: reckyy
Repo: fjordllc/bootcamp PR: 8356
File: db/fixtures/users.yml:823-826
Timestamp: 2025-07-15T12:33:04.885Z
Learning: fjordllc/bootcampプロジェクトでは、`trainee: true`は「研修に所属していたユーザー」全体を示すフラグであり、研修中のユーザーと研修を終了したユーザーの両方を含む。そのため、`trainee: true`と`training_completed_at`の併存は意図された仕様であり、排他的な関係ではない。
Applied to files:
test/system/admin/users_test.rb
📚 Learning: 2025-08-31T23:39:23.210Z
Learnt from: mousu-a
Repo: fjordllc/bootcamp PR: 8566
File: app/views/pair_works/_body.html.slim:111-117
Timestamp: 2025-08-31T23:39:23.210Z
Learning: PairWorkモデルにreserved_at_in_schedules?カスタムバリデーション(on: :update)が実装されており、reserved_atが必ずschedules.map(&:proposed_at)に含まれることを検証している。これにより、フォームから任意の日時を送信することを防いでいる。
Applied to files:
test/system/admin/users_test.rb
📚 Learning: 2025-09-08T04:55:46.649Z
Learnt from: sharoa119
Repo: fjordllc/bootcamp PR: 8711
File: db/schema.rb:0-0
Timestamp: 2025-09-08T04:55:46.649Z
Learning: In this PR, the removal of length limits from companies.name and companies.website columns in db/schema.rb was unintentional - it was a case of accidentally lost constraints that needed to be restored to their original limits, not a deliberate design change.
Applied to files:
db/schema.rb
📚 Learning: 2025-09-04T01:27:23.422Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/fixtures/buzzes.yml:0-0
Timestamp: 2025-09-04T01:27:23.422Z
Learning: The buzz_controller.rb was indeed deleted, but there are still two remaining items from the old buzz single page implementation that need cleanup: the data migration file db/data/20230726024528_create_buzz.rb and the old buzz route in config/routes.rb line 136. These should be updated/removed to complete the buzz page redesign migration.
Applied to files:
db/schema.rb
📚 Learning: 2025-09-11T14:47:53.256Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/product.rb:59-61
Timestamp: 2025-09-11T14:47:53.256Z
Learning: Rails アップグレードPRでは、アップグレードに直接関連しない性能改善や機能追加の提案は避けるべき。PRのスコープを維持することが重要で、そのような改善提案は別PRで対応すべきである。
Applied to files:
Gemfile
📚 Learning: 2025-09-12T21:16:47.639Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Applied to files:
Gemfile
📚 Learning: 2025-09-12T21:17:45.295Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:52-56
Timestamp: 2025-09-12T21:17:45.295Z
Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Applied to files:
Gemfile
📚 Learning: 2025-09-12T21:18:00.834Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Applied to files:
Gemfile
📚 Learning: 2025-09-04T01:50:47.773Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/migrate/20250831234516_remove_unique_index_from_buzzes_title.rb:1-5
Timestamp: 2025-09-04T01:50:47.773Z
Learning: fjordllc/bootcampプロジェクトでは、マイグレーションにおいてdisable_ddl_transaction!やalgorithm: :concurrentlyは使用せず、標準的なRailsのchangeメソッド内でremove_indexを実行する慣例がある。
Applied to files:
Gemfile
📚 Learning: 2025-07-07T05:28:03.676Z
Learnt from: su-su-su-su
Repo: fjordllc/bootcamp PR: 0
File: :0-0
Timestamp: 2025-07-07T05:28:03.676Z
Learning: fjordllc/bootcampプロジェクトでは、fixtureファイル内のERB構文で改行制御文字(-)は使用せず、標準的な<% %>と<%= %>のみを使用する方針が統一されている。<% -%>や<%- %>を使用するとSyntaxErrorが発生する。
Applied to files:
Gemfile
📚 Learning: 2025-11-17T00:46:30.794Z
Learnt from: tyrrell-IH
Repo: fjordllc/bootcamp PR: 9306
File: app/javascript/components/Bookmarks.jsx:248-265
Timestamp: 2025-11-17T00:46:30.794Z
Learning: fjordllc/bootcamp プロジェクトでは、Reactからバニラ JavaScript への移行作業が進行中である。そのため、新しいReactファイルの作成は避け、既存のReactコンポーネント内で完結する実装が推奨される。BookmarksInDashboard.jsx は issue #9045 で削除予定。
Applied to files:
Gemfile
📚 Learning: 2025-09-11T14:18:20.194Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: db/migrate/20250828192202_add_missing_columns_to_good_jobs.rb:4-10
Timestamp: 2025-09-11T14:18:20.194Z
Learning: GoodJobやその他の外部gemが生成するマイグレーションファイルは、gem内部のロジックと密接に連携しているため、null制約やデフォルト値の追加などの変更を行うべきではない。gemのアップグレードパスに従い、生成されたマイグレーションをそのまま使用することが適切。
Applied to files:
Gemfile
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Pull requests should include clear description, linked issues, screenshots for UI changes, migration notes, and rollback plan if relevant
Applied to files:
Gemfile
🧬 Code graph analysis (1)
app/models/ai_answer_creator.rb (2)
app/models/ai/answer_generator.rb (1)
call(21-36)app/controllers/api/answers_controller.rb (1)
question(58-60)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build_and_test
🔇 Additional comments (24)
config/initializers/inflections.rb (2)
1-1: frozen_string_literal の追加を確認しました。Ruby のベストプラクティスに従った変更です。
17-20: inflection ルールの文字列リテラル形式が統一されました。ダブルクォートからシングルクォートへの変更により、補間のない文字列リテラルの記述が統一されています。また、AI acronym の削除は Zeitwerk の命名規約(
AI→Ai)への対応として適切です。test/jobs/ai_answer_create_job_test.rb (2)
5-5: テストクラス名が正しく更新されました。
AiAnswerCreateJobTestへの変更により、リネームされたジョブクラスと一致しています。
10-10: ジョブの呼び出しが正しく更新されました。
AiAnswerCreateJob.perform_nowへの変更により、リネームされたジョブクラスのメソッド呼び出しが正しく反映されています。config/initializers/active_support_notifications.rb (1)
56-58: 通知サブスクリプションのクラス名が正しく更新されました。
AIAnswerCreatorからAiAnswerCreatorへの変更により、リネームされたクラスとの一貫性が保たれています。サブスクリプションのロジックは変更されていません。app/models/ai/answer_generator.rb (1)
3-3: モジュール名が Zeitwerk の命名規約に準拠しました。
module AIからmodule Aiへの変更により、ファイルパスapp/models/ai/answer_generator.rbと命名が一致し、Rails 8 の Zeitwerk オートローダーが正しく動作します。app/jobs/ai_answer_create_job.rb (2)
3-3: ジョブクラス名が正しく更新されました。
AiAnswerCreateJobへの変更により、Zeitwerk の命名規約に準拠しています。
9-9: モジュール参照が正しく更新されました。
Ai::AnswerGeneratorへの変更により、リネームされたモジュールとの一貫性が保たれています。app/models/ai_answer_creator.rb (2)
3-3: Zeitwerk規約に準拠したクラス名変更が正しく実装されています
AIAnswerCreatorからAiAnswerCreatorへのリネームは、Zeitwerk の命名規則に従っており、ファイル名ai_answer_creator.rbとも一致しています。Rails 8.1 へのアップグレードに必要な変更です。
7-7: ジョブクラス名の更新が正しく実装されています
AiAnswerCreateJobへの変更は、クラス名のリネームと一貫性があり、perform_laterを使用したバックグラウンドジョブの登録も適切です。db/schema.rb (3)
13-16: Rails 8.1スキーマ更新が正しく適用されています。スキーマバージョンが8.1に更新され、
pg_catalog.plpgsql拡張の記述も Rails 8.1 の形式に準拠しています。スキーマバージョン2026_01_04_051945が最新のマイグレーションファイル名と一致していることを確認してください。
756-875: SolidQueueテーブルが正しく追加されています。GoodJobからSolidQueueへの移行に伴い、11個の
solid_queue_*テーブルが追加されています。これらはSolidQueue gemの標準テーブル構造であり、ジョブの実行管理に必要なすべてのテーブル(jobs、executions、processes、recurring_tasksなど)が含まれています。適切なインデックスも定義されています。
1138-1143: SolidQueue外部キー制約が適切に設定されています。solid_queue_jobs テーブルへの外部キー制約に
on_delete: :cascadeが設定されており、ジョブ削除時に関連する実行レコードが自動的にクリーンアップされます。これはSolidQueueの標準的な構成で、データの整合性を保ちながら孤立レコードを防ぎます。test/system/admin/users_test.rb (3)
181-200: 退会テストの更新が適切ですテストの変更内容が Rails 8.1 アップグレードの目的に沿っています:
- Discord times_id の初期化と退会後のクリアを明示的に検証
- Stripe API 呼び出しを回避するための
update_columns使用(コメントで理由を明記)- VCR カセットから
Discord::Server.stubへの移行テストロジックは正しく、期待される動作を適切に検証しています。
232-253: 卒業テストの更新が適切ですStripe API の WebMock スタブを使用した卒業フローのテストが正しく実装されています:
- Stripe API の GET/POST エンドポイントを適切にスタブ化
Card.stubでカード削除処理をモック化- 卒業日の保存と Stripe API へのリクエスト送信の両方を検証
テストロジックは健全で、Rails 8.1 アップグレードに合わせた適切な変更です。
315-323: 研修終了日更新テストの改善テストの変更により検証が強化されています:
- 要素 ID セレクタ
#user_submitを使用してボタンクリックをより明示的に実行- 成功メッセージとデータ永続化の両方を検証するアサーションを追加
変更により、テストの信頼性が向上しています。
.cloudbuild/cloudbuild-staging.yaml (2)
127-128: リトライ設定の強化を承認します。データベース削除のリトライ回数とディレイの増加(最大12回、10秒間隔)は、Cloud SQL Proxy経由の接続が残っている場合の処理をより堅牢にする妥当な変更です。
238-239: 環境変数の更新を承認します。GoodJob から MissionControl への移行に伴う環境変数名の変更(GOOD_JOB_* → MISSION_CONTROL_*)は一貫性があり適切です。
.traceroute.yml (1)
9-9: MissionControl::Jobs のルート除外設定を承認します。MissionControl::Jobs::Engine のマウントに伴う ignore ルールの追加は、他のエンジン(rails、active_storage等)と同様のパターンで適切です。
Also applies to: 13-13
config/ci.rb (1)
1-22: CI設定ファイルの構造を承認します。CI.run DSLを使用したCI設定は明確で理解しやすい構造です。importmap監査ステップは適切にコメントアウトされ、TODOコメントで将来の対応が示されています。
test/test_helper.rb (2)
22-26: テストリトライ設定の柔軟性向上を承認します。CI環境だけでなく、MINITEST_RETRY_COUNT環境変数による条件分岐を導入することで、ローカル開発環境でもリトライ機能を活用できるようになりました。キーワード引数スタイルの使用も適切です。
31-35: 並列テスト設定の改善を承認します。PARALLEL_WORKERS環境変数による明示的な制御により、ローカル環境での並列テスト実行が柔軟に設定可能になりました。コメントも丁寧で理解しやすいです。
Gemfile (2)
90-103: 開発・テスト環境の依存関係整理を承認します。rubocop関連gemの
require: false指定、benchmark gemの追加、slim_lintの追加など、開発環境の整備が適切に行われています。Rails 8.1へのアップグレードに伴う開発ツール群の更新として妥当です。
105-114: 開発環境の依存関係追加を承認します。web-consoleやlistenの更新など、開発環境の利便性向上に寄与する変更です。Rails 8.1の開発環境として適切な構成です。
| - '--set-env-vars=MISSION_CONTROL_USER=$_MISSION_CONTROL_USER' | ||
| - '--set-env-vars=MISSION_CONTROL_PASSWORD=$_MISSION_CONTROL_PASSWORD' |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# Get an overview of the repository structure
git ls-files | head -20Repository: fjordllc/bootcamp
Length of output: 570
🏁 Script executed:
# Check the cloudbuild.yaml file to see the full context
cat -n .cloudbuild/cloudbuild.yaml | head -150Repository: fjordllc/bootcamp
Length of output: 6335
🏁 Script executed:
# Search for MISSION_CONTROL environment variable references
rg -n "MISSION_CONTROL_(USER|PASSWORD)" --type yaml --type ruby --type python --type javascript --type typescript 2>/dev/null || trueRepository: fjordllc/bootcamp
Length of output: 43
🏁 Script executed:
# Search for old GOOD_JOB environment variable references
rg -n "GOOD_JOB_(USERNAME|PASSWORD)" --type yaml --type ruby --type python --type javascript --type typescript 2>/dev/null || trueRepository: fjordllc/bootcamp
Length of output: 43
🏁 Script executed:
# Check for any Cloud Build substitution variable definitions
rg -n "substitutions:" -A 10 .cloudbuild/cloudbuild.yamlRepository: fjordllc/bootcamp
Length of output: 119
🏁 Script executed:
# Look for config files related to Mission Control initialization
fd -e rb -e py -e js -e ts | xargs grep -l "MISSION_CONTROL" 2>/dev/null || trueRepository: fjordllc/bootcamp
Length of output: 99
🏁 Script executed:
# Check the full substitutions section in cloudbuild.yaml
cat .cloudbuild/cloudbuild.yaml | tail -20Repository: fjordllc/bootcamp
Length of output: 789
🏁 Script executed:
# Read the mission_control initializer file
cat config/initializers/mission_control.rbRepository: fjordllc/bootcamp
Length of output: 396
🏁 Script executed:
# Check other cloudbuild files for comparison
cat .cloudbuild/cloudbuild-staging.yaml | grep -A 20 "substitutions:"Repository: fjordllc/bootcamp
Length of output: 119
Cloud Build トリガー設定で MISSION_CONTROL 環境変数の substitution 定義を確認が必須です。
cloudbuild.yaml の109-110行目はアプリケーション環境変数として $_MISSION_CONTROL_USER と $_MISSION_CONTROL_PASSWORD を参照していますが、このファイルの substitutions セクションには これらの変数の定義がありません。Cloud Build トリガーの設定で _MISSION_CONTROL_USER と _MISSION_CONTROL_PASSWORD が正しく定義されていることを確認してください。定義がない場合、デプロイが失敗するか、リテラル文字列がセットされてしまいます。
なお、アプリケーションコード(config/initializers/mission_control.rb)はこれらの環境変数を正しく参照しており、古い GOOD_JOB_* の参照は残っていません。
🤖 Prompt for AI Agents
In .cloudbuild/cloudbuild.yaml around lines 109-110, the file references
substitutions $_MISSION_CONTROL_USER and $_MISSION_CONTROL_PASSWORD but those
keys are not defined; add definitions for _MISSION_CONTROL_USER and
_MISSION_CONTROL_PASSWORD to the substitutions section of cloudbuild.yaml (keys
must start with an underscore) or ensure the Cloud Build trigger defines them,
or switch to using built-in secret/secretEnv handling if you prefer not to store
credentials in substitutions; update the substitutions block accordingly so the
referenced variables resolve at build time.
013aec2 to
e5d7ecb
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
Fix all issues with AI Agents 🤖
In @test/system/practices/mentor_test.rb:
- Line 113: The new fill_options on the call fill_in 'practice[title]', with:
'テストプラクティス', fill_options: { clear: :backspace } is inconsistent with other
fill_in uses in this test; either add the same fill_options: { clear: :backspace
} to every other fill_in in this test file or remove the fill_options from this
specific call so all fill_in invocations are consistent, then run the test suite
to confirm behavior.
- Around line 112-119: The test is inconsistent with other update tests: move
the click_button '更新する' call out of the within 'form[name=practice]' block so it
matches the pattern used in the other update tests (e.g., those using
click_button '更新する' outside the form block); keep the fill_in and the nested
within '#reference_books' interactions inside the form block and then call
click_button '更新する' after exiting that block to restore consistency and improve
readability.
♻️ Duplicate comments (1)
config/environments/production.rb (1)
49-50: キャッシュストア設定とコメントの不整合を確認してください。49行目のコメントは「永続的な代替手段(durable alternative)」への置き換えを推奨していますが、50行目の実装は依然として
:memory_store(非永続的なインメモリキャッシュ)となっています。以下のいずれかで対応してください:
- RedisやMemcachedなど永続的なキャッシュストアに変更する
:memory_storeが意図的な選択である場合は、コメントを実装に合わせて更新する
🧹 Nitpick comments (1)
Gemfile (1)
116-122: test グループの変更を承認します。minitest 制約についてコメントを追加することを推奨します。
capybaraとselenium-webdriverのバージョン制約解除は適切です。
minitest < 6.0の制約について、現在の minitest は 5.x 系のため実質的にはすべての現行バージョンを許容しています。Rails 8.1 との互換性のためとのことですが、将来 minitest 6.0 がリリースされた際に備えた予防的な制約であれば、その旨をインラインコメントで明記しておくと後続の開発者にとって分かりやすくなります。# Rails 8.1との互換性のため、将来のminitest 6.0を除外 gem 'minitest', '< 6.0'
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
Gemfile.lockis excluded by!**/*.lock
📒 Files selected for processing (20)
.cloudbuild/cloudbuild-staging.yamlGemfileapp/jobs/ai_answer_create_job.rbapp/models/ai/answer_generator.rbapp/models/ai_answer_creator.rbconfig/ci.rbconfig/environments/development.rbconfig/environments/production.rbconfig/initializers/active_support_notifications.rbconfig/initializers/inflections.rbdb/schema.rbtest/jobs/ai_answer_create_job_test.rbtest/models/ai/answer_generator_test.rbtest/system/admin/users_test.rbtest/system/corporate_training_inquiry_system_test.rbtest/system/notification/tabs_badges_test.rbtest/system/practices/mentor_test.rbtest/system/product/unchecked_test.rbtest/system/regular_events/announcement_test.rbtest/test_helper.rb
🚧 Files skipped from review as they are similar to previous changes (2)
- test/system/regular_events/announcement_test.rb
- test/system/product/unchecked_test.rb
🧰 Additional context used
📓 Path-based instructions (7)
test/**/*_test.rb
📄 CodeRabbit inference engine (AGENTS.md)
test/**/*_test.rb: Test suite should use Minitest with structure:system/,models/,controllers/, and fixtures intest/fixtures/; test files should be named*_test.rb
Use Minitest + Capybara for system tests; place unit and integration tests under matchingtest/*directories
Files:
test/jobs/ai_answer_create_job_test.rbtest/system/admin/users_test.rbtest/system/notification/tabs_badges_test.rbtest/system/practices/mentor_test.rbtest/system/corporate_training_inquiry_system_test.rbtest/models/ai/answer_generator_test.rb
**/*.rb
📄 CodeRabbit inference engine (AGENTS.md)
Ruby code should use 2-space indentation, snake_case for method names, and CamelCase for class names, enforced by RuboCop (
.rubocop.yml)
Files:
test/jobs/ai_answer_create_job_test.rbtest/test_helper.rbconfig/ci.rbapp/jobs/ai_answer_create_job.rbtest/system/admin/users_test.rbapp/models/ai/answer_generator.rbconfig/initializers/active_support_notifications.rbconfig/initializers/inflections.rbtest/system/notification/tabs_badges_test.rbapp/models/ai_answer_creator.rbtest/system/practices/mentor_test.rbtest/system/corporate_training_inquiry_system_test.rbtest/models/ai/answer_generator_test.rbdb/schema.rbconfig/environments/production.rbconfig/environments/development.rb
⚙️ CodeRabbit configuration file
**/*.rb: # refactoring
- まずFat Controllerを避け、次にFat Modelを避ける。
- Serviceクラスの乱用を避ける。
- controller concernを作ろうとしたらPORO(Plain Old Ruby Object)やActiveRecordモデルでの実装で代替できないか検討する。
Rails Patterns
- ViewHelperにメソッドを実装する時にはまずDecoratorパターンを使うことを検討する。(active_decorator gemを導入しているのでそれを使う)
- 複雑なActiveRecordクエリがあり、再利用できそうな場合はQueryObjectパターンを検討する。(rails-patterns gemを導入しているのでそれのQuery機能を使う)
- Viewにpartialを作る場合はViewComponentを使うことを検討する。
- 複数のActiveRecordモデルを操作する1つの責務がある時や外部APIとやりとりする処理がある場合にはInteractorオブジェクトパターンを検討する。(interactor gemを導入しているのでそれを使う)
- 複数のInteractorを実行するような処理がある場合Organizerオブジェクトパターンを検討する。(interactor gemを導入しており、その中にOrganizerの機能があるので使う)
Files:
test/jobs/ai_answer_create_job_test.rbtest/test_helper.rbconfig/ci.rbapp/jobs/ai_answer_create_job.rbtest/system/admin/users_test.rbapp/models/ai/answer_generator.rbconfig/initializers/active_support_notifications.rbconfig/initializers/inflections.rbtest/system/notification/tabs_badges_test.rbapp/models/ai_answer_creator.rbtest/system/practices/mentor_test.rbtest/system/corporate_training_inquiry_system_test.rbtest/models/ai/answer_generator_test.rbdb/schema.rbconfig/environments/production.rbconfig/environments/development.rb
test/**
📄 CodeRabbit inference engine (AGENTS.md)
Keep tests deterministic and use fixtures stored in
test/fixtures/for test data
Files:
test/jobs/ai_answer_create_job_test.rbtest/test_helper.rbtest/system/admin/users_test.rbtest/system/notification/tabs_badges_test.rbtest/system/practices/mentor_test.rbtest/system/corporate_training_inquiry_system_test.rbtest/models/ai/answer_generator_test.rb
test/**/*
⚙️ CodeRabbit configuration file
test/**/*: # Test
- TestCase名は英語で書く。
- どうしても避けられない時以外にsystem testでsleepは使わない。
Unit Test
model, helper, decorator, view_componentについてはメソッドを追加した場合は必ず対応したUnit TestのTestCaseを1つは書く。
Files:
test/jobs/ai_answer_create_job_test.rbtest/test_helper.rbtest/system/admin/users_test.rbtest/system/notification/tabs_badges_test.rbtest/system/practices/mentor_test.rbtest/system/corporate_training_inquiry_system_test.rbtest/models/ai/answer_generator_test.rb
config/**
📄 CodeRabbit inference engine (AGENTS.md)
Configuration files in
config/should include environment settings, routes, and lints (.rubocop.yml,config/slim_lint.yml)
Files:
config/ci.rbconfig/initializers/active_support_notifications.rbconfig/initializers/inflections.rbconfig/environments/production.rbconfig/environments/development.rb
app/**/*.{rb,js,ts,jsx,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Rails app code should be organized in
app/directory with subdirectories:models/,controllers/,views/,jobs/,helpers/, and frontend code underjavascript/(Shakapacker)
Files:
app/jobs/ai_answer_create_job.rbapp/models/ai/answer_generator.rbapp/models/ai_answer_creator.rb
db/**
📄 CodeRabbit inference engine (AGENTS.md)
Database migrations and schema should be stored in
db/directory; app-specific utilities inlib/; static assets inpublic/
Files:
db/schema.rb
🧠 Learnings (37)
📓 Common learnings
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/product.rb:59-61
Timestamp: 2025-09-11T14:47:53.256Z
Learning: Rails アップグレードPRでは、アップグレードに直接関連しない性能改善や機能追加の提案は避けるべき。PRのスコープを維持することが重要で、そのような改善提案は別PRで対応すべきである。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:52-56
Timestamp: 2025-09-12T21:17:45.295Z
Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9115
File: db/migrate/20250902024949_add_unique_index_to_correct_answers.rb:1-5
Timestamp: 2025-11-13T09:20:36.030Z
Learning: fjordllc/bootcamp プロジェクトでは、データの整合性を保つためのデータ修正には data-migrate gem を使用し、db/data/ ディレクトリ配下にデータマイグレーションファイルを作成する運用を採用している。スキーマ変更(db/migrate/)とデータ変更(db/data/)を分離することで、より安全で管理しやすい構成を実現している。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: config/initializers/sorcery.rb:0-0
Timestamp: 2025-09-11T16:02:24.782Z
Learning: Rails アップグレードPRにおいて、JWT設定の改善では複数のソース(secrets, credentials, ENV)を優先順位付きで検索し、本番環境では未設定時に起動を停止させる実装が推奨される。開発・テスト環境でのみsecret_key_baseフォールバックを許可する構成が安全である。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:19-23
Timestamp: 2025-09-12T21:17:26.029Z
Learning: Rails アップグレードPRにおいて、config_for(:secrets) を使った webhook URL 設定の shared セクション未参照問題は、設定システム全体の変更として別PRで対応すべきである。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/migrate/20250831234516_remove_unique_index_from_buzzes_title.rb:1-5
Timestamp: 2025-09-04T01:50:47.773Z
Learning: fjordllc/bootcampプロジェクトでは、マイグレーションにおいてdisable_ddl_transaction!やalgorithm: :concurrentlyは使用せず、標準的なRailsのchangeメソッド内でremove_indexを実行する慣例がある。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: app/controllers/mentor/buzzes_controller.rb:0-0
Timestamp: 2025-09-04T01:39:22.261Z
Learning: fjordllc/bootcamp プロジェクトでは、更新処理の成功時の通知メッセージについて、I18n を使用せずに日本語文字列を直接記述する方針で一貫性を保っている。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: db/migrate/20250828192202_add_missing_columns_to_good_jobs.rb:4-10
Timestamp: 2025-09-11T14:18:20.194Z
Learning: GoodJobやその他の外部gemが生成するマイグレーションファイルは、gem内部のロジックと密接に連携しているため、null制約やデフォルト値の追加などの変更を行うべきではない。gemのアップグレードパスに従い、生成されたマイグレーションをそのまま使用することが適切。
Learnt from: mousu-a
Repo: fjordllc/bootcamp PR: 8566
File: db/migrate/20250830033535_add_default_to_pair_works_wip.rb:1-5
Timestamp: 2025-08-31T03:17:44.812Z
Learning: 新機能のマイグレーションで、まだ本番環境にリリースされていない場合は、既存レコードのバックフィル処理は不要。開発環境でrails db:resetが可能な状況では特に、デフォルト値の変更のみで十分。
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to test/**/*_test.rb : Use Minitest + Capybara for system tests; place unit and integration tests under matching `test/*` directories
Applied to files:
test/test_helper.rbconfig/ci.rbtest/system/notification/tabs_badges_test.rbtest/system/corporate_training_inquiry_system_test.rbGemfile
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to test/**/*_test.rb : Test suite should use Minitest with structure: `system/`, `models/`, `controllers/`, and fixtures in `test/fixtures/`; test files should be named `*_test.rb`
Applied to files:
test/test_helper.rb
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to test/** : Keep tests deterministic and use fixtures stored in `test/fixtures/` for test data
Applied to files:
test/test_helper.rb
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Use `bin/setup` for local database setup and dependency installation; avoid manual tweaks in `config/` without team discussion
Applied to files:
test/test_helper.rbconfig/ci.rbconfig/environments/production.rb
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: All linters must pass (`bin/lint` command) and CI (CircleCI) must be green before merging; add or adjust tests when changing behavior
Applied to files:
test/test_helper.rbconfig/ci.rb
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to config/** : Configuration files in `config/` should include environment settings, routes, and lints (`.rubocop.yml`, `config/slim_lint.yml`)
Applied to files:
test/test_helper.rbconfig/environments/production.rbconfig/environments/development.rb
📚 Learning: 2025-09-12T21:17:26.029Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:19-23
Timestamp: 2025-09-12T21:17:26.029Z
Learning: Rails アップグレードPRにおいて、config_for(:secrets) を使った webhook URL 設定の shared セクション未参照問題は、設定システム全体の変更として別PRで対応すべきである。
Applied to files:
config/ci.rbtest/system/corporate_training_inquiry_system_test.rbconfig/environments/production.rbGemfile
📚 Learning: 2025-11-13T09:20:36.030Z
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9115
File: db/migrate/20250902024949_add_unique_index_to_correct_answers.rb:1-5
Timestamp: 2025-11-13T09:20:36.030Z
Learning: fjordllc/bootcamp プロジェクトでは、データの整合性を保つためのデータ修正には data-migrate gem を使用し、db/data/ ディレクトリ配下にデータマイグレーションファイルを作成する運用を採用している。スキーマ変更(db/migrate/)とデータ変更(db/data/)を分離することで、より安全で管理しやすい構成を実現している。
Applied to files:
config/ci.rbGemfile
📚 Learning: 2025-09-11T16:02:24.782Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: config/initializers/sorcery.rb:0-0
Timestamp: 2025-09-11T16:02:24.782Z
Learning: Rails アップグレードPRにおいて、JWT設定の改善では複数のソース(secrets, credentials, ENV)を優先順位付きで検索し、本番環境では未設定時に起動を停止させる実装が推奨される。開発・テスト環境でのみsecret_key_baseフォールバックを許可する構成が安全である。
Applied to files:
config/ci.rbconfig/environments/production.rbconfig/environments/development.rbGemfile
📚 Learning: 2025-09-01T22:31:57.345Z
Learnt from: matuaya
Repo: fjordllc/bootcamp PR: 9108
File: app/models/after_user_retirement.rb:0-0
Timestamp: 2025-09-01T22:31:57.345Z
Learning: fjordllc/bootcampプロジェクトにおいて、`Newspaper.publish(:retirement_create, { user: user })`はUnfinishedDataDestroyer(未チェックProduct・WIP Report削除、career_pathリセット)とTimesChannelDestroyer(Discord分報チャンネル削除)による重要なデータクリーンアップ処理を実行するため、退会のトリガーが何であろうと(admin、hibernation、user)必ず実行する必要がある。
Applied to files:
test/system/admin/users_test.rb
📚 Learning: 2025-09-01T22:31:57.345Z
Learnt from: matuaya
Repo: fjordllc/bootcamp PR: 9108
File: app/models/after_user_retirement.rb:0-0
Timestamp: 2025-09-01T22:31:57.345Z
Learning: fjordllc/bootcampプロジェクトにおいて、`Newspaper.publish(:retirement_create, { user: user })`は通知処理ではなく、UnfinishedDataDestroyerやTimesChannelDestroyer等による重要なデータクリーンアップ処理を実行するため、管理者による退会(triggered_by: 'admin')の場合でも必ず実行する必要がある。
Applied to files:
test/system/admin/users_test.rb
📚 Learning: 2025-08-31T12:08:33.904Z
Learnt from: thmz337
Repo: fjordllc/bootcamp PR: 9103
File: app/views/generations/_user.html.slim:6-14
Timestamp: 2025-08-31T12:08:33.904Z
Learning: app/views/generations/_user.html.slimの非アクティブメッセージ表示では、退会・休会・非アクティブの3つの条件が独立して評価され、複数のメッセージが同時に表示される仕様になっている。これは意図的な設計である。
Applied to files:
test/system/admin/users_test.rb
📚 Learning: 2025-07-15T12:33:04.885Z
Learnt from: reckyy
Repo: fjordllc/bootcamp PR: 8356
File: db/fixtures/users.yml:823-826
Timestamp: 2025-07-15T12:33:04.885Z
Learning: fjordllc/bootcampプロジェクトでは、`trainee: true`は「研修に所属していたユーザー」全体を示すフラグであり、研修中のユーザーと研修を終了したユーザーの両方を含む。そのため、`trainee: true`と`training_completed_at`の併存は意図された仕様であり、排他的な関係ではない。
Applied to files:
test/system/admin/users_test.rb
📚 Learning: 2025-08-31T23:39:23.210Z
Learnt from: mousu-a
Repo: fjordllc/bootcamp PR: 8566
File: app/views/pair_works/_body.html.slim:111-117
Timestamp: 2025-08-31T23:39:23.210Z
Learning: PairWorkモデルにreserved_at_in_schedules?カスタムバリデーション(on: :update)が実装されており、reserved_atが必ずschedules.map(&:proposed_at)に含まれることを検証している。これにより、フォームから任意の日時を送信することを防いでいる。
Applied to files:
test/system/admin/users_test.rb
📚 Learning: 2025-11-25T05:42:10.478Z
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9323
File: app/models/question_auto_closer.rb:45-51
Timestamp: 2025-11-25T05:42:10.478Z
Learning: fjordllc/bootcamp の QuestionAutoCloser において、create_warning_message で発行される 'answer.create' イベントは、システムユーザーによる自動クローズ警告メッセージを質問者と既存の監視者に通知するための意図的な設計である。AnswerNotifier と NotifierToWatchingUser による通知は期待される動作。
Applied to files:
config/initializers/active_support_notifications.rb
📚 Learning: 2025-09-04T01:27:23.422Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/fixtures/buzzes.yml:0-0
Timestamp: 2025-09-04T01:27:23.422Z
Learning: The buzz_controller.rb and related data migration files were deleted as part of the Buzz page redesign, not just modified. The old single buzz page was completely replaced with a new buzzes (plural) listing page with year-based navigation and metadata structure.
Applied to files:
config/initializers/inflections.rb
📚 Learning: 2025-09-04T01:27:23.422Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/fixtures/buzzes.yml:0-0
Timestamp: 2025-09-04T01:27:23.422Z
Learning: The buzz_controller.rb was indeed deleted, but there are still two remaining items from the old buzz single page implementation that need cleanup: the data migration file db/data/20230726024528_create_buzz.rb and the old buzz route in config/routes.rb line 136. These should be updated/removed to complete the buzz page redesign migration.
Applied to files:
config/initializers/inflections.rbdb/schema.rb
📚 Learning: 2025-07-26T15:24:14.799Z
Learnt from: su-su-su-su
Repo: fjordllc/bootcamp PR: 0
File: :0-0
Timestamp: 2025-07-26T15:24:14.799Z
Learning: fjordllc/bootcampプロジェクトでは、Rubyの述語メソッドには?を付ける命名規則(例: can_be_checker?)を徹底している。
Applied to files:
config/initializers/inflections.rb
📚 Learning: 2025-09-12T01:00:58.452Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: app/views/mentor/buzzes/edit.html.slim:1-0
Timestamp: 2025-09-12T01:00:58.452Z
Learning: app/views/mentor/buzzes/edit.html.slim では `- title` と `- set_meta_tags` の両方が正しく設定されており、タイトルは削除されていない。変更内容はメタディスクリプションの追加のみ。
Applied to files:
test/system/practices/mentor_test.rb
📚 Learning: 2025-09-12T21:18:00.834Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Applied to files:
test/system/corporate_training_inquiry_system_test.rbconfig/environments/production.rbGemfile
📚 Learning: 2025-09-12T21:16:47.639Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Applied to files:
test/system/corporate_training_inquiry_system_test.rbconfig/environments/production.rbGemfile
📚 Learning: 2025-07-23T21:11:21.826Z
Learnt from: jun-kondo
Repo: fjordllc/bootcamp PR: 0
File: :0-0
Timestamp: 2025-07-23T21:11:21.826Z
Learning: fjordllc/bootcampプロジェクトの`app/models/inquiry_notifier.rb`において、`NOTIFICATION_SENDER_NAME`で指定される管理者ユーザーは必ず存在することがシステムの前提条件として保証されているため、senderがnilになることは想定されておらず、エラーハンドリングは不要である。
Applied to files:
test/system/corporate_training_inquiry_system_test.rb
📚 Learning: 2025-09-12T21:17:45.295Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:52-56
Timestamp: 2025-09-12T21:17:45.295Z
Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Applied to files:
test/system/corporate_training_inquiry_system_test.rbconfig/environments/production.rbconfig/environments/development.rbGemfile
📚 Learning: 2025-08-01T12:57:10.349Z
Learnt from: mousu-a
Repo: fjordllc/bootcamp PR: 8566
File: test/mailers/activity_mailer_test.rb:0-0
Timestamp: 2025-08-01T12:57:10.349Z
Learning: came_pair_work機能は現在テスト運用段階で、メンターと関係者のみに通知される仕様のため、メール通知OFF時の制御テストは現時点では実装不要と判断されている。
Applied to files:
test/system/corporate_training_inquiry_system_test.rb
📚 Learning: 2025-10-22T12:22:33.168Z
Learnt from: sjabcdefin
Repo: fjordllc/bootcamp PR: 9247
File: app/controllers/checks_controller.rb:0-0
Timestamp: 2025-10-22T12:22:33.168Z
Learning: CheckCallbacks内のメール通知・サイト内通知で例外が発生した場合、例外を握りつぶさず上位に伝搬させる。これにより通知失敗を検知し、運用上の混乱を防ぐ。CheckCallbacksはafter_create_commitで実行されるため、例外発生時にはCheckとステータス更新はすでにコミット済みであり、ユーザーにはエラーメッセージが表示されるが、DBには変更が残る状態になる。
Applied to files:
test/system/corporate_training_inquiry_system_test.rb
📚 Learning: 2025-10-22T06:04:36.036Z
Learnt from: sjabcdefin
Repo: fjordllc/bootcamp PR: 9247
File: app/controllers/checks_controller.rb:0-0
Timestamp: 2025-10-22T06:04:36.036Z
Learning: ChecksController#createおよび#destroyでは、Checkの作成・削除とActiveSupport::Notifications.instrumentによるイベント発行(プラクティスのステータス更新)を同一トランザクション内で実行し、いずれかが失敗した場合は両方をロールバックする。これによりWebUI表示とDB状態の整合性を保証している。
Applied to files:
test/system/corporate_training_inquiry_system_test.rb
📚 Learning: 2025-07-15T12:58:02.735Z
Learnt from: reckyy
Repo: fjordllc/bootcamp PR: 8356
File: app/models/notification.rb:45-47
Timestamp: 2025-07-15T12:58:02.735Z
Learning: fjordllc/bootcampプロジェクトの`app/models/notification.rb`において、`training_completed`通知種別は`TARGETS_TO_KINDS`ハッシュに含めない設計になっている。これは`training_completed`が通知一覧のフィルタ対象ではないためで、意図的な設計判断である。
Applied to files:
test/system/corporate_training_inquiry_system_test.rb
📚 Learning: 2025-09-04T01:39:22.261Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: app/controllers/mentor/buzzes_controller.rb:0-0
Timestamp: 2025-09-04T01:39:22.261Z
Learning: fjordllc/bootcamp プロジェクトでは、更新処理の成功時の通知メッセージについて、I18n を使用せずに日本語文字列を直接記述する方針で一貫性を保っている。
Applied to files:
test/system/corporate_training_inquiry_system_test.rb
📚 Learning: 2025-09-08T04:55:46.649Z
Learnt from: sharoa119
Repo: fjordllc/bootcamp PR: 8711
File: db/schema.rb:0-0
Timestamp: 2025-09-08T04:55:46.649Z
Learning: In this PR, the removal of length limits from companies.name and companies.website columns in db/schema.rb was unintentional - it was a case of accidentally lost constraints that needed to be restored to their original limits, not a deliberate design change.
Applied to files:
db/schema.rb
📚 Learning: 2025-09-11T14:47:53.256Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/product.rb:59-61
Timestamp: 2025-09-11T14:47:53.256Z
Learning: Rails アップグレードPRでは、アップグレードに直接関連しない性能改善や機能追加の提案は避けるべき。PRのスコープを維持することが重要で、そのような改善提案は別PRで対応すべきである。
Applied to files:
Gemfile
📚 Learning: 2025-09-04T01:50:47.773Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/migrate/20250831234516_remove_unique_index_from_buzzes_title.rb:1-5
Timestamp: 2025-09-04T01:50:47.773Z
Learning: fjordllc/bootcampプロジェクトでは、マイグレーションにおいてdisable_ddl_transaction!やalgorithm: :concurrentlyは使用せず、標準的なRailsのchangeメソッド内でremove_indexを実行する慣例がある。
Applied to files:
Gemfile
📚 Learning: 2025-07-07T05:28:03.676Z
Learnt from: su-su-su-su
Repo: fjordllc/bootcamp PR: 0
File: :0-0
Timestamp: 2025-07-07T05:28:03.676Z
Learning: fjordllc/bootcampプロジェクトでは、fixtureファイル内のERB構文で改行制御文字(-)は使用せず、標準的な<% %>と<%= %>のみを使用する方針が統一されている。<% -%>や<%- %>を使用するとSyntaxErrorが発生する。
Applied to files:
Gemfile
📚 Learning: 2025-11-17T00:46:30.794Z
Learnt from: tyrrell-IH
Repo: fjordllc/bootcamp PR: 9306
File: app/javascript/components/Bookmarks.jsx:248-265
Timestamp: 2025-11-17T00:46:30.794Z
Learning: fjordllc/bootcamp プロジェクトでは、Reactからバニラ JavaScript への移行作業が進行中である。そのため、新しいReactファイルの作成は避け、既存のReactコンポーネント内で完結する実装が推奨される。BookmarksInDashboard.jsx は issue #9045 で削除予定。
Applied to files:
Gemfile
📚 Learning: 2025-09-11T14:18:20.194Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: db/migrate/20250828192202_add_missing_columns_to_good_jobs.rb:4-10
Timestamp: 2025-09-11T14:18:20.194Z
Learning: GoodJobやその他の外部gemが生成するマイグレーションファイルは、gem内部のロジックと密接に連携しているため、null制約やデフォルト値の追加などの変更を行うべきではない。gemのアップグレードパスに従い、生成されたマイグレーションをそのまま使用することが適切。
Applied to files:
Gemfile
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Pull requests should include clear description, linked issues, screenshots for UI changes, migration notes, and rollback plan if relevant
Applied to files:
Gemfile
📚 Learning: 2025-06-21T22:30:20.116Z
Learnt from: tyrrell-IH
Repo: fjordllc/bootcamp PR: 8807
File: app/views/welcome/job_support.html.slim:391-392
Timestamp: 2025-06-21T22:30:20.116Z
Learning: このプロジェクトにはRailsの組み込みmarkdownヘルパが利用できないため、markdownのHTML変換には自前でヘルパを実装する必要がある。
Applied to files:
Gemfile
🧬 Code graph analysis (2)
test/system/corporate_training_inquiry_system_test.rb (1)
test/system/notification/assigned_as_checker_test.rb (1)
deliveries(15-17)
config/environments/production.rb (1)
config/application.rb (1)
config(10-56)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build_and_test
🔇 Additional comments (34)
test/system/notification/tabs_badges_test.rb (1)
61-85: テスト assertion の改善を承認
findからassert_selectorへの変更により、テストの意図がより明確になり、Capybara + Minitest のベストプラクティスに沿った実装になっています。特に、同ファイル内の2つ目のテストメソッドが既にassert_no_selectorを使用しているため、この変更によりファイル全体の一貫性も向上しています。test/system/corporate_training_inquiry_system_test.rb (2)
12-12: 前回のレビューコメントが適切に対応されています
ActionMailer::Base.deliveries.clearを setup で実行することで、他のテストで送信されたメールの影響を受けない決定性の高いテストになりました。
35-41: テストフローの改善が適切に実装されていますアクション実行後に成功メッセージの表示を確認してからメール配信を検証する流れは、より論理的で保守性の高いテスト構造です。ユーザー目線の検証(画面表示)を先に行い、その後でシステムの副作用(メール送信)を確認する順序は適切です。
app/models/ai/answer_generator.rb (1)
3-3: LGTM: Zeitwerk準拠のネームスペース変更Rails 8.xのZeitwerkオートローディングに準拠するため、
AIからAiへの変更は正しく実装されています。ファイルパスapp/models/ai/に対応する正しいモジュール名です。app/models/ai_answer_creator.rb (1)
3-7: LGTM: クラス名とジョブ参照の一貫した更新
AIAnswerCreatorからAiAnswerCreatorへの変更、およびAiAnswerCreateJobへの参照更新は正しく実装されています。Zeitwerk準拠の命名規則に従っており、関連するテストファイルの問題も解決済みです。test/models/ai/answer_generator_test.rb (1)
5-9: LGTM: テストのネームスペース更新が正確モジュール宣言とインスタンス化の両方で
Aiネームスペースへの更新が正しく行われています。プロダクションコードの変更と一貫性があります。test/jobs/ai_answer_create_job_test.rb (1)
5-10: LGTM: ジョブテストの命名更新が完了テストクラス名とジョブ呼び出しの両方が正しく更新されています。以前指摘された問題は解決済みで、変更はジョブクラスのリネームと一貫性があります。
app/jobs/ai_answer_create_job.rb (1)
3-9: LGTM: ジョブクラスとジェネレータ参照の一貫した更新
AiAnswerCreateJobへのクラス名変更とAi::AnswerGeneratorへの参照更新は正しく実装されています。コードベース全体で一貫性のある Zeitwerk 準拠の命名規則への移行が完了しています。config/initializers/active_support_notifications.rb (1)
56-58: Zeitwerk規約への対応が適切に完了しています。
AIAnswerCreatorからAiAnswerCreatorへのクラス名変更は、Rails 8.1のZeitwerkの厳格な命名規約に正しく準拠しています。頭字語(AI)を通常の単語(Ai)として扱う必要があり、ファイル名ai_answer_creator.rbとクラス名AiAnswerCreatorが正しく対応しています。検証の結果、コードベース内に古いクラス名への参照は残っていません。
test/system/admin/users_test.rb (3)
181-200: 退会フローのテスト更新が適切です。Rails 8.1対応のため、以下の変更が行われています:
- Stripe API呼び出しを回避するため、subscription_idとcustomer_idをクリア(テストセットアップとして適切)
- Discord チャンネル削除をスタブ化してテストを分離
- times_id がクリアされることを検証
update_columnsの使用はテストのセットアップとしては許容範囲で、コメントも適切です。
232-253: 卒業フローのテスト更新が適切です。Rails 8.1対応のため、Stripe APIスタブが追加され、
Card.destroy_allのスタブ内でテストが実行されています。assert_requestedによる検証も正しく、Stripeに送信されるリクエストボディにcancel_at_period_end=trueが含まれることを確認しています。
315-323: 研修終了日の更新テストが適切に修正されています。Rails 8.1対応のため、
click_on '更新する'からfind('#user_submit').clickに変更され、JavaScriptによるフォーム送信に対応しています。アサーションも正しく、成功メッセージと保存されたデータを検証しています。Gemfile (4)
8-13: Rails 8.1.1 へのコア依存関係の更新を承認します。
bootsnap: バージョン制約の解除は問題ありません。最新の Rails と互換性があります。image_processing: CVE-2022-24720 に対応した適切なバージョン制約です。puma:>= 5.0は Rails 8 との互換性を確保しています。rails: 8.1.1 へのアップグレードは本 PR の主目的です。
70-74: rails-i18n と react-rails の変更を承認します。
rails-i18n: Rails 8 対応のためバージョン制約を解除するのは適切です。react-rails: 特定コミットへのピン留めと TODO コメントで将来の対応方針が明確になっています。connection_pool 3.0 互換性問題の一時的な回避策として適切です。
91-102: 開発・テストツールの追加を承認します。RuboCop 関連の gem と静的解析ツールが適切に
require: falseで追加されています。CI での実行対応として妥当な変更です。
109-113: development グループの変更を承認します。
listen: ファイル監視のための標準的な Rails 開発依存関係です。web-console: バージョン制約の解除は Rails 8 互換性のために適切です。config/initializers/inflections.rb (3)
1-1: frozen_string_literalの追加は良い改善ですこの設定により文字列リテラルが自動的に凍結され、パフォーマンスとメモリ効率が向上します。Ruby/Railsのベストプラクティスに沿った変更です。
17-20: 引用符のスタイル変更は適切ですダブルクォートからシングルクォートへの変更は、Rubyの慣例に従っており、RubocopのStyle/StringLiteralsルールにも準拠しています。補間やエスケープシーケンスが不要な文字列にはシングルクォートを使用するのが推奨されます。
17-20: AI生成サマリーとコードの不一致AI生成サマリーには「api, ai, faq, buzz, and progressのエントリー」と記載されていますが、現在のコードには
'ai'または'AI'のacronym定義が存在しません。PRの目的に「Zeitwerk 規約に伴う名前空間/クラス名変更(AI → Ai)」と記載されていることから、inflect.acronym 'AI'が意図的に削除された可能性があります(ZeitwerkはAIよりもAiを推奨するため)。サマリーには削除について言及すべきでした。db/schema.rb (3)
13-16: Rails 8.1へのスキーマバージョン更新が正しく行われています。
ActiveRecord::Schema[8.1]への更新と、マイグレーションタイムスタンプの更新が適切です。また、pg_catalog.plpgsqlの明示的な有効化はRails 8.1の標準的な動作です。
1138-1143: SolidQueue外部キーの設定は適切ですが、前述の不整合に依存します。SolidQueueテーブルへの外部キー制約は
on_delete: :cascadeが設定されており、ジョブの実行ライフサイクル管理には適切な設定です。ただし、これらの外部キーはSolidQueueを使用する場合にのみ必要です。前のコメントで指摘した不整合が解決され、SolidQueueを使用することが確認された場合、この設定は問題ありません。
756-875: スキーマの内容を確認してください。PR目的「good_jobを維持」と一致するか確認が必要です。実際のリポジトリ設定では、Gemfile に
gem 'good_job', '~> 4.5'が含まれ、development/production環境でconfig.active_job.queue_adapter = :good_jobが設定されており、最近のマイグレーションはすべて good_job 用です。提示されたスキーマスニペット(lines 756-875)が実際の db/schema.rb と一致しているか確認してください。
.cloudbuild/cloudbuild-staging.yaml (1)
127-128: リトライパラメータの調整を確認しました。データベース削除のリトライ回数と待機時間が拡大されました(最大5回/5秒間隔 → 12回/10秒間隔)。これはRails 8.1へのアップグレードに伴い、データベース接続の切断に時間がかかる可能性に対応した妥当な運用調整です。
test/test_helper.rb (2)
22-26: リトライ設定の柔軟性向上を確認しました。CI環境だけでなく、ローカル環境でも
MINITEST_RETRY_COUNT環境変数を使用してテストのリトライを有効化できるようになりました。これはテストの安定性向上に役立つ改善です。
31-35: 並列テスト設定の改善を確認しました。並列テスト実行が
PARALLEL_WORKERS環境変数で制御可能になり、既知の問題(Rails issue #55513)を避けるため安全にデフォルト値1が設定されています。CI環境でもCircleCIの並列実行設定を優先する設計で、適切な実装です。config/environments/development.rb (4)
6-7: コード再読み込み設定のコメント改善を確認しました。サーバー再起動なしで即座に反映される旨を明示したコメント更新です。開発者体験の向上に寄与する適切な文書化です。
18-29: キャッシュ設定の更新を確認しました。Rails 8.1へのアップグレードに伴う以下の変更が適切に行われています:
- ヘッダーキーの小文字化(
"cache-control")はRack 3.xの規約に準拠cache_storeの設定を条件分岐の外に移動し、グローバルな設定として明示化- コメントがAction Controllerキャッシングの切り替えを明確に説明
60-61: Rails 8.1の新機能追加を確認しました。SQLクエリにランタイム情報タグをコメントとして追加する
query_log_tags_enabledが有効化されました。開発環境でのデバッグ体験向上に役立つRails 8.1の新機能です。
74-75: リダイレクトログの詳細化を確認しました。
verbose_redirect_logsの有効化により、リダイレクトをトリガーしたコードの位置がログに記録されるようになりました。開発時のデバッグ効率を向上させるRails 8.1の機能です。config/environments/production.rb (3)
9-19: 本番環境の基本設定更新を確認しました。Rails 8.1アップグレードに伴う以下の変更が適切です:
- Eager loadingの動作説明の明確化
- ダイジェスト付きアセットの長期キャッシュ設定
- ヘッダーキーの小文字化(
"cache-control")によるRack 3.x準拠
36-47: ログ設定とヘルスチェックの改善を確認しました。Rails 8.1の新機能が適切に設定されています:
- リクエストIDをデフォルトのログタグとして追加
- ヘルスチェックエンドポイント(
/up)のログノイズ抑制- 本番環境での非推奨警告の無効化
これらは本番環境における標準的なベストプラクティスです。
90-115: 本番環境のホスト設定とバリデーションを確認しました。本番環境での適切な設定管理が実装されています:
- 起動時に
APP_HOST_NAMEの必須バリデーション(アセットプリコンパイル時を除く)- メイラーとコントローラーのアセットホストをHTTPSで統一設定
- Cloud Runホストとアプリケーションホストをホワイトリストに追加
- ルーティングのデフォルトURLオプションをHTTPSプロトコルで設定
これらはセキュアな本番環境運用に必要な設定です。
test/system/practices/mentor_test.rb (2)
90-97: 成功メッセージのアサーション追加、Good!完了画像アップロード後に成功メッセージを検証する
assert_textが追加されており、ユーザーフィードバックの確認として適切です。他のテストケース(73行目、86行目)とも一貫性があります。
99-101: フォームセレクタの改善、Good!
assert_selectorで'form[name=practice]'を使用することで、より具体的なフォームを検証しています。これはテストの精度向上につながります。また、99行目のvisit_with_authへの変更も過去のレビューで指摘された通り正しく対応されています。
There was a problem hiding this comment.
Actionable comments posted: 1
Fix all issues with AI Agents 🤖
In @db/schema.rb:
- Around line 756-875: The schema.rb currently contains legacy solid_queue_*
table definitions (e.g., solid_queue_jobs, solid_queue_ready_executions,
solid_queue_semaphores, solid_queue_blocked_executions, etc.) that do not match
the app which uses GoodJob; remove all solid_queue_* table definitions and
regenerate schema.rb so it reflects the actual migrations (good_job_* tables).
Specifically, delete the create_table blocks for solid_queue_* and then run the
Rails schema dump (rails db:migrate && rails db:schema:dump or rails db:prepare
followed by rake db:schema:dump) to produce a schema.rb containing the
good_job_* table definitions matching the latest migrations.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
config/environments/production.rb (1)
107-115:app_host_nameがnilの場合のガード処理を追加してください108行目と114行目で
app_host_nameを無条件に使用していますが、asset precompilation時(SECRET_KEY_BASE == "dummy")にAPP_HOST_NAMEが設定されていない場合、app_host_nameはnilになります。
- 108行目:
config.hosts << nilが実行される可能性- 114行目:
default_url_options[:host] = nilが設定される可能性98-102行目や107行目のように、
.present?チェックを追加してください。🔎 修正案
config.hosts << ENV["CLOUD_RUN_HOST_NAME"] if ENV["CLOUD_RUN_HOST_NAME"] -config.hosts << app_host_name +config.hosts << app_host_name if app_host_name.present? AnyLogin.setup do |config| config.enabled = false end -Rails.application.routes.default_url_options[:host] = app_host_name -Rails.application.routes.default_url_options[:protocol] = 'https' +if app_host_name.present? + Rails.application.routes.default_url_options[:host] = app_host_name + Rails.application.routes.default_url_options[:protocol] = 'https' +end
♻️ Duplicate comments (1)
config/environments/production.rb (1)
49-50: キャッシュストア設定とコメントの矛盾が未解決です過去のレビューで指摘されていますが、49行目のコメントは「durable alternative(永続的な代替手段)」への変更を推奨しているにもかかわらず、50行目の実装は依然として
:memory_store(非永続的なインメモリキャッシュ)のままです。以下のいずれかで対応してください:
- コメントの意図通り、RedisやMemcachedなどの永続的なキャッシュストアに変更する
- または、
memory_storeが意図的な選択であれば、コメントを実装に合わせて更新する
🧹 Nitpick comments (1)
test/system/admin/users_test.rb (1)
315-323: セレクタ変更の意図を確認することをお勧めします。
click_on '更新する'からfind('#user_submit').clickへの変更は、より明示的なセレクタ使用によるテストの安定性向上と思われます。ただし、この変更が以下のいずれかに起因する場合は、根本原因への対処も検討する価値があります:
- 同じテキストを持つ複数のボタンが存在する(DOM構造の問題)
- JavaScriptのタイミング問題(Capybaraの待機設定の見直し)
現状の実装は機能的には問題ありませんが、他のテストでも同様のパターンが必要になる場合は、根本的な改善を検討してください。
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
Gemfile.lockis excluded by!**/*.lock
📒 Files selected for processing (20)
.cloudbuild/cloudbuild-staging.yamlGemfileapp/jobs/ai_answer_create_job.rbapp/models/ai/answer_generator.rbapp/models/ai_answer_creator.rbconfig/ci.rbconfig/environments/development.rbconfig/environments/production.rbconfig/initializers/active_support_notifications.rbconfig/initializers/inflections.rbdb/schema.rbtest/jobs/ai_answer_create_job_test.rbtest/models/ai/answer_generator_test.rbtest/system/admin/users_test.rbtest/system/corporate_training_inquiry_system_test.rbtest/system/notification/tabs_badges_test.rbtest/system/practices/mentor_test.rbtest/system/product/unchecked_test.rbtest/system/regular_events/announcement_test.rbtest/test_helper.rb
🚧 Files skipped from review as they are similar to previous changes (5)
- test/system/corporate_training_inquiry_system_test.rb
- test/system/practices/mentor_test.rb
- test/test_helper.rb
- config/ci.rb
- config/environments/development.rb
🧰 Additional context used
📓 Path-based instructions (7)
test/**/*_test.rb
📄 CodeRabbit inference engine (AGENTS.md)
test/**/*_test.rb: Test suite should use Minitest with structure:system/,models/,controllers/, and fixtures intest/fixtures/; test files should be named*_test.rb
Use Minitest + Capybara for system tests; place unit and integration tests under matchingtest/*directories
Files:
test/system/notification/tabs_badges_test.rbtest/models/ai/answer_generator_test.rbtest/system/regular_events/announcement_test.rbtest/jobs/ai_answer_create_job_test.rbtest/system/admin/users_test.rbtest/system/product/unchecked_test.rb
**/*.rb
📄 CodeRabbit inference engine (AGENTS.md)
Ruby code should use 2-space indentation, snake_case for method names, and CamelCase for class names, enforced by RuboCop (
.rubocop.yml)
Files:
test/system/notification/tabs_badges_test.rbtest/models/ai/answer_generator_test.rbconfig/initializers/inflections.rbapp/models/ai/answer_generator.rbapp/jobs/ai_answer_create_job.rbtest/system/regular_events/announcement_test.rbtest/jobs/ai_answer_create_job_test.rbtest/system/admin/users_test.rbconfig/initializers/active_support_notifications.rbdb/schema.rbapp/models/ai_answer_creator.rbtest/system/product/unchecked_test.rbconfig/environments/production.rb
⚙️ CodeRabbit configuration file
**/*.rb: # refactoring
- まずFat Controllerを避け、次にFat Modelを避ける。
- Serviceクラスの乱用を避ける。
- controller concernを作ろうとしたらPORO(Plain Old Ruby Object)やActiveRecordモデルでの実装で代替できないか検討する。
Rails Patterns
- ViewHelperにメソッドを実装する時にはまずDecoratorパターンを使うことを検討する。(active_decorator gemを導入しているのでそれを使う)
- 複雑なActiveRecordクエリがあり、再利用できそうな場合はQueryObjectパターンを検討する。(rails-patterns gemを導入しているのでそれのQuery機能を使う)
- Viewにpartialを作る場合はViewComponentを使うことを検討する。
- 複数のActiveRecordモデルを操作する1つの責務がある時や外部APIとやりとりする処理がある場合にはInteractorオブジェクトパターンを検討する。(interactor gemを導入しているのでそれを使う)
- 複数のInteractorを実行するような処理がある場合Organizerオブジェクトパターンを検討する。(interactor gemを導入しており、その中にOrganizerの機能があるので使う)
Files:
test/system/notification/tabs_badges_test.rbtest/models/ai/answer_generator_test.rbconfig/initializers/inflections.rbapp/models/ai/answer_generator.rbapp/jobs/ai_answer_create_job.rbtest/system/regular_events/announcement_test.rbtest/jobs/ai_answer_create_job_test.rbtest/system/admin/users_test.rbconfig/initializers/active_support_notifications.rbdb/schema.rbapp/models/ai_answer_creator.rbtest/system/product/unchecked_test.rbconfig/environments/production.rb
test/**
📄 CodeRabbit inference engine (AGENTS.md)
Keep tests deterministic and use fixtures stored in
test/fixtures/for test data
Files:
test/system/notification/tabs_badges_test.rbtest/models/ai/answer_generator_test.rbtest/system/regular_events/announcement_test.rbtest/jobs/ai_answer_create_job_test.rbtest/system/admin/users_test.rbtest/system/product/unchecked_test.rb
test/**/*
⚙️ CodeRabbit configuration file
test/**/*: # Test
- TestCase名は英語で書く。
- どうしても避けられない時以外にsystem testでsleepは使わない。
Unit Test
model, helper, decorator, view_componentについてはメソッドを追加した場合は必ず対応したUnit TestのTestCaseを1つは書く。
Files:
test/system/notification/tabs_badges_test.rbtest/models/ai/answer_generator_test.rbtest/system/regular_events/announcement_test.rbtest/jobs/ai_answer_create_job_test.rbtest/system/admin/users_test.rbtest/system/product/unchecked_test.rb
config/**
📄 CodeRabbit inference engine (AGENTS.md)
Configuration files in
config/should include environment settings, routes, and lints (.rubocop.yml,config/slim_lint.yml)
Files:
config/initializers/inflections.rbconfig/initializers/active_support_notifications.rbconfig/environments/production.rb
app/**/*.{rb,js,ts,jsx,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Rails app code should be organized in
app/directory with subdirectories:models/,controllers/,views/,jobs/,helpers/, and frontend code underjavascript/(Shakapacker)
Files:
app/models/ai/answer_generator.rbapp/jobs/ai_answer_create_job.rbapp/models/ai_answer_creator.rb
db/**
📄 CodeRabbit inference engine (AGENTS.md)
Database migrations and schema should be stored in
db/directory; app-specific utilities inlib/; static assets inpublic/
Files:
db/schema.rb
🧠 Learnings (29)
📓 Common learnings
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/product.rb:59-61
Timestamp: 2025-09-11T14:47:53.256Z
Learning: Rails アップグレードPRでは、アップグレードに直接関連しない性能改善や機能追加の提案は避けるべき。PRのスコープを維持することが重要で、そのような改善提案は別PRで対応すべきである。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:52-56
Timestamp: 2025-09-12T21:17:45.295Z
Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9115
File: db/migrate/20250902024949_add_unique_index_to_correct_answers.rb:1-5
Timestamp: 2025-11-13T09:20:36.030Z
Learning: fjordllc/bootcamp プロジェクトでは、データの整合性を保つためのデータ修正には data-migrate gem を使用し、db/data/ ディレクトリ配下にデータマイグレーションファイルを作成する運用を採用している。スキーマ変更(db/migrate/)とデータ変更(db/data/)を分離することで、より安全で管理しやすい構成を実現している。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: config/initializers/sorcery.rb:0-0
Timestamp: 2025-09-11T16:02:24.782Z
Learning: Rails アップグレードPRにおいて、JWT設定の改善では複数のソース(secrets, credentials, ENV)を優先順位付きで検索し、本番環境では未設定時に起動を停止させる実装が推奨される。開発・テスト環境でのみsecret_key_baseフォールバックを許可する構成が安全である。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:19-23
Timestamp: 2025-09-12T21:17:26.029Z
Learning: Rails アップグレードPRにおいて、config_for(:secrets) を使った webhook URL 設定の shared セクション未参照問題は、設定システム全体の変更として別PRで対応すべきである。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/migrate/20250831234516_remove_unique_index_from_buzzes_title.rb:1-5
Timestamp: 2025-09-04T01:50:47.773Z
Learning: fjordllc/bootcampプロジェクトでは、マイグレーションにおいてdisable_ddl_transaction!やalgorithm: :concurrentlyは使用せず、標準的なRailsのchangeメソッド内でremove_indexを実行する慣例がある。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: app/controllers/mentor/buzzes_controller.rb:0-0
Timestamp: 2025-09-04T01:39:22.261Z
Learning: fjordllc/bootcamp プロジェクトでは、更新処理の成功時の通知メッセージについて、I18n を使用せずに日本語文字列を直接記述する方針で一貫性を保っている。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: db/migrate/20250828192202_add_missing_columns_to_good_jobs.rb:4-10
Timestamp: 2025-09-11T14:18:20.194Z
Learning: GoodJobやその他の外部gemが生成するマイグレーションファイルは、gem内部のロジックと密接に連携しているため、null制約やデフォルト値の追加などの変更を行うべきではない。gemのアップグレードパスに従い、生成されたマイグレーションをそのまま使用することが適切。
Learnt from: mousu-a
Repo: fjordllc/bootcamp PR: 8566
File: db/migrate/20250830033535_add_default_to_pair_works_wip.rb:1-5
Timestamp: 2025-08-31T03:17:44.812Z
Learning: 新機能のマイグレーションで、まだ本番環境にリリースされていない場合は、既存レコードのバックフィル処理は不要。開発環境でrails db:resetが可能な状況では特に、デフォルト値の変更のみで十分。
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to test/**/*_test.rb : Use Minitest + Capybara for system tests; place unit and integration tests under matching `test/*` directories
Applied to files:
test/system/notification/tabs_badges_test.rbGemfile
📚 Learning: 2025-09-04T01:27:23.422Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/fixtures/buzzes.yml:0-0
Timestamp: 2025-09-04T01:27:23.422Z
Learning: The buzz_controller.rb was indeed deleted, but there are still two remaining items from the old buzz single page implementation that need cleanup: the data migration file db/data/20230726024528_create_buzz.rb and the old buzz route in config/routes.rb line 136. These should be updated/removed to complete the buzz page redesign migration.
Applied to files:
config/initializers/inflections.rbdb/schema.rb
📚 Learning: 2025-09-04T01:27:23.422Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/fixtures/buzzes.yml:0-0
Timestamp: 2025-09-04T01:27:23.422Z
Learning: The buzz_controller.rb and related data migration files were deleted as part of the Buzz page redesign, not just modified. The old single buzz page was completely replaced with a new buzzes (plural) listing page with year-based navigation and metadata structure.
Applied to files:
config/initializers/inflections.rb
📚 Learning: 2025-07-26T15:24:14.799Z
Learnt from: su-su-su-su
Repo: fjordllc/bootcamp PR: 0
File: :0-0
Timestamp: 2025-07-26T15:24:14.799Z
Learning: fjordllc/bootcampプロジェクトでは、Rubyの述語メソッドには?を付ける命名規則(例: can_be_checker?)を徹底している。
Applied to files:
config/initializers/inflections.rb
📚 Learning: 2025-09-12T21:18:00.834Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Applied to files:
test/system/regular_events/announcement_test.rbtest/system/product/unchecked_test.rbconfig/environments/production.rbGemfile
📚 Learning: 2025-10-22T06:04:36.036Z
Learnt from: sjabcdefin
Repo: fjordllc/bootcamp PR: 9247
File: app/controllers/checks_controller.rb:0-0
Timestamp: 2025-10-22T06:04:36.036Z
Learning: ChecksController#createおよび#destroyでは、Checkの作成・削除とActiveSupport::Notifications.instrumentによるイベント発行(プラクティスのステータス更新)を同一トランザクション内で実行し、いずれかが失敗した場合は両方をロールバックする。これによりWebUI表示とDB状態の整合性を保証している。
Applied to files:
test/system/regular_events/announcement_test.rb
📚 Learning: 2025-08-31T23:39:23.210Z
Learnt from: mousu-a
Repo: fjordllc/bootcamp PR: 8566
File: app/views/pair_works/_body.html.slim:111-117
Timestamp: 2025-08-31T23:39:23.210Z
Learning: PairWorkモデルにreserved_at_in_schedules?カスタムバリデーション(on: :update)が実装されており、reserved_atが必ずschedules.map(&:proposed_at)に含まれることを検証している。これにより、フォームから任意の日時を送信することを防いでいる。
Applied to files:
test/system/regular_events/announcement_test.rbtest/system/admin/users_test.rb
📚 Learning: 2025-09-12T21:17:26.029Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:19-23
Timestamp: 2025-09-12T21:17:26.029Z
Learning: Rails アップグレードPRにおいて、config_for(:secrets) を使った webhook URL 設定の shared セクション未参照問題は、設定システム全体の変更として別PRで対応すべきである。
Applied to files:
test/system/regular_events/announcement_test.rbconfig/environments/production.rbGemfile
📚 Learning: 2025-09-12T21:16:47.639Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Applied to files:
test/system/regular_events/announcement_test.rbconfig/environments/production.rbGemfile
📚 Learning: 2025-07-23T20:31:13.856Z
Learnt from: jun-kondo
Repo: fjordllc/bootcamp PR: 8977
File: app/controllers/reports_controller.rb:63-63
Timestamp: 2025-07-23T20:31:13.856Z
Learning: fjordllc/bootcampプロジェクトの`app/controllers/reports_controller.rb`において、`create`と`update`アクションは両方とも`report.save_uniquely`を使用し、同じ`:report_save`イベントと`'report.save'`イベントを発行する。これは両方とも本質的に「レポートの保存」操作であり、作成と更新を区別する必要がないためである。
Applied to files:
test/system/regular_events/announcement_test.rb
📚 Learning: 2025-09-01T22:31:57.345Z
Learnt from: matuaya
Repo: fjordllc/bootcamp PR: 9108
File: app/models/after_user_retirement.rb:0-0
Timestamp: 2025-09-01T22:31:57.345Z
Learning: fjordllc/bootcampプロジェクトにおいて、`Newspaper.publish(:retirement_create, { user: user })`はUnfinishedDataDestroyer(未チェックProduct・WIP Report削除、career_pathリセット)とTimesChannelDestroyer(Discord分報チャンネル削除)による重要なデータクリーンアップ処理を実行するため、退会のトリガーが何であろうと(admin、hibernation、user)必ず実行する必要がある。
Applied to files:
test/system/admin/users_test.rb
📚 Learning: 2025-09-01T22:31:57.345Z
Learnt from: matuaya
Repo: fjordllc/bootcamp PR: 9108
File: app/models/after_user_retirement.rb:0-0
Timestamp: 2025-09-01T22:31:57.345Z
Learning: fjordllc/bootcampプロジェクトにおいて、`Newspaper.publish(:retirement_create, { user: user })`は通知処理ではなく、UnfinishedDataDestroyerやTimesChannelDestroyer等による重要なデータクリーンアップ処理を実行するため、管理者による退会(triggered_by: 'admin')の場合でも必ず実行する必要がある。
Applied to files:
test/system/admin/users_test.rb
📚 Learning: 2025-08-31T12:08:33.904Z
Learnt from: thmz337
Repo: fjordllc/bootcamp PR: 9103
File: app/views/generations/_user.html.slim:6-14
Timestamp: 2025-08-31T12:08:33.904Z
Learning: app/views/generations/_user.html.slimの非アクティブメッセージ表示では、退会・休会・非アクティブの3つの条件が独立して評価され、複数のメッセージが同時に表示される仕様になっている。これは意図的な設計である。
Applied to files:
test/system/admin/users_test.rb
📚 Learning: 2025-07-15T12:33:04.885Z
Learnt from: reckyy
Repo: fjordllc/bootcamp PR: 8356
File: db/fixtures/users.yml:823-826
Timestamp: 2025-07-15T12:33:04.885Z
Learning: fjordllc/bootcampプロジェクトでは、`trainee: true`は「研修に所属していたユーザー」全体を示すフラグであり、研修中のユーザーと研修を終了したユーザーの両方を含む。そのため、`trainee: true`と`training_completed_at`の併存は意図された仕様であり、排他的な関係ではない。
Applied to files:
test/system/admin/users_test.rb
📚 Learning: 2025-11-25T05:42:10.478Z
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9323
File: app/models/question_auto_closer.rb:45-51
Timestamp: 2025-11-25T05:42:10.478Z
Learning: fjordllc/bootcamp の QuestionAutoCloser において、create_warning_message で発行される 'answer.create' イベントは、システムユーザーによる自動クローズ警告メッセージを質問者と既存の監視者に通知するための意図的な設計である。AnswerNotifier と NotifierToWatchingUser による通知は期待される動作。
Applied to files:
config/initializers/active_support_notifications.rb
📚 Learning: 2025-09-08T04:55:46.649Z
Learnt from: sharoa119
Repo: fjordllc/bootcamp PR: 8711
File: db/schema.rb:0-0
Timestamp: 2025-09-08T04:55:46.649Z
Learning: In this PR, the removal of length limits from companies.name and companies.website columns in db/schema.rb was unintentional - it was a case of accidentally lost constraints that needed to be restored to their original limits, not a deliberate design change.
Applied to files:
db/schema.rb
📚 Learning: 2025-09-11T16:02:24.782Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: config/initializers/sorcery.rb:0-0
Timestamp: 2025-09-11T16:02:24.782Z
Learning: Rails アップグレードPRにおいて、JWT設定の改善では複数のソース(secrets, credentials, ENV)を優先順位付きで検索し、本番環境では未設定時に起動を停止させる実装が推奨される。開発・テスト環境でのみsecret_key_baseフォールバックを許可する構成が安全である。
Applied to files:
config/environments/production.rbGemfile
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to config/** : Configuration files in `config/` should include environment settings, routes, and lints (`.rubocop.yml`, `config/slim_lint.yml`)
Applied to files:
config/environments/production.rb
📚 Learning: 2025-09-12T21:17:45.295Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:52-56
Timestamp: 2025-09-12T21:17:45.295Z
Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Applied to files:
config/environments/production.rbGemfile
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Use `bin/setup` for local database setup and dependency installation; avoid manual tweaks in `config/` without team discussion
Applied to files:
config/environments/production.rb
📚 Learning: 2025-09-11T14:47:53.256Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/product.rb:59-61
Timestamp: 2025-09-11T14:47:53.256Z
Learning: Rails アップグレードPRでは、アップグレードに直接関連しない性能改善や機能追加の提案は避けるべき。PRのスコープを維持することが重要で、そのような改善提案は別PRで対応すべきである。
Applied to files:
Gemfile
📚 Learning: 2025-11-13T09:20:36.030Z
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9115
File: db/migrate/20250902024949_add_unique_index_to_correct_answers.rb:1-5
Timestamp: 2025-11-13T09:20:36.030Z
Learning: fjordllc/bootcamp プロジェクトでは、データの整合性を保つためのデータ修正には data-migrate gem を使用し、db/data/ ディレクトリ配下にデータマイグレーションファイルを作成する運用を採用している。スキーマ変更(db/migrate/)とデータ変更(db/data/)を分離することで、より安全で管理しやすい構成を実現している。
Applied to files:
Gemfile
📚 Learning: 2025-09-04T01:50:47.773Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/migrate/20250831234516_remove_unique_index_from_buzzes_title.rb:1-5
Timestamp: 2025-09-04T01:50:47.773Z
Learning: fjordllc/bootcampプロジェクトでは、マイグレーションにおいてdisable_ddl_transaction!やalgorithm: :concurrentlyは使用せず、標準的なRailsのchangeメソッド内でremove_indexを実行する慣例がある。
Applied to files:
Gemfile
📚 Learning: 2025-07-07T05:28:03.676Z
Learnt from: su-su-su-su
Repo: fjordllc/bootcamp PR: 0
File: :0-0
Timestamp: 2025-07-07T05:28:03.676Z
Learning: fjordllc/bootcampプロジェクトでは、fixtureファイル内のERB構文で改行制御文字(-)は使用せず、標準的な<% %>と<%= %>のみを使用する方針が統一されている。<% -%>や<%- %>を使用するとSyntaxErrorが発生する。
Applied to files:
Gemfile
📚 Learning: 2025-11-17T00:46:30.794Z
Learnt from: tyrrell-IH
Repo: fjordllc/bootcamp PR: 9306
File: app/javascript/components/Bookmarks.jsx:248-265
Timestamp: 2025-11-17T00:46:30.794Z
Learning: fjordllc/bootcamp プロジェクトでは、Reactからバニラ JavaScript への移行作業が進行中である。そのため、新しいReactファイルの作成は避け、既存のReactコンポーネント内で完結する実装が推奨される。BookmarksInDashboard.jsx は issue #9045 で削除予定。
Applied to files:
Gemfile
📚 Learning: 2025-09-11T14:18:20.194Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: db/migrate/20250828192202_add_missing_columns_to_good_jobs.rb:4-10
Timestamp: 2025-09-11T14:18:20.194Z
Learning: GoodJobやその他の外部gemが生成するマイグレーションファイルは、gem内部のロジックと密接に連携しているため、null制約やデフォルト値の追加などの変更を行うべきではない。gemのアップグレードパスに従い、生成されたマイグレーションをそのまま使用することが適切。
Applied to files:
Gemfile
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Pull requests should include clear description, linked issues, screenshots for UI changes, migration notes, and rollback plan if relevant
Applied to files:
Gemfile
📚 Learning: 2025-06-21T22:30:20.116Z
Learnt from: tyrrell-IH
Repo: fjordllc/bootcamp PR: 8807
File: app/views/welcome/job_support.html.slim:391-392
Timestamp: 2025-06-21T22:30:20.116Z
Learning: このプロジェクトにはRailsの組み込みmarkdownヘルパが利用できないため、markdownのHTML変換には自前でヘルパを実装する必要がある。
Applied to files:
Gemfile
🧬 Code graph analysis (1)
app/models/ai_answer_creator.rb (2)
app/models/ai/answer_generator.rb (1)
call(21-36)app/controllers/api/answers_controller.rb (1)
question(58-60)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build_and_test
🔇 Additional comments (22)
test/system/notification/tabs_badges_test.rb (1)
61-85: 変更内容を承認します。
assert_selectorへの変更により、テストの意図がより明確になり、Minitest + Capybaraのベストプラクティスに沿った実装になっています。要素の存在を明示的にアサートすることで、テストの可読性と保守性が向上しています。test/system/regular_events/announcement_test.rb (1)
59-62: 前回の指摘に対する修正が適切に実装されています。
assert_differenceブロック内で WIP ボタンのクリックと成功メッセージの検証を行うように修正されており、RegularEventの作成が正しく検証されています。この実装はデータベースの変更と UI フィードバックの両方を同一のアサーションスコープ内で確認しており、テストの網羅性が向上しています。app/models/ai/answer_generator.rb (1)
3-3: Zeitwerk規約に準拠した名前空間の変更を確認しました。モジュール名を
AIからAiに変更しており、Rails 8のZeitwerk規約に正しく対応しています。関連するテストファイルやジョブクラスも同様に更新されていることを確認しました。test/models/ai/answer_generator_test.rb (1)
5-9: テストコードの名前空間更新を確認しました。プロダクションコードの変更に合わせて、テストのモジュール名とクラスインスタンス化を正しく更新しています。変更は一貫性があり、テストロジックに影響はありません。
config/initializers/active_support_notifications.rb (1)
56-58: イベントサブスクリプションのクラス名更新を確認しました。
AIAnswerCreatorからAiAnswerCreatorへの変更は、app/models/ai_answer_creator.rbのクラス名変更と一致しています。イベントサブスクリプションの構造は変更されておらず、動作に影響はありません。test/jobs/ai_answer_create_job_test.rb (1)
5-10: ジョブテストのクラス名と実行メソッドの更新を確認しました。テストクラス名とジョブ実行メソッドの両方が、
AiAnswerCreateJobの新しい命名規則に正しく更新されています。変更は一貫性があり、過去のレビューコメントで指摘された問題も解決済みです。app/models/ai_answer_creator.rb (1)
3-8: クラス名とジョブ呼び出しの一貫した更新を確認しました。
AIAnswerCreatorからAiAnswerCreatorへのクラス名変更と、AIAnswerCreateJobからAiAnswerCreateJobへのジョブ呼び出しの更新は、コードベース全体の命名規則の統一と一致しています。ロジックに変更はなく、ActiveSupport::Notificationsのサブスクリプションとも正しく連携しています。app/jobs/ai_answer_create_job.rb (2)
3-3: Zeitwerk 規約への対応が正しく実装されています。Rails 8.1 では Zeitwerk のオートローダーがより厳格になっており、
ai_answer_create_job.rbというファイル名に対してAiAnswerCreateJob(AIではなくAi)というクラス名が正しい命名規則です。
9-9: 名前空間の変更が正しく反映されています。
AI::AnswerGeneratorからAi::AnswerGeneratorへの変更は、Zeitwerk 規約への統一的な対応として適切です。関連ファイル(app/models/ai/answer_generator.rbなど)でも同様の変更が行われており、一貫性が保たれています。test/system/product/unchecked_test.rb (1)
62-62: 承認アクションの成功を確認する適切なアサーション追加です。提出物の合格処理後に成功メッセージを検証することで、次の検証(未完了一覧に表示されないこと)を行う前に操作が正常に完了したことを確認できます。Rails 8.1へのアップグレードに伴うテスト安定化の一環として、他のテストファイルでも同様のパターンが適用されており、一貫性のある改善です。
config/initializers/inflections.rb (2)
1-1: frozen_string_literal の追加を承認します。frozen_string_literal の追加は Rails のベストプラクティスに沿っており、文字列のメモリ効率向上に貢献します。
17-20: inflection 設定の更新を承認します。シングルクォートへの変更と既存の inflection ルール('API', 'FAQ', 'buzz'/'buzzes', 'progress')は適切です。AI 名前空間の Ai への変更に伴う inflection の削除は、過去のレビューで確認済みです。
Gemfile (4)
13-13: Rails 8.1.1 へのアップグレードを承認します。Rails のメジャーアップグレードが適切に実施されています。過去のレビューで指摘された以下の問題はすべて対応済みです:
- react-rails は特定のコミット(224d03b8)にピン留めされ、TODO コメントで将来の対応方針が明記されています
- image_processing のセキュリティ脆弱性(CVE-2022-24720)は
'>= 1.12.2', '< 2.0'の制約で対応済みです- ジョブ基盤の変更(solid_queue)は本 PR から除外され、good_job が維持されています
73-74: react-rails の一時的な GitHub 参照を承認します。connection_pool 3.0 との互換性問題に対応するため、特定のコミット(224d03b8)へのピン留めが適切に実施されています。TODO コメントで、互換性修正後に gem 版に戻す方針が明記されており、適切な一時的対応です。
95-101: 開発・テスト環境用 gem の追加を承認します。RuboCop 関連 gem と slim_lint の追加は、PR objectives で言及されている「RuboCop 設定の調整と関連 gem を development,test グループへ移動(CI 実行対応)」に沿った変更であり、Rails アップグレードに伴う CI 基盤整備として適切です。
118-118: minitest のバージョン制約を承認します。
minitest < 6.0の制約は、PR objectives で「Rails 8.1 との互換性のため」と説明されており、アップグレードに必要な対応として適切です。.cloudbuild/cloudbuild-staging.yaml (1)
127-128: リトライ設定の調整が適切ですデータベース削除のリトライ回数と待機時間を増やしたことで、接続クリーンアップの安定性が向上します。Rails 8.1への移行に伴う接続管理の変更に対応した妥当な調整です。
db/schema.rb (3)
13-13: Rails 8.1スキーマバージョンへの更新を確認ActiveRecord::Schema[8.1]への更新は、Rails 8.1へのアップグレードに対応した正しい変更です。
15-15: PostgreSQL拡張の明示的なスキーマ指定Rails 8.1では拡張機能の指定に
pg_catalog.プレフィックスが使用されます。これは自動生成された正しいフォーマットです。
1138-1143: SolidQueueの外部キー制約が適切に設定されています
on_delete: :cascadeポリシーは、ジョブ削除時に関連する実行レコードも自動削除することで、参照整合性を維持します。これはsolid_queue gemが生成する標準的な設定です。test/system/admin/users_test.rb (2)
181-200: テストの分離戦略として適切です。
update_columnsを使用してStripe APIコールを回避する設計は、テストの独立性を保つために妥当です。Discord チャンネル削除のスタブ化、UI成功メッセージの検証、データベース状態の確認が適切に行われています。
232-253: Stripe APIエンドポイントの実装は正確です。このテストコードは正しいです。
POST /v1/subscriptions/{id}はStripe APIのサブスクリプション更新の正しいエンドポイントであり、cancel_at_period_end=trueパラメータは有効です。実装はapp/models/subscription.rbのdestroyメソッドでStripe::Subscription.update(subscription_id, cancel_at_period_end: true)を使用しており、テストのスタブと一致しています。Card.destroy_allはStripe APIをラップしたカスタムクラスのメソッドで、ActiveRecordのdestroy_allではないため、スタブ処理は適切です。
25169a3 to
967a504
Compare
- rails app:update で生成されたファイルを更新 - 新しいフレームワークデフォルト設定を追加 - 環境設定ファイルを更新 - 新しいエラーページとアイコンを追加 - bin/ci, bin/dev などの新しいスクリプトを追加
- AI::AnswerGenerator → Ai::AnswerGenerator - AIAnswerCreateJob → AiAnswerCreateJob - AIAnswerCreator → AiAnswerCreator - inflections.rbからAIアクロニムを削除
- image_processing: >= 1.12.2 に更新 (CVE-2022-24720対応) - react-rails: 特定コミットにピン留め (mainブランチの不安定さを回避) - benchmark gem追加 (Ruby 3.5対応) - rubocop関連gemをdevelopment,testグループに移動
CircleCI: - libheif-devを追加してHEICサポートを有効化 - importmap auditをコメントアウト (将来のimportmap移行用) CloudBuild: - DeleteDBステップのリトライ設定を強化 (12回/10秒間隔)
- 認証が必要なページへのvisitをvisit_with_authに変更 - ActionMailer::Base.deliveriesをsetupでクリア - findをassert_selectorに変更してアサーションを追加 - assert_differenceでDB変更を検証 - fill_optionsの一貫性を確保 - HEICテストのskipを削除 (CIでlibheif対応済み)
- Discord: ActiveSupport::Configurableをclass_attributeに変更 - ReportExporter: Zip::File.open APIの変更に対応 - User: Vips::Errorをrescue対象に追加
7c17f30 to
da1149f
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @bin/setup:
- Around line 18-25: The install branch chooses yarn just because yarn.lock
exists, which fails if the yarn binary is missing; update the conditional that
decides between yarn and npm so it checks for the yarn binary first (e.g., call
system("which yarn > /dev/null 2>&1") before using File.exist?("yarn.lock")),
then call system!("yarn install") only when the yarn command is available,
otherwise fall back to system!("npm install") (optionally verify npm is present
before invoking).
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
bin/setuptest/system/events/crud_test.rbtest/system/regular_events/participation_test.rb
🚧 Files skipped from review as they are similar to previous changes (1)
- test/system/regular_events/participation_test.rb
🧰 Additional context used
📓 Path-based instructions (4)
test/**/*_test.rb
📄 CodeRabbit inference engine (AGENTS.md)
test/**/*_test.rb: Test suite should use Minitest with structure:system/,models/,controllers/, and fixtures intest/fixtures/; test files should be named*_test.rb
Use Minitest + Capybara for system tests; place unit and integration tests under matchingtest/*directories
Files:
test/system/events/crud_test.rb
**/*.rb
📄 CodeRabbit inference engine (AGENTS.md)
Ruby code should use 2-space indentation, snake_case for method names, and CamelCase for class names, enforced by RuboCop (
.rubocop.yml)
Files:
test/system/events/crud_test.rb
⚙️ CodeRabbit configuration file
**/*.rb: # refactoring
- まずFat Controllerを避け、次にFat Modelを避ける。
- Serviceクラスの乱用を避ける。
- controller concernを作ろうとしたらPORO(Plain Old Ruby Object)やActiveRecordモデルでの実装で代替できないか検討する。
Rails Patterns
- ViewHelperにメソッドを実装する時にはまずDecoratorパターンを使うことを検討する。(active_decorator gemを導入しているのでそれを使う)
- 複雑なActiveRecordクエリがあり、再利用できそうな場合はQueryObjectパターンを検討する。(rails-patterns gemを導入しているのでそれのQuery機能を使う)
- Viewにpartialを作る場合はViewComponentを使うことを検討する。
- 複数のActiveRecordモデルを操作する1つの責務がある時や外部APIとやりとりする処理がある場合にはInteractorオブジェクトパターンを検討する。(interactor gemを導入しているのでそれを使う)
- 複数のInteractorを実行するような処理がある場合Organizerオブジェクトパターンを検討する。(interactor gemを導入しており、その中にOrganizerの機能があるので使う)
Files:
test/system/events/crud_test.rb
test/**
📄 CodeRabbit inference engine (AGENTS.md)
Keep tests deterministic and use fixtures stored in
test/fixtures/for test data
Files:
test/system/events/crud_test.rb
test/**/*
⚙️ CodeRabbit configuration file
test/**/*: # Test
- TestCase名は英語で書く。
- どうしても避けられない時以外にsystem testでsleepは使わない。
Unit Test
model, helper, decorator, view_componentについてはメソッドを追加した場合は必ず対応したUnit TestのTestCaseを1つは書く。
Files:
test/system/events/crud_test.rb
🧠 Learnings (5)
📓 Common learnings
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/product.rb:59-61
Timestamp: 2025-09-11T14:47:53.256Z
Learning: Rails アップグレードPRでは、アップグレードに直接関連しない性能改善や機能追加の提案は避けるべき。PRのスコープを維持することが重要で、そのような改善提案は別PRで対応すべきである。
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9115
File: db/migrate/20250902024949_add_unique_index_to_correct_answers.rb:1-5
Timestamp: 2025-11-13T09:20:36.030Z
Learning: fjordllc/bootcamp プロジェクトでは、データの整合性を保つためのデータ修正には data-migrate gem を使用し、db/data/ ディレクトリ配下にデータマイグレーションファイルを作成する運用を採用している。スキーマ変更(db/migrate/)とデータ変更(db/data/)を分離することで、より安全で管理しやすい構成を実現している。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:52-56
Timestamp: 2025-09-12T21:17:45.295Z
Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: config/initializers/sorcery.rb:0-0
Timestamp: 2025-09-11T16:02:24.782Z
Learning: Rails アップグレードPRにおいて、JWT設定の改善では複数のソース(secrets, credentials, ENV)を優先順位付きで検索し、本番環境では未設定時に起動を停止させる実装が推奨される。開発・テスト環境でのみsecret_key_baseフォールバックを許可する構成が安全である。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: app/controllers/mentor/buzzes_controller.rb:0-0
Timestamp: 2025-09-04T01:39:22.261Z
Learning: fjordllc/bootcamp プロジェクトでは、更新処理の成功時の通知メッセージについて、I18n を使用せずに日本語文字列を直接記述する方針で一貫性を保っている。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:19-23
Timestamp: 2025-09-12T21:17:26.029Z
Learning: Rails アップグレードPRにおいて、config_for(:secrets) を使った webhook URL 設定の shared セクション未参照問題は、設定システム全体の変更として別PRで対応すべきである。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/migrate/20250831234516_remove_unique_index_from_buzzes_title.rb:1-5
Timestamp: 2025-09-04T01:50:47.773Z
Learning: fjordllc/bootcampプロジェクトでは、マイグレーションにおいてdisable_ddl_transaction!やalgorithm: :concurrentlyは使用せず、標準的なRailsのchangeメソッド内でremove_indexを実行する慣例がある。
Learnt from: hirokiej
Repo: fjordllc/bootcamp PR: 8740
File: app/helpers/reports_helper.rb:56-64
Timestamp: 2025-06-29T03:44:15.179Z
Learning: このプロジェクト(fjordllc/bootcamp)では、ja.ymlファイルで一部の単語や文章のみI18n対応されているが、多くのテキストは日本語でハードコーディングされており、完全な国際化対応は行われていない。新しい機能でもI18n対応は不要と判断される。
Learnt from: mousu-a
Repo: fjordllc/bootcamp PR: 8566
File: db/migrate/20250830033535_add_default_to_pair_works_wip.rb:1-5
Timestamp: 2025-08-31T03:17:44.812Z
Learning: 新機能のマイグレーションで、まだ本番環境にリリースされていない場合は、既存レコードのバックフィル処理は不要。開発環境でrails db:resetが可能な状況では特に、デフォルト値の変更のみで十分。
Learnt from: tyrrell-IH
Repo: fjordllc/bootcamp PR: 8807
File: app/views/welcome/job_support.html.slim:391-392
Timestamp: 2025-06-21T22:30:20.116Z
Learning: このプロジェクトにはRailsの組み込みmarkdownヘルパが利用できないため、markdownのHTML変換には自前でヘルパを実装する必要がある。
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Use `bin/setup` for local database setup and dependency installation; avoid manual tweaks in `config/` without team discussion
Applied to files:
bin/setup
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to test/**/*_test.rb : Use Minitest + Capybara for system tests; place unit and integration tests under matching `test/*` directories
Applied to files:
bin/setuptest/system/events/crud_test.rb
📚 Learning: 2025-10-22T06:04:36.036Z
Learnt from: sjabcdefin
Repo: fjordllc/bootcamp PR: 9247
File: app/controllers/checks_controller.rb:0-0
Timestamp: 2025-10-22T06:04:36.036Z
Learning: ChecksController#createおよび#destroyでは、Checkの作成・削除とActiveSupport::Notifications.instrumentによるイベント発行(プラクティスのステータス更新)を同一トランザクション内で実行し、いずれかが失敗した場合は両方をロールバックする。これによりWebUI表示とDB状態の整合性を保証している。
Applied to files:
test/system/events/crud_test.rb
📚 Learning: 2025-08-31T23:39:23.210Z
Learnt from: mousu-a
Repo: fjordllc/bootcamp PR: 8566
File: app/views/pair_works/_body.html.slim:111-117
Timestamp: 2025-08-31T23:39:23.210Z
Learning: PairWorkモデルにreserved_at_in_schedules?カスタムバリデーション(on: :update)が実装されており、reserved_atが必ずschedules.map(&:proposed_at)に含まれることを検証している。これにより、フォームから任意の日時を送信することを防いでいる。
Applied to files:
test/system/events/crud_test.rb
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build_and_test
🔇 Additional comments (3)
test/system/events/crud_test.rb (1)
18-21: 修正内容を承認します。
assert_differenceブロックの外にassert_textを移動する修正が正しく実装されています。この構造により:
withinブロックがフォーム操作のみをスコープ化assert_differenceがアクション(click_button)のみをラップassert_textアサーションが Capybara の待機機構を適切に活用Rails 8.1 へのアップグレードに伴うテストの安定化として適切な対応です。
bin/setup (2)
34-34: --reset フラグの追加は開発ワークフローの改善として適切です。オプトイン方式でデータベースをリセットできる機能追加は、Rails アップグレード時のスキーマ変更対応などに有用です。明示的に
--resetを指定した場合のみ実行されるため、誤ったデータ削除のリスクも最小限です。
39-43: 条件付き開発サーバー起動の実装は適切です。
--skip-serverフラグによる条件分岐は CI 環境での利用(config/ci.rb から参照)に対応しており、execによる bin/dev の実行と事前のSTDOUT.flushも正しい実装です。Rails 8.1 アップグレードに伴う開発環境セットアップフローの改善として適切です。
| if File.exist?("package.json") || File.exist?("yarn.lock") || File.exist?(".node-version") | ||
| puts "\n== Installing JavaScript dependencies ==" | ||
| if File.exist?("yarn.lock") || system("which yarn > /dev/null 2>&1") | ||
| system!("yarn install") | ||
| else | ||
| system!("npm install") | ||
| end | ||
| end |
There was a problem hiding this comment.
yarn.lock が存在するが yarn コマンドがインストールされていない場合に失敗します。
20行目の条件分岐は、yarn.lock ファイルの存在のみで yarn を使用すると判断していますが、yarn コマンドがシステムにインストールされていない場合、21行目の system!("yarn install") が例外で失敗します。
条件を以下のように修正して、yarn コマンドの存在を先に確認してください:
🔎 修正案
if File.exist?("package.json") || File.exist?("yarn.lock") || File.exist?(".node-version")
puts "\n== Installing JavaScript dependencies =="
- if File.exist?("yarn.lock") || system("which yarn > /dev/null 2>&1")
+ if system("which yarn > /dev/null 2>&1")
system!("yarn install")
- else
+ elsif system("which npm > /dev/null 2>&1")
system!("npm install")
+ else
+ puts "Warning: Neither yarn nor npm found, skipping JavaScript dependency installation"
end
endこの修正により、yarn または npm のいずれかが利用可能かどうかを確認してから実行するため、より堅牢になります。
🤖 Prompt for AI Agents
In @bin/setup around lines 18 - 25, The install branch chooses yarn just because
yarn.lock exists, which fails if the yarn binary is missing; update the
conditional that decides between yarn and npm so it checks for the yarn binary
first (e.g., call system("which yarn > /dev/null 2>&1") before using
File.exist?("yarn.lock")), then call system!("yarn install") only when the yarn
command is available, otherwise fall back to system!("npm install") (optionally
verify npm is present before invoking).
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
test/system/admin/users_test.rb (1)
185-186: 退会テストの Stripe API 回避方法について、卒業テストとの一貫性を検討してください。退会テストでは
subscription_idとcustomer_idをクリアすることで Stripe API 呼び出しを回避していますが、卒業テスト(Line 236-240)では WebMock のstub_requestを使用して Stripe API をスタブしています。現在の実装で動作していますが、以下の理由から WebMock を使用する方法への統一を検討してください:
- テストの意図が明確になる(API 呼び出しが行われないことを明示的に制御)
- データの整合性が保たれる(subscription_id/customer_id が存在する状態での退会フローをテスト)
- 卒業テストとのアプローチの一貫性
ただし、Rails アップグレード PR のスコープを考慮すると、この統一は別 PR で対応することも検討できます。
🔎 WebMock を使用した代替案
test 'make user retired' do user = users(:hatsuno) times_channel_id = '987654321987654321' user.discord_profile.update!(times_id: times_channel_id) - # Clear subscription_id and customer_id to avoid Stripe API calls during retirement - user.update_columns(subscription_id: nil, customer_id: nil) # rubocop:disable Rails/SkipsModelValidations date = Date.current + + stub_request(:get, "https://api.stripe.com/v1/subscriptions/#{user.subscription_id}") + .to_return(status: 200, body: { id: user.subscription_id, status: 'active' }.to_json) + stub_request(:delete, "https://api.stripe.com/v1/subscriptions/#{user.subscription_id}") + .to_return(status: 200, body: { id: user.subscription_id, status: 'canceled' }.to_json) Discord::Server.stub(:delete_text_channel, true) do visit_with_auth edit_admin_user_path(user.id), 'komagata'
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
test/system/admin/users_test.rb
🧰 Additional context used
📓 Path-based instructions (4)
test/**/*_test.rb
📄 CodeRabbit inference engine (AGENTS.md)
test/**/*_test.rb: Test suite should use Minitest with structure:system/,models/,controllers/, and fixtures intest/fixtures/; test files should be named*_test.rb
Use Minitest + Capybara for system tests; place unit and integration tests under matchingtest/*directories
Files:
test/system/admin/users_test.rb
**/*.rb
📄 CodeRabbit inference engine (AGENTS.md)
Ruby code should use 2-space indentation, snake_case for method names, and CamelCase for class names, enforced by RuboCop (
.rubocop.yml)
Files:
test/system/admin/users_test.rb
⚙️ CodeRabbit configuration file
**/*.rb: # refactoring
- まずFat Controllerを避け、次にFat Modelを避ける。
- Serviceクラスの乱用を避ける。
- controller concernを作ろうとしたらPORO(Plain Old Ruby Object)やActiveRecordモデルでの実装で代替できないか検討する。
Rails Patterns
- ViewHelperにメソッドを実装する時にはまずDecoratorパターンを使うことを検討する。(active_decorator gemを導入しているのでそれを使う)
- 複雑なActiveRecordクエリがあり、再利用できそうな場合はQueryObjectパターンを検討する。(rails-patterns gemを導入しているのでそれのQuery機能を使う)
- Viewにpartialを作る場合はViewComponentを使うことを検討する。
- 複数のActiveRecordモデルを操作する1つの責務がある時や外部APIとやりとりする処理がある場合にはInteractorオブジェクトパターンを検討する。(interactor gemを導入しているのでそれを使う)
- 複数のInteractorを実行するような処理がある場合Organizerオブジェクトパターンを検討する。(interactor gemを導入しており、その中にOrganizerの機能があるので使う)
Files:
test/system/admin/users_test.rb
test/**
📄 CodeRabbit inference engine (AGENTS.md)
Keep tests deterministic and use fixtures stored in
test/fixtures/for test data
Files:
test/system/admin/users_test.rb
test/**/*
⚙️ CodeRabbit configuration file
test/**/*: # Test
- TestCase名は英語で書く。
- どうしても避けられない時以外にsystem testでsleepは使わない。
Unit Test
model, helper, decorator, view_componentについてはメソッドを追加した場合は必ず対応したUnit TestのTestCaseを1つは書く。
Files:
test/system/admin/users_test.rb
🧠 Learnings (13)
📓 Common learnings
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/product.rb:59-61
Timestamp: 2025-09-11T14:47:53.256Z
Learning: Rails アップグレードPRでは、アップグレードに直接関連しない性能改善や機能追加の提案は避けるべき。PRのスコープを維持することが重要で、そのような改善提案は別PRで対応すべきである。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:52-56
Timestamp: 2025-09-12T21:17:45.295Z
Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:19-23
Timestamp: 2025-09-12T21:17:26.029Z
Learning: Rails アップグレードPRにおいて、config_for(:secrets) を使った webhook URL 設定の shared セクション未参照問題は、設定システム全体の変更として別PRで対応すべきである。
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9115
File: db/migrate/20250902024949_add_unique_index_to_correct_answers.rb:1-5
Timestamp: 2025-11-13T09:20:36.030Z
Learning: fjordllc/bootcamp プロジェクトでは、データの整合性を保つためのデータ修正には data-migrate gem を使用し、db/data/ ディレクトリ配下にデータマイグレーションファイルを作成する運用を採用している。スキーマ変更(db/migrate/)とデータ変更(db/data/)を分離することで、より安全で管理しやすい構成を実現している。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: config/initializers/sorcery.rb:0-0
Timestamp: 2025-09-11T16:02:24.782Z
Learning: Rails アップグレードPRにおいて、JWT設定の改善では複数のソース(secrets, credentials, ENV)を優先順位付きで検索し、本番環境では未設定時に起動を停止させる実装が推奨される。開発・テスト環境でのみsecret_key_baseフォールバックを許可する構成が安全である。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: app/controllers/mentor/buzzes_controller.rb:0-0
Timestamp: 2025-09-04T01:39:22.261Z
Learning: fjordllc/bootcamp プロジェクトでは、更新処理の成功時の通知メッセージについて、I18n を使用せずに日本語文字列を直接記述する方針で一貫性を保っている。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/migrate/20250831234516_remove_unique_index_from_buzzes_title.rb:1-5
Timestamp: 2025-09-04T01:50:47.773Z
Learning: fjordllc/bootcampプロジェクトでは、マイグレーションにおいてdisable_ddl_transaction!やalgorithm: :concurrentlyは使用せず、標準的なRailsのchangeメソッド内でremove_indexを実行する慣例がある。
Learnt from: mousu-a
Repo: fjordllc/bootcamp PR: 8566
File: db/migrate/20250830033535_add_default_to_pair_works_wip.rb:1-5
Timestamp: 2025-08-31T03:17:44.812Z
Learning: 新機能のマイグレーションで、まだ本番環境にリリースされていない場合は、既存レコードのバックフィル処理は不要。開発環境でrails db:resetが可能な状況では特に、デフォルト値の変更のみで十分。
Learnt from: tyrrell-IH
Repo: fjordllc/bootcamp PR: 8807
File: app/views/welcome/job_support.html.slim:391-392
Timestamp: 2025-06-21T22:30:20.116Z
Learning: このプロジェクトにはRailsの組み込みmarkdownヘルパが利用できないため、markdownのHTML変換には自前でヘルパを実装する必要がある。
📚 Learning: 2025-09-01T22:31:57.345Z
Learnt from: matuaya
Repo: fjordllc/bootcamp PR: 9108
File: app/models/after_user_retirement.rb:0-0
Timestamp: 2025-09-01T22:31:57.345Z
Learning: fjordllc/bootcampプロジェクトにおいて、`Newspaper.publish(:retirement_create, { user: user })`はUnfinishedDataDestroyer(未チェックProduct・WIP Report削除、career_pathリセット)とTimesChannelDestroyer(Discord分報チャンネル削除)による重要なデータクリーンアップ処理を実行するため、退会のトリガーが何であろうと(admin、hibernation、user)必ず実行する必要がある。
Applied to files:
test/system/admin/users_test.rb
📚 Learning: 2025-09-01T22:31:57.345Z
Learnt from: matuaya
Repo: fjordllc/bootcamp PR: 9108
File: app/models/after_user_retirement.rb:0-0
Timestamp: 2025-09-01T22:31:57.345Z
Learning: fjordllc/bootcampプロジェクトにおいて、`Newspaper.publish(:retirement_create, { user: user })`は通知処理ではなく、UnfinishedDataDestroyerやTimesChannelDestroyer等による重要なデータクリーンアップ処理を実行するため、管理者による退会(triggered_by: 'admin')の場合でも必ず実行する必要がある。
Applied to files:
test/system/admin/users_test.rb
📚 Learning: 2025-09-12T21:17:26.029Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:19-23
Timestamp: 2025-09-12T21:17:26.029Z
Learning: Rails アップグレードPRにおいて、config_for(:secrets) を使った webhook URL 設定の shared セクション未参照問題は、設定システム全体の変更として別PRで対応すべきである。
Applied to files:
test/system/admin/users_test.rb
📚 Learning: 2025-09-12T21:18:00.834Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Applied to files:
test/system/admin/users_test.rb
📚 Learning: 2025-07-23T20:31:13.856Z
Learnt from: jun-kondo
Repo: fjordllc/bootcamp PR: 8977
File: app/controllers/reports_controller.rb:63-63
Timestamp: 2025-07-23T20:31:13.856Z
Learning: fjordllc/bootcampプロジェクトの`app/controllers/reports_controller.rb`において、`create`と`update`アクションは両方とも`report.save_uniquely`を使用し、同じ`:report_save`イベントと`'report.save'`イベントを発行する。これは両方とも本質的に「レポートの保存」操作であり、作成と更新を区別する必要がないためである。
Applied to files:
test/system/admin/users_test.rb
📚 Learning: 2025-08-31T01:05:07.447Z
Learnt from: mousu-a
Repo: fjordllc/bootcamp PR: 8566
File: app/views/pair_works/_body.html.slim:0-0
Timestamp: 2025-08-31T01:05:07.447Z
Learning: システムテストでボタンやフォーム要素を識別する必要がある場合、動的な値をクラス属性に埋め込むのではなく、id属性やdata属性を使用する。特にJavaScriptでの操作やコントローラーへのデータ送信が不要な場合は、id属性を使用するのが適切。
Applied to files:
test/system/admin/users_test.rb
📚 Learning: 2025-09-12T21:16:47.639Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Applied to files:
test/system/admin/users_test.rb
📚 Learning: 2025-09-04T01:39:22.261Z
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: app/controllers/mentor/buzzes_controller.rb:0-0
Timestamp: 2025-09-04T01:39:22.261Z
Learning: fjordllc/bootcamp プロジェクトでは、更新処理の成功時の通知メッセージについて、I18n を使用せずに日本語文字列を直接記述する方針で一貫性を保っている。
Applied to files:
test/system/admin/users_test.rb
📚 Learning: 2025-08-25T08:00:11.369Z
Learnt from: sjabcdefin
Repo: fjordllc/bootcamp PR: 9090
File: app/javascript/user-sns.js:2-25
Timestamp: 2025-08-25T08:00:11.369Z
Learning: app/javascript/user-sns.js において、アクセシビリティ改善(aria-label属性の追加など)は他の箇所との整合性を保つため、別途統一して対応する方針である
Applied to files:
test/system/admin/users_test.rb
📚 Learning: 2025-08-31T12:08:33.904Z
Learnt from: thmz337
Repo: fjordllc/bootcamp PR: 9103
File: app/views/generations/_user.html.slim:6-14
Timestamp: 2025-08-31T12:08:33.904Z
Learning: app/views/generations/_user.html.slimの非アクティブメッセージ表示では、退会・休会・非アクティブの3つの条件が独立して評価され、複数のメッセージが同時に表示される仕様になっている。これは意図的な設計である。
Applied to files:
test/system/admin/users_test.rb
📚 Learning: 2025-07-15T12:33:04.885Z
Learnt from: reckyy
Repo: fjordllc/bootcamp PR: 8356
File: db/fixtures/users.yml:823-826
Timestamp: 2025-07-15T12:33:04.885Z
Learning: fjordllc/bootcampプロジェクトでは、`trainee: true`は「研修に所属していたユーザー」全体を示すフラグであり、研修中のユーザーと研修を終了したユーザーの両方を含む。そのため、`trainee: true`と`training_completed_at`の併存は意図された仕様であり、排他的な関係ではない。
Applied to files:
test/system/admin/users_test.rb
📚 Learning: 2025-08-31T23:39:23.210Z
Learnt from: mousu-a
Repo: fjordllc/bootcamp PR: 8566
File: app/views/pair_works/_body.html.slim:111-117
Timestamp: 2025-08-31T23:39:23.210Z
Learning: PairWorkモデルにreserved_at_in_schedules?カスタムバリデーション(on: :update)が実装されており、reserved_atが必ずschedules.map(&:proposed_at)に含まれることを検証している。これにより、フォームから任意の日時を送信することを防いでいる。
Applied to files:
test/system/admin/users_test.rb
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build_and_test
🔇 Additional comments (2)
test/system/admin/users_test.rb (2)
236-252: WebMock を使用した Stripe API のスタブ化が適切です。卒業テストでは WebMock の
stub_requestを使用して Stripe API をスタブし、assert_requestedで API 呼び出しを検証しています。これは外部 API への依存を適切に分離し、テストの決定論的実行を保証する良い実装です。VCR から WebMock への移行として、Rails 8.1.1 アップグレードに適した変更です。
321-322: 成功メッセージとデータ永続化の両方を検証する良いテストです。追加されたアサーションは、UI のフィードバック(成功メッセージ)とデータベースへの永続化の両方を確認しており、テストの信頼性を高めています。
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
bin/setup (1)
30-30:--resetフラグの追加は便利ですが、使用上の注意が必要です。開発環境でデータベースを完全にリセットする機能として有用ですが、
db:resetは全データを削除します。誤使用を防ぐため、README や AGENTS.md にこのフラグの説明を追加することを検討してください。
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
package-lock.jsonis excluded by!**/package-lock.jsonyarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (5)
.circleci/config.ymlAGENTS.mdbin/setupbin/yarnpackage.json
💤 Files with no reviewable changes (1)
- bin/yarn
🧰 Additional context used
🧠 Learnings (14)
📓 Common learnings
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/product.rb:59-61
Timestamp: 2025-09-11T14:47:53.256Z
Learning: Rails アップグレードPRでは、アップグレードに直接関連しない性能改善や機能追加の提案は避けるべき。PRのスコープを維持することが重要で、そのような改善提案は別PRで対応すべきである。
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9115
File: db/migrate/20250902024949_add_unique_index_to_correct_answers.rb:1-5
Timestamp: 2025-11-13T09:20:36.030Z
Learning: fjordllc/bootcamp プロジェクトでは、データの整合性を保つためのデータ修正には data-migrate gem を使用し、db/data/ ディレクトリ配下にデータマイグレーションファイルを作成する運用を採用している。スキーマ変更(db/migrate/)とデータ変更(db/data/)を分離することで、より安全で管理しやすい構成を実現している。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:52-56
Timestamp: 2025-09-12T21:17:45.295Z
Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: config/initializers/sorcery.rb:0-0
Timestamp: 2025-09-11T16:02:24.782Z
Learning: Rails アップグレードPRにおいて、JWT設定の改善では複数のソース(secrets, credentials, ENV)を優先順位付きで検索し、本番環境では未設定時に起動を停止させる実装が推奨される。開発・テスト環境でのみsecret_key_baseフォールバックを許可する構成が安全である。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:19-23
Timestamp: 2025-09-12T21:17:26.029Z
Learning: Rails アップグレードPRにおいて、config_for(:secrets) を使った webhook URL 設定の shared セクション未参照問題は、設定システム全体の変更として別PRで対応すべきである。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: app/controllers/mentor/buzzes_controller.rb:0-0
Timestamp: 2025-09-04T01:39:22.261Z
Learning: fjordllc/bootcamp プロジェクトでは、更新処理の成功時の通知メッセージについて、I18n を使用せずに日本語文字列を直接記述する方針で一貫性を保っている。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/migrate/20250831234516_remove_unique_index_from_buzzes_title.rb:1-5
Timestamp: 2025-09-04T01:50:47.773Z
Learning: fjordllc/bootcampプロジェクトでは、マイグレーションにおいてdisable_ddl_transaction!やalgorithm: :concurrentlyは使用せず、標準的なRailsのchangeメソッド内でremove_indexを実行する慣例がある。
Learnt from: tyrrell-IH
Repo: fjordllc/bootcamp PR: 9306
File: app/javascript/components/Bookmarks.jsx:248-265
Timestamp: 2025-11-17T00:46:30.794Z
Learning: fjordllc/bootcamp プロジェクトでは、Reactからバニラ JavaScript への移行作業が進行中である。そのため、新しいReactファイルの作成は避け、既存のReactコンポーネント内で完結する実装が推奨される。BookmarksInDashboard.jsx は issue #9045 で削除予定。
Learnt from: mousu-a
Repo: fjordllc/bootcamp PR: 8566
File: db/migrate/20250830033535_add_default_to_pair_works_wip.rb:1-5
Timestamp: 2025-08-31T03:17:44.812Z
Learning: 新機能のマイグレーションで、まだ本番環境にリリースされていない場合は、既存レコードのバックフィル処理は不要。開発環境でrails db:resetが可能な状況では特に、デフォルト値の変更のみで十分。
Learnt from: tyrrell-IH
Repo: fjordllc/bootcamp PR: 8807
File: app/views/welcome/job_support.html.slim:391-392
Timestamp: 2025-06-21T22:30:20.116Z
Learning: このプロジェクトにはRailsの組み込みmarkdownヘルパが利用できないため、markdownのHTML変換には自前でヘルパを実装する必要がある。
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to app/javascript/**/*.{js,ts,jsx,tsx} : JavaScript/TypeScript code in `app/javascript/` should be linted with ESLint and formatted with Prettier via `yarn lint` scripts; use React 17 and Shakapacker/Webpack 5
Applied to files:
AGENTS.mdbin/setuppackage.json
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Use `bin/setup` for local database setup and dependency installation; avoid manual tweaks in `config/` without team discussion
Applied to files:
AGENTS.mdbin/setup
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to app/**/*.{rb,js,ts,jsx,tsx} : Rails app code should be organized in `app/` directory with subdirectories: `models/`, `controllers/`, `views/`, `jobs/`, `helpers/`, and frontend code under `javascript/` (Shakapacker)
Applied to files:
AGENTS.md
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to db/** : Database migrations and schema should be stored in `db/` directory; app-specific utilities in `lib/`; static assets in `public/`
Applied to files:
AGENTS.md
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to **/*.rb : Ruby code should use 2-space indentation, snake_case for method names, and CamelCase for class names, enforced by RuboCop (`.rubocop.yml`)
Applied to files:
AGENTS.md
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to test/**/*_test.rb : Test suite should use Minitest with structure: `system/`, `models/`, `controllers/`, and fixtures in `test/fixtures/`; test files should be named `*_test.rb`
Applied to files:
AGENTS.md
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to test/**/*_test.rb : Use Minitest + Capybara for system tests; place unit and integration tests under matching `test/*` directories
Applied to files:
AGENTS.mdbin/setup
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to config/** : Configuration files in `config/` should include environment settings, routes, and lints (`.rubocop.yml`, `config/slim_lint.yml`)
Applied to files:
AGENTS.md
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to **/*.slim : Slim templates should be linted according to `config/slim_lint.yml`
Applied to files:
AGENTS.md
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Follow these guidelines for any code edits; keep changes minimal, scoped to the task, and update documentation and tests when adding commands or changing behavior
Applied to files:
AGENTS.md
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: All linters must pass (`bin/lint` command) and CI (CircleCI) must be green before merging; add or adjust tests when changing behavior
Applied to files:
AGENTS.md
📚 Learning: 2025-09-12T21:17:26.029Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:19-23
Timestamp: 2025-09-12T21:17:26.029Z
Learning: Rails アップグレードPRにおいて、config_for(:secrets) を使った webhook URL 設定の shared セクション未参照問題は、設定システム全体の変更として別PRで対応すべきである。
Applied to files:
bin/setup
📚 Learning: 2025-09-11T16:02:24.782Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: config/initializers/sorcery.rb:0-0
Timestamp: 2025-09-11T16:02:24.782Z
Learning: Rails アップグレードPRにおいて、JWT設定の改善では複数のソース(secrets, credentials, ENV)を優先順位付きで検索し、本番環境では未設定時に起動を停止させる実装が推奨される。開発・テスト環境でのみsecret_key_baseフォールバックを許可する構成が安全である。
Applied to files:
bin/setup
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build_and_test
🔇 Additional comments (8)
package.json (1)
86-86: yarn → npm 移行に伴う変更として適切です。yarn パッケージの削除と npm への移行は、他のファイル(.circleci/config.yml、bin/setup、AGENTS.md)と一貫しています。
AGENTS.md (1)
11-11: ドキュメントの更新が正確です。yarn から npm への移行、および React 17 から 18 へのアップデートが正しく反映されています。package.json の
react: ^18.3.1と一致しています。Also applies to: 22-22
.circleci/config.yml (4)
18-22: build ジョブの npm 移行が適切に設定されています。
install-yarn: falseとpkg-manager: npmの組み合わせにより、yarn を無効化し npm を使用する設定が正しく行われています。
43-44: libheif-dev の追加について確認してください。libvips に加えて libheif-dev が追加されています。これは HEIF 画像フォーマット(iPhone の写真形式)のサポートに必要ですが、プロジェクトでこの機能を使用しているか確認してください。
48-55: check ジョブの npm 移行が一貫しています。lint コマンドが
npm run lintに正しく更新されており、package.json の scripts セクションと一致しています。
89-99: test ジョブの設定も他のジョブと一貫しています。npm への移行と libheif-dev のインストールが build/check ジョブと同様に設定されています。
bin/setup (2)
35-39:--skip-serverフラグとbin/devの統合が適切です。CI 環境(config/ci.rb)では
bin/setup --skip-serverが使用されており、この設計と整合性が取れています。STDOUT.flushによる出力のフラッシュもexec前の適切な処理です。
18-21: npm への完全な移行が完了しており、実装は適切です。
bin/setupの変更は正しく、npm installのみを使用する簡潔な実装になっています。yarn.lock は既に削除済みで、package-lock.json が存在しており、package.json のすべてのスクリプトで npm を使用しています。npm-run-all による並列実行も適切に設定されています。
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Fix all issues with AI agents
In @README.md:
- Around line 48-49: In README.md update the code example that currently starts
with "$ bin/lint" to satisfy MD014: either remove the leading dollar so the code
fence contains the raw command "bin/lint", or explicitly mark the block as a
shell prompt by labeling the fence (e.g., ```bash) and keep the leading "$ "
only if you intend it to be a prompt; modify the line containing "$ bin/lint"
accordingly.
- Around line 16-19: README.md のコードブロックが markdownlint のルール違反(MD040 と
MD014)を起こしているため、バッククォート開始行に言語指定(例: ```bash)を追加し、コードブロック内のコマンド行("$ bin/setup" と
"$
bin/dev")から先頭のドルサインを削除するか、もしドルサインでシェルプロンプト付きの出力例を示す意図ならそのままにして出力行と入力行を適切に分ける(つまり出力例でなければ
"$" を削る)ことで修正してください。
- Around line 62-63: Remove the leading dollar sign from the example (MD014),
replace the shown command "npx eslint 'app/javascript/**/*.{js,vue,jsx}' --fix"
with the project's canonical command "yarn lint", and update the glob to omit
.vue so the pattern becomes "app/javascript/**/*.{js,jsx}" to match the
package.json scripts (lint:eslint / lint:prettier) and bin/lint.
- Around line 68-69: Remove the leading dollar sign from the example command and
update the file glob to match package.json by replacing the snippet " $ npx
prettier app/javascript/**/*.{js,vue,jsx} --write" with a recommendation to run
the lint script, e.g. suggest "yarn lint:prettier" (or replace the exact shown
command with "yarn lint:prettier") and ensure the glob uses .{js,jsx} rather
than .{js,vue,jsx}.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
README.md
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/product.rb:59-61
Timestamp: 2025-09-11T14:47:53.256Z
Learning: Rails アップグレードPRでは、アップグレードに直接関連しない性能改善や機能追加の提案は避けるべき。PRのスコープを維持することが重要で、そのような改善提案は別PRで対応すべきである。
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9115
File: db/migrate/20250902024949_add_unique_index_to_correct_answers.rb:1-5
Timestamp: 2025-11-13T09:20:36.030Z
Learning: fjordllc/bootcamp プロジェクトでは、データの整合性を保つためのデータ修正には data-migrate gem を使用し、db/data/ ディレクトリ配下にデータマイグレーションファイルを作成する運用を採用している。スキーマ変更(db/migrate/)とデータ変更(db/data/)を分離することで、より安全で管理しやすい構成を実現している。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:52-56
Timestamp: 2025-09-12T21:17:45.295Z
Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: config/initializers/sorcery.rb:0-0
Timestamp: 2025-09-11T16:02:24.782Z
Learning: Rails アップグレードPRにおいて、JWT設定の改善では複数のソース(secrets, credentials, ENV)を優先順位付きで検索し、本番環境では未設定時に起動を停止させる実装が推奨される。開発・テスト環境でのみsecret_key_baseフォールバックを許可する構成が安全である。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:19-23
Timestamp: 2025-09-12T21:17:26.029Z
Learning: Rails アップグレードPRにおいて、config_for(:secrets) を使った webhook URL 設定の shared セクション未参照問題は、設定システム全体の変更として別PRで対応すべきである。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: app/controllers/mentor/buzzes_controller.rb:0-0
Timestamp: 2025-09-04T01:39:22.261Z
Learning: fjordllc/bootcamp プロジェクトでは、更新処理の成功時の通知メッセージについて、I18n を使用せずに日本語文字列を直接記述する方針で一貫性を保っている。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/migrate/20250831234516_remove_unique_index_from_buzzes_title.rb:1-5
Timestamp: 2025-09-04T01:50:47.773Z
Learning: fjordllc/bootcampプロジェクトでは、マイグレーションにおいてdisable_ddl_transaction!やalgorithm: :concurrentlyは使用せず、標準的なRailsのchangeメソッド内でremove_indexを実行する慣例がある。
Learnt from: tyrrell-IH
Repo: fjordllc/bootcamp PR: 8807
File: app/views/welcome/job_support.html.slim:391-392
Timestamp: 2025-06-21T22:30:20.116Z
Learning: このプロジェクトにはRailsの組み込みmarkdownヘルパが利用できないため、markdownのHTML変換には自前でヘルパを実装する必要がある。
📚 Learning: 2025-11-13T09:20:36.030Z
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9115
File: db/migrate/20250902024949_add_unique_index_to_correct_answers.rb:1-5
Timestamp: 2025-11-13T09:20:36.030Z
Learning: fjordllc/bootcamp プロジェクトでは、データの整合性を保つためのデータ修正には data-migrate gem を使用し、db/data/ ディレクトリ配下にデータマイグレーションファイルを作成する運用を採用している。スキーマ変更(db/migrate/)とデータ変更(db/data/)を分離することで、より安全で管理しやすい構成を実現している。
Applied to files:
README.md
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: All linters must pass (`bin/lint` command) and CI (CircleCI) must be green before merging; add or adjust tests when changing behavior
Applied to files:
README.md
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to app/javascript/**/*.{js,ts,jsx,tsx} : JavaScript/TypeScript code in `app/javascript/` should be linted with ESLint and formatted with Prettier via `yarn lint` scripts; use React 17 and Shakapacker/Webpack 5
Applied to files:
README.md
🪛 markdownlint-cli2 (0.18.1)
README.md
16-16: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
17-17: Dollar signs used before commands without showing output
(MD014, commands-show-output)
18-18: Dollar signs used before commands without showing output
(MD014, commands-show-output)
48-48: Dollar signs used before commands without showing output
(MD014, commands-show-output)
62-62: Dollar signs used before commands without showing output
(MD014, commands-show-output)
68-68: Dollar signs used before commands without showing output
(MD014, commands-show-output)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build_and_test
| ``` | ||
| $ bin/setup | ||
| $ foreman start -f Procfile.dev | ||
| $ bin/dev | ||
| ``` |
There was a problem hiding this comment.
マークダウンリンター違反を修正してください。
静的解析ツール(markdownlint-cli2)が以下の問題を検出しています:
- Line 16 (MD040): コードブロックに言語を指定してください(
bashまたはshell) - Lines 17-18 (MD014): ドルサイン(
$)で始まるコマンドは出力例を示すか、ドルサインを削除してください
現在のコードブロック形式は以下のように修正できます:
🔎 推奨修正
-```
+```bash
$ bin/setup
-$ bin/dev
+$ bin/devまたは、出力例を示す場合:
-```
+```bash
$ bin/setup
$ bin/dev
-```
+$ bin/dev
http://localhost:3000/ にアクセス。Learningsから、全てのリンターが正常に実行される状態がマージ前に必須です。
Committable suggestion skipped: line range outside the PR's diff.
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
16-16: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
17-17: Dollar signs used before commands without showing output
(MD014, commands-show-output)
18-18: Dollar signs used before commands without showing output
(MD014, commands-show-output)
🤖 Prompt for AI Agents
In @README.md around lines 16 - 19, README.md のコードブロックが markdownlint
のルール違反(MD040 と MD014)を起こしているため、バッククォート開始行に言語指定(例: ```bash)を追加し、コードブロック内のコマンド行("$
bin/setup" と "$
bin/dev")から先頭のドルサインを削除するか、もしドルサインでシェルプロンプト付きの出力例を示す意図ならそのままにして出力行と入力行を適切に分ける(つまり出力例でなければ
"$" を削る)ことで修正してください。
| $ bin/lint | ||
| ``` |
There was a problem hiding this comment.
Line 48: マークダウンリンター違反(MD014)を修正してください。
ドルサインで始まるコマンドは出力例を示すか、削除してください。
🔎 推奨修正
-$ bin/lint
+bin/lint📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| $ bin/lint | |
| ``` | |
| bin/lint |
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
48-48: Dollar signs used before commands without showing output
(MD014, commands-show-output)
🤖 Prompt for AI Agents
In @README.md around lines 48 - 49, In README.md update the code example that
currently starts with "$ bin/lint" to satisfy MD014: either remove the leading
dollar so the code fence contains the raw command "bin/lint", or explicitly mark
the block as a shell prompt by labeling the fence (e.g., ```bash) and keep the
leading "$ " only if you intend it to be a prompt; modify the line containing "$
bin/lint" accordingly.
| $ npx eslint 'app/javascript/**/*.{js,vue,jsx}' --fix | ||
| ``` |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# package.jsonのscripts セクションを確認
cat package.json | grep -A 30 '"scripts"' | head -40Repository: fjordllc/bootcamp
Length of output: 1139
🏁 Script executed:
# bin/lintスクリプトの内容を確認
cat bin/lintRepository: fjordllc/bootcamp
Length of output: 172
🏁 Script executed:
# README.mdの該当行周辺を確認(60-70行目)
sed -n '60,70p' README.mdRepository: fjordllc/bootcamp
Length of output: 241
ドルサイン削除と、READMEのコマンド例をyarn lintに統一してください。また、ファイルパターンから.vueを削除してください。
README.md の下記について複数の問題が確認されました:
- MD014違反: ドルサイン(
$)を削除してください - コマンド実行方法の不一致: 直接
npxを指定していますが、package.jsonの公式設定とbin/lintスクリプトではyarn lintを使用しています - ファイルパターンの誤り: README に記載されている
.vue拡張子は、実際のpackage.jsonスクリプト(lint:eslintとlint:prettier)で対応していません。パターンを.{js,jsx}に修正してください
推奨修正
-$ npx eslint 'app/javascript/**/*.{js,vue,jsx}' --fix
+yarn lint:eslint --fix-$ npx prettier app/javascript/**/*.{js,vue,jsx}' --write
+yarn lint:prettier --writeまたは、統合コマンドで:
-$ npx eslint 'app/javascript/**/*.{js,vue,jsx}' --fix
+yarn lint🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
62-62: Dollar signs used before commands without showing output
(MD014, commands-show-output)
🤖 Prompt for AI Agents
In @README.md around lines 62 - 63, Remove the leading dollar sign from the
example (MD014), replace the shown command "npx eslint
'app/javascript/**/*.{js,vue,jsx}' --fix" with the project's canonical command
"yarn lint", and update the glob to omit .vue so the pattern becomes
"app/javascript/**/*.{js,jsx}" to match the package.json scripts (lint:eslint /
lint:prettier) and bin/lint.
| $ npx prettier app/javascript/**/*.{js,vue,jsx} --write | ||
| ``` |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# First, let's find and read the README.md file
fd -name "README.md" | head -5Repository: fjordllc/bootcamp
Length of output: 291
🏁 Script executed:
# Read the relevant lines from README.md
head -n 80 README.md | tail -n 30Repository: fjordllc/bootcamp
Length of output: 504
🏁 Script executed:
# Also check lines around 62
head -n 70 README.md | tail -n 20Repository: fjordllc/bootcamp
Length of output: 372
🌐 Web query:
MD014 markdownlint rule dollar sign shell code blocks
💡 Result:
MD014 (alias: commands-show-output) flags fenced code blocks that show shell commands where every command line is prefixed with a dollar sign (
Examples:
- Violates MD014:
$ ls $ cat foo $ less bar
- OK (no $):
ls cat foo less bar
- OK (commands with output shown):
$ ls foo bar $ cat foo Hello world
You can find the rule details in the markdownlint documentation. [1][2]
Sources
- markdownlint MD014 documentation. [1]
- markdownlint summary / rule list (MD014 commands-show-output). [2]
🏁 Script executed:
# Check if package.json exists and has lint scripts
fd -name "package.json" | head -1Repository: fjordllc/bootcamp
Length of output: 291
🏁 Script executed:
# Read package.json to see if there are yarn lint scripts
cat package.json | grep -A 20 '"scripts"'Repository: fjordllc/bootcamp
Length of output: 828
Line 68: MD014違反(ドルサイン)と、ファイルパターン・実行方法の修正が必要です。
- ドルサイン(
$)を削除してください(MD014違反) - ファイルパターンを
.{js,vue,jsx}から.{js,jsx}に修正してください(package.json のlint:prettierスクリプトと一致させる) yarn lint:prettierコマンドの使用を推奨してください(直接的なnpx prettier呼び出しではなく)
🔎 推奨修正
-$ npx prettier app/javascript/**/*.{js,vue,jsx} --write
+yarn lint:prettier📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| $ npx prettier app/javascript/**/*.{js,vue,jsx} --write | |
| ``` | |
| yarn lint:prettier |
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
68-68: Dollar signs used before commands without showing output
(MD014, commands-show-output)
🤖 Prompt for AI Agents
In @README.md around lines 68 - 69, Remove the leading dollar sign from the
example command and update the file glob to match package.json by replacing the
snippet " $ npx prettier app/javascript/**/*.{js,vue,jsx} --write" with a
recommendation to run the lint script, e.g. suggest "yarn lint:prettier" (or
replace the exact shown command with "yarn lint:prettier") and ensure the glob
uses .{js,jsx} rather than .{js,vue,jsx}.
25b1feb to
cd73f02
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In @README.md:
- Line 62: Update the README command string by removing the leading dollar sign
and dropping the `.vue` pattern from the glob so it becomes npx eslint
'app/javascript/**/*.{js,jsx}' --fix, and replace that example with the
recommended npm script usage by referencing the existing yarn lint:eslint
command (suggest using yarn lint:eslint instead of running npx directly).
- Line 48: Remove the leading dollar sign from the command example "$ bin/lint"
in README.md so it complies with MD014; replace the string "$ bin/lint" with
"bin/lint" (e.g., update the code block or inline code where the symbol "$
bin/lint" appears).
- Line 68: Update the CLI example on line 68 to remove the leading dollar sign
and the .vue pattern: replace the shown command so it no longer includes a
leading "$" and remove "*.vue" from the glob, and instead reference the
repository script by recommending the existing package script name (use "yarn
lint:prettier") so readers run the linting via the project NPM/Yarn script
rather than the raw npx command.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
README.md
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/product.rb:59-61
Timestamp: 2025-09-11T14:47:53.256Z
Learning: Rails アップグレードPRでは、アップグレードに直接関連しない性能改善や機能追加の提案は避けるべき。PRのスコープを維持することが重要で、そのような改善提案は別PRで対応すべきである。
Learnt from: ryufuta
Repo: fjordllc/bootcamp PR: 9115
File: db/migrate/20250902024949_add_unique_index_to_correct_answers.rb:1-5
Timestamp: 2025-11-13T09:20:36.030Z
Learning: fjordllc/bootcamp プロジェクトでは、データの整合性を保つためのデータ修正には data-migrate gem を使用し、db/data/ ディレクトリ配下にデータマイグレーションファイルを作成する運用を採用している。スキーマ変更(db/migrate/)とデータ変更(db/data/)を分離することで、より安全で管理しやすい構成を実現している。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:52-56
Timestamp: 2025-09-12T21:17:45.295Z
Learning: Rails upgrade PRにおいて、configuration systemの改善提案(shared configuration fallback等)も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:131-135
Timestamp: 2025-09-12T21:18:00.834Z
Learning: Rails アップグレードPRにおいて、product_review_not_completed メソッドの webhook URL 設定の shared フォールバック追加も、設定システム全体の変更として別PRで対応すべきである。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: config/initializers/sorcery.rb:0-0
Timestamp: 2025-09-11T16:02:24.782Z
Learning: Rails アップグレードPRにおいて、JWT設定の改善では複数のソース(secrets, credentials, ENV)を優先順位付きで検索し、本番環境では未設定時に起動を停止させる実装が推奨される。開発・テスト環境でのみsecret_key_baseフォールバックを許可する構成が安全である。
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/notifiers/discord_notifier.rb:19-23
Timestamp: 2025-09-12T21:17:26.029Z
Learning: Rails アップグレードPRにおいて、config_for(:secrets) を使った webhook URL 設定の shared セクション未参照問題は、設定システム全体の変更として別PRで対応すべきである。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: app/controllers/mentor/buzzes_controller.rb:0-0
Timestamp: 2025-09-04T01:39:22.261Z
Learning: fjordllc/bootcamp プロジェクトでは、更新処理の成功時の通知メッセージについて、I18n を使用せずに日本語文字列を直接記述する方針で一貫性を保っている。
Learnt from: Miya096jp
Repo: fjordllc/bootcamp PR: 9102
File: db/migrate/20250831234516_remove_unique_index_from_buzzes_title.rb:1-5
Timestamp: 2025-09-04T01:50:47.773Z
Learning: fjordllc/bootcampプロジェクトでは、マイグレーションにおいてdisable_ddl_transaction!やalgorithm: :concurrentlyは使用せず、標準的なRailsのchangeメソッド内でremove_indexを実行する慣例がある。
Learnt from: hirokiej
Repo: fjordllc/bootcamp PR: 8740
File: app/helpers/reports_helper.rb:56-64
Timestamp: 2025-06-29T03:44:15.179Z
Learning: このプロジェクト(fjordllc/bootcamp)では、ja.ymlファイルで一部の単語や文章のみI18n対応されているが、多くのテキストは日本語でハードコーディングされており、完全な国際化対応は行われていない。新しい機能でもI18n対応は不要と判断される。
Learnt from: tyrrell-IH
Repo: fjordllc/bootcamp PR: 8807
File: app/views/welcome/job_support.html.slim:391-392
Timestamp: 2025-06-21T22:30:20.116Z
Learning: このプロジェクトにはRailsの組み込みmarkdownヘルパが利用できないため、markdownのHTML変換には自前でヘルパを実装する必要がある。
📚 Learning: 2025-06-21T22:30:20.116Z
Learnt from: tyrrell-IH
Repo: fjordllc/bootcamp PR: 8807
File: app/views/welcome/job_support.html.slim:391-392
Timestamp: 2025-06-21T22:30:20.116Z
Learning: このプロジェクトにはRailsの組み込みmarkdownヘルパが利用できないため、markdownのHTML変換には自前でヘルパを実装する必要がある。
Applied to files:
README.md
📚 Learning: 2025-07-07T05:28:03.676Z
Learnt from: su-su-su-su
Repo: fjordllc/bootcamp PR: 0
File: :0-0
Timestamp: 2025-07-07T05:28:03.676Z
Learning: fjordllc/bootcampプロジェクトでは、fixtureファイル内のERB構文で改行制御文字(-)は使用せず、標準的な<% %>と<%= %>のみを使用する方針が統一されている。<% -%>や<%- %>を使用するとSyntaxErrorが発生する。
Applied to files:
README.md
📚 Learning: 2025-09-12T21:16:47.639Z
Learnt from: komagata
Repo: fjordllc/bootcamp PR: 9101
File: app/models/graduation_notifier.rb:23-28
Timestamp: 2025-09-12T21:16:47.639Z
Learning: Rails upgrade PRにおいて、configuration systemの変更やwebhook設定の改善提案も、アップグレードに直接関連しない場合は別PRで対応すべきである。PRのスコープ維持が重要。
Applied to files:
README.md
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: Applies to app/javascript/**/*.{js,ts,jsx,tsx} : JavaScript/TypeScript code in `app/javascript/` should be linted with ESLint and formatted with Prettier via `yarn lint` scripts; use React 17 and Shakapacker/Webpack 5
Applied to files:
README.md
📚 Learning: 2025-11-26T08:23:30.927Z
Learnt from: CR
Repo: fjordllc/bootcamp PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-26T08:23:30.927Z
Learning: All linters must pass (`bin/lint` command) and CI (CircleCI) must be green before merging; add or adjust tests when changing behavior
Applied to files:
README.md
🪛 markdownlint-cli2 (0.18.1)
README.md
48-48: Dollar signs used before commands without showing output
(MD014, commands-show-output)
62-62: Dollar signs used before commands without showing output
(MD014, commands-show-output)
68-68: Dollar signs used before commands without showing output
(MD014, commands-show-output)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build_and_test
|
|
||
| ``` | ||
| $ ./bin/lint | ||
| $ bin/lint |
There was a problem hiding this comment.
Line 48: マークダウンリンター違反(MD014)を修正してください。
ドルサイン($)を削除してください。
🔎 推奨修正
-$ bin/lint
+bin/lint📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| $ bin/lint | |
| bin/lint |
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
48-48: Dollar signs used before commands without showing output
(MD014, commands-show-output)
🤖 Prompt for AI Agents
In @README.md at line 48, Remove the leading dollar sign from the command
example "$ bin/lint" in README.md so it complies with MD014; replace the string
"$ bin/lint" with "bin/lint" (e.g., update the code block or inline code where
the symbol "$ bin/lint" appears).
|
|
||
| ```shell | ||
| $ eslint 'app/javascript/**/*.{js,vue,jsx}' --fix | ||
| $ npx eslint 'app/javascript/**/*.{js,vue,jsx}' --fix |
There was a problem hiding this comment.
Line 62: マークダウンリンター違反(MD014)と、ファイルパターン・実行方法の修正が必要です。
- ドルサイン(
$)を削除してください(MD014) - ファイルパターンから
.vueを削除してください(package.json のスクリプトで対応していません) yarn lint:eslintコマンドの使用を推奨してください
🔎 推奨修正
-$ npx eslint 'app/javascript/**/*.{js,vue,jsx}' --fix
+yarn lint:eslint --fix📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| $ npx eslint 'app/javascript/**/*.{js,vue,jsx}' --fix | |
| yarn lint:eslint --fix |
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
62-62: Dollar signs used before commands without showing output
(MD014, commands-show-output)
🤖 Prompt for AI Agents
In @README.md at line 62, Update the README command string by removing the
leading dollar sign and dropping the `.vue` pattern from the glob so it becomes
npx eslint 'app/javascript/**/*.{js,jsx}' --fix, and replace that example with
the recommended npm script usage by referencing the existing yarn lint:eslint
command (suggest using yarn lint:eslint instead of running npx directly).
|
|
||
| ```shell | ||
| $ prettier app/javascript/**/*.{js,vue,jsx} --write | ||
| $ npx prettier app/javascript/**/*.{js,vue,jsx} --write |
There was a problem hiding this comment.
Line 68: マークダウンリンター違反(MD014)と、ファイルパターン・実行方法の修正が必要です。
- ドルサイン(
$)を削除してください(MD014) - ファイルパターンから
.vueを削除してください(package.json のスクリプトで対応していません) yarn lint:prettierコマンドの使用を推奨してください
🔎 推奨修正
-$ npx prettier app/javascript/**/*.{js,vue,jsx}' --write
+yarn lint:prettier --writeCommittable suggestion skipped: line range outside the PR's diff.
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
68-68: Dollar signs used before commands without showing output
(MD014, commands-show-output)
🤖 Prompt for AI Agents
In @README.md at line 68, Update the CLI example on line 68 to remove the
leading dollar sign and the .vue pattern: replace the shown command so it no
longer includes a leading "$" and remove "*.vue" from the glob, and instead
reference the repository script by recommending the existing package script name
(use "yarn lint:prettier") so readers run the linting via the project NPM/Yarn
script rather than the raw npx command.
- solid_queueテーブル作成: table_exists?で存在チェック - good_jobテーブル削除: table_exists?で存在チェック CI(schema.rb読み込み後)と本番環境(db:migrate)の 両方で正常に動作するように修正。
has_css?/has_no_css?は真偽値を返すだけでアサーションではないため、 assert_selector/assert_no_selectorに修正。
page-tabs → .page-tabs(CSSクラスセレクタの正しい形式)
Minitest::Mockを使用してtranscodeメソッドが 呼ばれたことを検証するように修正。
flunkの代わりにフラグを使用し、 Transcoder::Clientが呼ばれなかったことをassert_notで検証。
assert_includesの代わりにassertとカスタムメッセージを使用し、 失敗時のエラーログを読みやすく改善。
assert_includesはpage.body全体をエラー出力するため、 エラーログの可読性のためassertを使用。
- assert + include?の代わりにassert_selectorを使用 - 提出完了の待機用にassert_selectorを追加
例外キャッチ後にassertでボタン無効化を検証。
- コメント投稿完了の待機用にassert_selectorを追加 - assert_not_includesで拒否メールが送信されていないことを検証
good_jobをsolid_queueに移行
Summary
config.load_defaultsを 7.2 から 8.0 に更新変更点
注意事項
ActiveSupport::Configurableは Rails 8.2 で削除予定Test plan
bin/rails test test/models/を実行し、テストがパス🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Improvements
Bug Fixes
Chores
✏️ Tip: You can customize this high-level summary in your review settings.