Skip to content

Rails 7.2.2.2 → 8.1.1 アップグレード#9375

Merged
komagata merged 29 commits intomainfrom
chore/rails-8.1.1
Jan 9, 2026
Merged

Rails 7.2.2.2 → 8.1.1 アップグレード#9375
komagata merged 29 commits intomainfrom
chore/rails-8.1.1

Conversation

@komagata
Copy link
Copy Markdown
Member

@komagata komagata commented Dec 18, 2025

Summary

  • Rails を 7.2.2.2 から 8.1.1 にアップグレード
  • config.load_defaults を 7.2 から 8.0 に更新
  • react-rails を GitHub main ブランチに変更(connection_pool 3.0 との互換性のため)
  • rails-i18n のバージョン制約を解除
  • minitest を 6.0 未満に固定(Rails 8.1 との互換性のため)
  • db/schema.rb を Rails 8.1 フォーマットに更新

変更点

  • Gemfile: Rails 8.1.1, react-rails (GitHub main), rails-i18n (制約解除), minitest < 6.0
  • config/application.rb: load_defaults 8.0
  • Gemfile.lock: 各種依存関係の更新
  • db/schema.rb: Rails 8.1 フォーマット

注意事項

  • DEPRECATION WARNING: ActiveSupport::Configurable は Rails 8.2 で削除予定
  • react-rails は connection_pool 3.0 との互換性問題のため GitHub main ブランチを使用

Test plan

  • bin/rails test test/models/ を実行し、テストがパス
  • CI でテストがパスすることを確認

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Rails 8.1 対応、開発起動/CI/ジョブ実行用スクリプトとテスト実行&レポート機能を追加。ジョブキュー基盤を SolidQueue に移行。
  • Improvements

    • 開発/本番/テスト設定を整理(ログ、メール、キャッシュ、ホスト設定強化)。依存指定の見直しと静的解析導入。Puma/キュー設定や定期処理構成を追加。エラーページを英語でモダンに刷新。
  • Bug Fixes

    • アバター処理の例外対応を拡張し安定性向上。
  • Chores

    • 命名規則の整理(AI→Ai等)と多数のテストで成功メッセージ確認を追加。

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Dec 18, 2025

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Rails を 7.2.x から 8.1.1 へアップグレードし、キュー基盤を GoodJob → SolidQueue へ移行、Gem/CI/起動スクリプト・初期化子・マイグレーション・スキーマ・エラーページ・多数のテストを更新しました。

Changes

コホート / ファイル(s) 変更内容
依存関係 (Gemfile)
Gemfile
Rails を 8.1.1 に更新。bootsnap/jbuilder/puma 等のピン調整、react-rails を GitHub ref に変更。mission_control-jobs/solid_queue 追加。開発・テスト用に RuboCop 系や benchmark 等を追加。
フレームワーク defaults / 初期化子
config/initializers/new_framework_defaults_8_1.rb, config/initializers/*
Rails 8.1 defaults 用初期化子追加。inflections から AI 削除、filter_parameters 拡張、CSP コメント追加。active_support_notifications のリスナが Ai 名称へ更新。
環境設定
config/environments/*.rb
development/production/test 設定再構成(cache_store の移動、mailer 配置と delivery_method 変更、query_log_tags/verbose_redirect_logs 追加、production の app_host_name バリデーションとホスト/asset/mailer の起動時配線、action_job を solid_queue に変更)。
キュー基盤・DB マイグレーション
db/migrate/*, config/queue.yml, db/schema.rb
GoodJob 関連マイグレーション群を削除・置換し、SolidQueue 用のテーブル群を追加するマイグレーションを導入。db/schema.rb を ActiveRecord::Schema[8.1] に更新。
ルーティング / 管理 UI
config/routes.rb, config/initializers/mission_control.rb
GoodJob の mount を削除し MissionControl::Jobs::Engine/jobs にマウント。Mission Control へ production 時の Basic Auth 初期化子を追加。
起動 / CI / ユーティリティスクリプト
bin/ci, bin/dev, bin/setup, config/ci.rb, bin/rails-test-all-with-report, bin/jobs
bin/dev/bin/ci/CI設定追加、bin/setup の振る舞い変更(--reset/--skip-server、package.json 条件)、テスト集約スクリプトと SolidQueue 起動用 bin を追加。
Puma / 実行設定
config/puma.rb, config/recurring.yml, config/queue.yml
Puma に threads 設定と plugin :solid_queue を追加。キュー設定(dispatcher/workers)を config/queue.yml に導入。定期ジョブ設定を config/recurring.yml に追加。
GoodJob 削除関連
config/initializers/good_job.rb, db/migrate/* (good_job関連削除)
GoodJob 用の初期化子と複数マイグレーションを削除(GoodJob テーブル群を Drop する/削除)。
アセット / エラーページ / ドキュメント
public/*.html, config/initializers/assets.rb, README.md, AGENTS.md
エラーページ群を英語でモダン化。assets.version の表記変更。README/AGENTS を yarn→npm / bin/dev に更新。bin/yarn 削除、package.json から yarn 削除。
モデル・初期化子のリファクタ
app/models/discord/*, config/initializers/discord.rb, app/models/report_exporter.rb, app/models/user.rb
ActiveSupport::Configurable + config_accessorclass_attribute に置換。Discord 初期化を configure ブロックから直接代入へ。Zip API 呼び出しのキーワード化、avatar 処理で Vips::Error 追加 rescue。
AI 名前空間リネーム
app/jobs/*, app/models/ai/*, app/models/ai_answer_creator.rb, config/initializers/active_support_notifications.rb, test/**/*
トップレベルモジュール/クラス名 AIAi に改名(ジョブ・生成器・呼び出し部分とテストを更新)。
テスト群の修正
test/**/*(多数)
VCR→WebMock 置換、Rails.logger スタブ削除、成功メッセージ検証追加、assert_difference 範囲調整、フォーム送信の JS トリガ化、テスト再試行/並列化を環境変数ベースに切替。多くの system テストで UI 成功メッセージ検証を強化。
CI コンフィグ / コンテナ
.circleci/config.yml, .cloudbuild/*
CI を yarn→npm に移行、libheif-dev 追加、Cloud Build の DeleteDB リトライ回数/遅延増加、デプロイ環境変数名変更(GoodJob→MissionControl)。
スキップ/微修正
test/fixtures/*, test/helpers/*
テストフィクスチャの値調整、テスト補助の小さなassert追加やアサーション方式の統一(assert_selector など)。

Sequence Diagram(s)

(該当条件を満たさないため、シーケンス図は追加していません)

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers

  • okuramasafumi
  • jun-kondo

Poem

🐇 ぴょんと跳んで 8.1 に着地したよ
Gem を整えてキューを入れ替えたよ
スクリプト増えてテストはしっかり走るよ
ページは英語でにこっとおめかしだよ
にんじんかじって祝杯ぴょん! 🥕

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ❓ Inconclusive The pull request description provides a detailed summary of changes and includes key details about the upgrade, dependencies, and compatibility notes, but does not follow the specified template structure with Issue number and verification method. Consider following the repository's description template by adding Issue number section and detailed verification steps (操作手順) to make it easier for reviewers to validate the changes.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: upgrading Rails from 7.2.2.2 to 8.1.1, which is the primary objective of this pull request.

✏️ Tip: You can configure your own custom Pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cd73f02 and b2d7a7c.

⛔ Files ignored due to path filters (1)
  • Gemfile.lock is excluded by !**/*.lock
📒 Files selected for processing (27)
  • .circleci/config.yml
  • .cloudbuild/cloudbuild-staging.yaml
  • .cloudbuild/cloudbuild.yaml
  • .traceroute.yml
  • Gemfile
  • README.md
  • bin/jobs
  • config/environments/development.rb
  • config/environments/production.rb
  • config/initializers/good_job.rb
  • config/initializers/mission_control.rb
  • config/puma.rb
  • config/queue.yml
  • config/recurring.yml
  • config/routes.rb
  • db/migrate/20250828192201_create_good_jobs.rb
  • db/migrate/20251220000001_add_missing_columns_to_good_jobs.rb
  • db/migrate/20251223000001_add_missing_good_job_tables.rb
  • db/migrate/20251223000002_add_lock_type_to_good_job_processes.rb
  • db/migrate/20260107000001_create_solid_queue_tables.rb
  • db/migrate/20260107000002_drop_good_job_tables.rb
  • db/schema.rb
  • test/jobs/transcode_job_test.rb
  • test/system/comment/base_comments_test.rb
  • test/system/notifications_test.rb
  • test/system/products/wip_test.rb
  • test/system/talks_test.rb

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

❤️ Share

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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between decb4e6 and e1ed30b.

⛔ Files ignored due to path filters (1)
  • Gemfile.lock is 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.rb
  • db/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.rb
  • db/schema.rb
db/**

📄 CodeRabbit inference engine (AGENTS.md)

Database migrations and schema should be stored in db/ directory; app-specific utilities in lib/; static assets in public/

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のアップグレードパスに従い、生成されたマイグレーションをそのまま使用することが適切。

Comment thread Gemfile
gem 'jbuilder', '~> 2.7'
gem 'puma', '~> 6.0'
gem 'rails', '7.2.2.2'
gem 'rails', '8.1.1'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# Examine the Gemfile to understand all the changes
cat Gemfile | head -150

Repository: 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.

Comment thread Gemfile Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e1ed30b and 5d440f2.

⛔ Files ignored due to path filters (3)
  • Gemfile.lock is excluded by !**/*.lock
  • public/icon.png is excluded by !**/*.png
  • public/icon.svg is excluded by !**/*.svg
📒 Files selected for processing (25)
  • Gemfile
  • app/jobs/ai_answer_create_job.rb
  • app/models/ai/answer_generator.rb
  • app/models/ai_answer_creator.rb
  • app/models/report_exporter.rb
  • bin/ci
  • bin/dev
  • bin/rubocop
  • bin/setup
  • config/ci.rb
  • config/environments/development.rb
  • config/environments/production.rb
  • config/environments/test.rb
  • config/initializers/active_support_notifications.rb
  • config/initializers/assets.rb
  • config/initializers/content_security_policy.rb
  • config/initializers/filter_parameter_logging.rb
  • config/initializers/inflections.rb
  • config/initializers/new_framework_defaults_8_1.rb
  • config/puma.rb
  • public/400.html
  • public/404.html
  • public/406-unsupported-browser.html
  • public/422.html
  • public/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 under javascript/ (Shakapacker)

Files:

  • app/jobs/ai_answer_create_job.rb
  • app/models/ai_answer_creator.rb
  • app/models/report_exporter.rb
  • app/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.rb
  • app/models/ai_answer_creator.rb
  • config/initializers/active_support_notifications.rb
  • config/environments/development.rb
  • config/puma.rb
  • config/initializers/inflections.rb
  • app/models/report_exporter.rb
  • config/initializers/filter_parameter_logging.rb
  • config/ci.rb
  • config/initializers/content_security_policy.rb
  • app/models/ai/answer_generator.rb
  • config/initializers/new_framework_defaults_8_1.rb
  • config/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.rb
  • app/models/ai_answer_creator.rb
  • config/initializers/active_support_notifications.rb
  • config/environments/development.rb
  • config/puma.rb
  • config/initializers/inflections.rb
  • app/models/report_exporter.rb
  • config/initializers/filter_parameter_logging.rb
  • config/ci.rb
  • config/initializers/content_security_policy.rb
  • app/models/ai/answer_generator.rb
  • config/initializers/new_framework_defaults_8_1.rb
  • config/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.rb
  • config/environments/development.rb
  • config/puma.rb
  • config/initializers/inflections.rb
  • config/initializers/filter_parameter_logging.rb
  • config/ci.rb
  • config/initializers/content_security_policy.rb
  • config/initializers/new_framework_defaults_8_1.rb
  • config/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.html
  • public/400.html
  • public/422.html
  • public/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/ci
  • config/ci.rb
  • bin/dev
  • bin/setup
  • config/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/ci
  • config/ci.rb
  • Gemfile
  • bin/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.rb
  • config/initializers/filter_parameter_logging.rb
  • config/initializers/content_security_policy.rb
  • config/initializers/new_framework_defaults_8_1.rb
  • Gemfile
  • config/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.rb
  • config/ci.rb
  • config/initializers/new_framework_defaults_8_1.rb
  • config/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.rb
  • config/initializers/new_framework_defaults_8_1.rb
  • Gemfile
  • config/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.rb
  • Gemfile
  • 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-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_tagjavascript_include_tagstylesheet_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.ymlpool: <%= 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_logsverbose_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_storeconfig.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: パラメータフィルタリングの強化を承認します。

:email: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 名前空間への移行に必要な変更です。しかし、同時に削除された APIFAQ のアクロニム規則は、コードベースで実際に使用されています。

コードベースに以下の実装があるため、これらのインフレクションルール削除による影響を検証する必要があります:

  • API: 複数の API::*Controller クラス(例: API::UsersController, API::SessionController など)が app/controllers/api/ に存在
  • FAQ: FAQ モデルクラスとそれに関連するルート、ビューが存在(例: app/models/faq.rb, admin/faqs_controller.rb)

これらのインフレクションルール削除は Rails のルート生成や URL ヘルパー名に影響を与える可能性があります。buzzprogress はアクティブに使用されていないため、削除しても問題ありませんが、APIFAQ に関しては現在のアプリケーションを実際に実行して、ルート生成と URL ヘルパーが正常に機能することを確認してください。

app/jobs/ai_answer_create_job.rb (1)

3-9: LGTM! 名前空間の統一が適切に実施されています

AIAi への名前空間変更は、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ホストの許可リスト追加も、セキュリティ面で適切な対応です。

Comment thread app/models/ai/answer_generator.rb
Comment thread config/ci.rb Outdated
Comment thread config/environments/production.rb Outdated
Comment thread config/puma.rb Outdated
Comment on lines +108 to +114
main article br {
display: none;

@media(min-width: 48em) {
display: inline;
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 で既に :google サービスが定義されているため、本番環境では :google を使用してください。

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5d440f2 and b550504.

⛔ Files ignored due to path filters (2)
  • public/icon.png is excluded by !**/*.png
  • public/icon.svg is excluded by !**/*.svg
📒 Files selected for processing (23)
  • app/jobs/ai_answer_create_job.rb
  • app/models/ai/answer_generator.rb
  • app/models/ai_answer_creator.rb
  • bin/ci
  • bin/dev
  • bin/rubocop
  • bin/setup
  • config/ci.rb
  • config/environments/development.rb
  • config/environments/production.rb
  • config/environments/test.rb
  • config/initializers/active_support_notifications.rb
  • config/initializers/assets.rb
  • config/initializers/content_security_policy.rb
  • config/initializers/filter_parameter_logging.rb
  • config/initializers/inflections.rb
  • config/initializers/new_framework_defaults_8_1.rb
  • config/puma.rb
  • public/400.html
  • public/404.html
  • public/406-unsupported-browser.html
  • public/422.html
  • public/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 under javascript/ (Shakapacker)

Files:

  • app/jobs/ai_answer_create_job.rb
  • app/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.rb
  • config/initializers/inflections.rb
  • config/environments/development.rb
  • config/ci.rb
  • config/initializers/filter_parameter_logging.rb
  • app/models/ai_answer_creator.rb
  • config/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.rb
  • config/initializers/inflections.rb
  • config/environments/development.rb
  • config/ci.rb
  • config/initializers/filter_parameter_logging.rb
  • app/models/ai_answer_creator.rb
  • config/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.rb
  • config/environments/development.rb
  • config/ci.rb
  • config/initializers/filter_parameter_logging.rb
  • config/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.rb
  • config/ci.rb
  • config/initializers/filter_parameter_logging.rb
  • config/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.rb
  • bin/rubocop
  • config/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.rb
  • bin/setup
  • bin/dev
  • config/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.rb
  • config/initializers/filter_parameter_logging.rb
  • config/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.rb
  • bin/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.html
  • public/422.html
  • public/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 がデフォルトのフィルタパラメータに追加されました。:email は従来からデフォルトに含まれています。これらを初期化ファイルで明示的に追加することで、ログからのPII(個人識別情報)やクレジットカード情報の漏洩を防ぎます。

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.flushexec前に呼び出すのは、出力が確実に表示されるための良いプラクティスです。

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

Comment thread app/models/ai_answer_creator.rb
Comment thread config/initializers/inflections.rb Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_namenil の場合に config.hostsnil が追加されます。

Line 106は CLOUD_RUN_HOST_NAME の存在チェックがありますが、Line 107には app_host_name のガードがありません。アセットプリコンパイル時(SECRET_KEY_BASE == "dummy")に app_host_namenil となる可能性があります。

🔎 修正案
   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 で定義済みの :google を使用してください。

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

📥 Commits

Reviewing files that changed from the base of the PR and between b550504 and 9817262.

⛔ Files ignored due to path filters (2)
  • public/icon.png is excluded by !**/*.png
  • public/icon.svg is excluded by !**/*.svg
📒 Files selected for processing (18)
  • bin/ci
  • bin/dev
  • bin/rubocop
  • bin/setup
  • config/ci.rb
  • config/environments/development.rb
  • config/environments/production.rb
  • config/environments/test.rb
  • config/initializers/assets.rb
  • config/initializers/content_security_policy.rb
  • config/initializers/filter_parameter_logging.rb
  • config/initializers/new_framework_defaults_8_1.rb
  • config/puma.rb
  • public/400.html
  • public/404.html
  • public/406-unsupported-browser.html
  • public/422.html
  • public/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.rb
  • config/environments/development.rb
  • config/ci.rb
  • config/initializers/new_framework_defaults_8_1.rb
  • config/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.rb
  • config/environments/development.rb
  • config/ci.rb
  • config/initializers/new_framework_defaults_8_1.rb
  • config/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.rb
  • config/environments/development.rb
  • config/ci.rb
  • config/initializers/new_framework_defaults_8_1.rb
  • config/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/ci
  • bin/setup
  • config/ci.rb
  • config/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/ci
  • bin/setup
  • 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 **/*.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/rubocop
  • config/environments/development.rb
  • config/ci.rb
  • config/initializers/new_framework_defaults_8_1.rb
  • config/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.rb
  • config/environments/development.rb
  • config/ci.rb
  • config/initializers/new_framework_defaults_8_1.rb
  • config/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.rb
  • config/ci.rb
  • config/initializers/new_framework_defaults_8_1.rb
  • 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.rb
  • config/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.html
  • public/500.html
  • public/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のデフォルト設定に準拠した適切な変更です。

:email: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_defaults8.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.flushexec 前の正しいパターンです。

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 パイプラインを実行するためのシンプルで正しい実装です。

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 で既に google サービスが設定されているため、本番環境では :google を使用してください。

🔎 修正案
-  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

📥 Commits

Reviewing files that changed from the base of the PR and between 9817262 and 5224b6d.

⛔ Files ignored due to path filters (2)
  • public/icon.png is excluded by !**/*.png
  • public/icon.svg is excluded by !**/*.svg
📒 Files selected for processing (18)
  • bin/ci
  • bin/dev
  • bin/rubocop
  • bin/setup
  • config/ci.rb
  • config/environments/development.rb
  • config/environments/production.rb
  • config/environments/test.rb
  • config/initializers/assets.rb
  • config/initializers/content_security_policy.rb
  • config/initializers/filter_parameter_logging.rb
  • config/initializers/new_framework_defaults_8_1.rb
  • config/puma.rb
  • public/400.html
  • public/404.html
  • public/406-unsupported-browser.html
  • public/422.html
  • public/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.rb
  • config/environments/production.rb
  • config/environments/development.rb
  • config/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.rb
  • config/environments/production.rb
  • config/environments/development.rb
  • config/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.rb
  • config/environments/production.rb
  • config/environments/development.rb
  • config/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.html
  • public/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/setup
  • config/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.rb
  • config/environments/production.rb
  • config/environments/development.rb
  • config/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.rb
  • config/environments/production.rb
  • config/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.rb
  • config/environments/development.rb
  • config/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.rb
  • config/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: セキュリティ向上:機密パラメータのフィルタリングを拡張

:email: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_defaults8.1 に更新できます。

config/environments/production.rb (2)

36-44: Rails 8.1 のログ設定とヘルスチェックの改善

ログ設定の更新とヘルスチェックパスのサイレンシングが適切に実装されています:

  • タグ付きロギングによるリクエスト追跡の向上
  • /up エンドポイントのログノイズ削減

Rails 8.1 のベストプラクティスに準拠しています。


89-107: 本番環境のホスト名検証とセキュリティの強化

APP_HOST_NAME の起動時検証と各種ホスト設定の統合が適切に実装されています:

  • 必須環境変数の起動時検証によるエラーの早期発見
  • メーラー、アセット、ルーティングの統一されたホスト設定
  • HTTPS の強制による安全な通信

本番環境のセキュリティと設定の堅牢性が向上しています。

@komagata komagata force-pushed the chore/rails-8.1.1 branch 3 times, most recently from 19c9121 to f49bff4 Compare January 4, 2026 04:54
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_codesubdivision_codeなし)を期待するテストが失敗する可能性があります。

以下のいずれかの対応が必要です:

  • 最初の定義(792-805行目)を削除して、2番目の定義のみを残す
  • 2番目の定義(831-846行目)を削除して、最初の定義にcountry_codesubdivision_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 '定期イベントを作成しました。'
+  end
config/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)は実行されません。以下のいずれかの対応を推奨します:

  1. 近いうちに再有効化する予定がない場合: テスト本体(lines 76-88)を削除し、skipのみを残す
  2. 将来的に再有効化する予定がある場合: テストコードを残し、再有効化の条件や必要な修正を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
 end
test/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_namenil または空文字列になる可能性があります。

その場合:

  • 108行目: config.hosts << app_host_namenil を追加
  • 114行目: Rails.application.routes.default_url_options[:host] = app_host_namenil を設定

これらの設定にアクセスされる可能性がある場合、予期しない動作を引き起こす可能性があります。

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'
end

Also applies to: 114-115

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5224b6d and f49bff4.

⛔ Files ignored due to path filters (2)
  • public/icon.png is excluded by !**/*.png
  • public/icon.svg is excluded by !**/*.svg
📒 Files selected for processing (55)
  • app/models/discord/server.rb
  • app/models/discord/times_category.rb
  • app/models/user.rb
  • bin/ci
  • bin/claude-system-test
  • bin/dev
  • bin/rails-test-all-with-report
  • bin/rubocop
  • bin/setup
  • config/ci.rb
  • config/environments/development.rb
  • config/environments/production.rb
  • config/environments/test.rb
  • config/initializers/assets.rb
  • config/initializers/content_security_policy.rb
  • config/initializers/discord.rb
  • config/initializers/filter_parameter_logging.rb
  • config/initializers/new_framework_defaults_8_1.rb
  • config/puma.rb
  • public/400.html
  • public/404.html
  • public/406-unsupported-browser.html
  • public/422.html
  • public/500.html
  • test/fixtures/users.yml
  • test/models/discord_driver_test.rb
  • test/supports/mention_helper.rb
  • test/system/admin/users_test.rb
  • test/system/corporate_training_inquiry_system_test.rb
  • test/system/events/crud_test.rb
  • test/system/events/wip_test.rb
  • test/system/home/events_test.rb
  • test/system/markdown_test.rb
  • test/system/mentor/courses_test.rb
  • test/system/notification/mention_test.rb
  • test/system/notification/products_test.rb
  • test/system/notification/questions_test.rb
  • test/system/notifications/pagination_test.rb
  • test/system/notifications_bell_test.rb
  • test/system/pages/notification_test.rb
  • test/system/practice/not_logged_in_test.rb
  • test/system/practices/mentor_test.rb
  • test/system/practices/summary_test.rb
  • test/system/product/unchecked_test.rb
  • test/system/products/wip_test.rb
  • test/system/questions/wip_test.rb
  • test/system/questions_test.rb
  • test/system/regular_events/announcement_test.rb
  • test/system/regular_events/crud_test.rb
  • test/system/regular_events/participation_test.rb
  • test/system/reports/notification_test.rb
  • test/system/reset_password_test.rb
  • test/system/users/profile_test.rb
  • test/system/works_test.rb
  • test/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 in test/fixtures/; test files should be named *_test.rb
Use Minitest + Capybara for system tests; place unit and integration tests under matching test/* directories

Files:

  • test/system/practice/not_logged_in_test.rb
  • test/system/works_test.rb
  • test/system/practices/summary_test.rb
  • test/system/regular_events/announcement_test.rb
  • test/system/notifications_bell_test.rb
  • test/system/reports/notification_test.rb
  • test/system/mentor/courses_test.rb
  • test/system/questions_test.rb
  • test/system/products/wip_test.rb
  • test/system/users/profile_test.rb
  • test/system/questions/wip_test.rb
  • test/system/regular_events/participation_test.rb
  • test/system/corporate_training_inquiry_system_test.rb
  • test/models/discord_driver_test.rb
  • test/system/admin/users_test.rb
  • test/system/practices/mentor_test.rb
  • test/system/home/events_test.rb
  • test/system/reset_password_test.rb
  • test/system/notification/products_test.rb
  • test/system/notifications/pagination_test.rb
  • test/system/markdown_test.rb
  • test/system/pages/notification_test.rb
  • test/system/notification/mention_test.rb
  • test/system/events/crud_test.rb
  • test/system/product/unchecked_test.rb
  • test/system/events/wip_test.rb
  • test/system/regular_events/crud_test.rb
  • test/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.rb
  • test/system/works_test.rb
  • test/system/practices/summary_test.rb
  • test/system/regular_events/announcement_test.rb
  • config/initializers/assets.rb
  • test/system/notifications_bell_test.rb
  • app/models/discord/times_category.rb
  • test/system/reports/notification_test.rb
  • test/system/mentor/courses_test.rb
  • config/initializers/discord.rb
  • config/initializers/content_security_policy.rb
  • test/test_helper.rb
  • test/supports/mention_helper.rb
  • test/system/questions_test.rb
  • test/system/products/wip_test.rb
  • test/system/users/profile_test.rb
  • test/system/questions/wip_test.rb
  • test/system/regular_events/participation_test.rb
  • test/system/corporate_training_inquiry_system_test.rb
  • app/models/discord/server.rb
  • test/models/discord_driver_test.rb
  • test/system/admin/users_test.rb
  • test/system/practices/mentor_test.rb
  • test/system/home/events_test.rb
  • test/system/reset_password_test.rb
  • test/system/notification/products_test.rb
  • test/system/notifications/pagination_test.rb
  • test/system/markdown_test.rb
  • test/system/pages/notification_test.rb
  • test/system/notification/mention_test.rb
  • test/system/events/crud_test.rb
  • config/puma.rb
  • test/system/product/unchecked_test.rb
  • test/system/events/wip_test.rb
  • test/system/regular_events/crud_test.rb
  • config/environments/production.rb
  • config/environments/development.rb
  • test/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.rb
  • test/system/works_test.rb
  • test/system/practices/summary_test.rb
  • test/system/regular_events/announcement_test.rb
  • config/initializers/assets.rb
  • test/system/notifications_bell_test.rb
  • app/models/discord/times_category.rb
  • test/system/reports/notification_test.rb
  • test/system/mentor/courses_test.rb
  • config/initializers/discord.rb
  • config/initializers/content_security_policy.rb
  • test/test_helper.rb
  • test/supports/mention_helper.rb
  • test/system/questions_test.rb
  • test/system/products/wip_test.rb
  • test/system/users/profile_test.rb
  • test/system/questions/wip_test.rb
  • test/system/regular_events/participation_test.rb
  • test/system/corporate_training_inquiry_system_test.rb
  • app/models/discord/server.rb
  • test/models/discord_driver_test.rb
  • test/system/admin/users_test.rb
  • test/system/practices/mentor_test.rb
  • test/system/home/events_test.rb
  • test/system/reset_password_test.rb
  • test/system/notification/products_test.rb
  • test/system/notifications/pagination_test.rb
  • test/system/markdown_test.rb
  • test/system/pages/notification_test.rb
  • test/system/notification/mention_test.rb
  • test/system/events/crud_test.rb
  • config/puma.rb
  • test/system/product/unchecked_test.rb
  • test/system/events/wip_test.rb
  • test/system/regular_events/crud_test.rb
  • config/environments/production.rb
  • config/environments/development.rb
  • test/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.rb
  • test/system/works_test.rb
  • test/system/practices/summary_test.rb
  • test/system/regular_events/announcement_test.rb
  • test/system/notifications_bell_test.rb
  • test/system/reports/notification_test.rb
  • test/system/mentor/courses_test.rb
  • test/test_helper.rb
  • test/supports/mention_helper.rb
  • test/system/questions_test.rb
  • test/system/products/wip_test.rb
  • test/system/users/profile_test.rb
  • test/system/questions/wip_test.rb
  • test/system/regular_events/participation_test.rb
  • test/system/corporate_training_inquiry_system_test.rb
  • test/models/discord_driver_test.rb
  • test/system/admin/users_test.rb
  • test/system/practices/mentor_test.rb
  • test/system/home/events_test.rb
  • test/system/reset_password_test.rb
  • test/system/notification/products_test.rb
  • test/system/notifications/pagination_test.rb
  • test/system/markdown_test.rb
  • test/system/pages/notification_test.rb
  • test/system/notification/mention_test.rb
  • test/system/events/crud_test.rb
  • test/system/product/unchecked_test.rb
  • test/system/events/wip_test.rb
  • test/system/regular_events/crud_test.rb
  • test/fixtures/users.yml
  • test/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.rb
  • test/system/works_test.rb
  • test/system/practices/summary_test.rb
  • test/system/regular_events/announcement_test.rb
  • test/system/notifications_bell_test.rb
  • test/system/reports/notification_test.rb
  • test/system/mentor/courses_test.rb
  • test/test_helper.rb
  • test/supports/mention_helper.rb
  • test/system/questions_test.rb
  • test/system/products/wip_test.rb
  • test/system/users/profile_test.rb
  • test/system/questions/wip_test.rb
  • test/system/regular_events/participation_test.rb
  • test/system/corporate_training_inquiry_system_test.rb
  • test/models/discord_driver_test.rb
  • test/system/admin/users_test.rb
  • test/system/practices/mentor_test.rb
  • test/system/home/events_test.rb
  • test/system/reset_password_test.rb
  • test/system/notification/products_test.rb
  • test/system/notifications/pagination_test.rb
  • test/system/markdown_test.rb
  • test/system/pages/notification_test.rb
  • test/system/notification/mention_test.rb
  • test/system/events/crud_test.rb
  • test/system/product/unchecked_test.rb
  • test/system/events/wip_test.rb
  • test/system/regular_events/crud_test.rb
  • test/fixtures/users.yml
  • test/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.rb
  • config/initializers/discord.rb
  • config/initializers/content_security_policy.rb
  • config/puma.rb
  • config/environments/production.rb
  • config/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 under javascript/ (Shakapacker)

Files:

  • app/models/discord/times_category.rb
  • app/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.rb
  • test/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.rb
  • test/system/mentor/courses_test.rb
  • test/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.rb
  • test/system/regular_events/participation_test.rb
  • test/system/admin/users_test.rb
  • test/system/home/events_test.rb
  • test/system/events/crud_test.rb
  • test/system/events/wip_test.rb
  • test/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.rb
  • test/system/mentor/courses_test.rb
  • test/system/regular_events/participation_test.rb
  • test/system/pages/notification_test.rb
  • test/system/events/crud_test.rb
  • test/system/events/wip_test.rb
  • test/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.html
  • public/404.html
  • public/422.html
  • public/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.rb
  • config/initializers/content_security_policy.rb
  • config/puma.rb
  • config/environments/production.rb
  • config/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.rb
  • test/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.rb
  • test/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.rb
  • bin/rails-test-all-with-report
  • test/test_helper.rb
  • test/system/questions_test.rb
  • test/system/questions/wip_test.rb
  • bin/setup
  • test/system/corporate_training_inquiry_system_test.rb
  • test/system/admin/users_test.rb
  • test/system/practices/mentor_test.rb
  • test/system/notifications/pagination_test.rb
  • test/system/markdown_test.rb
  • test/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.rb
  • test/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-report
  • test/test_helper.rb
  • test/system/practices/mentor_test.rb
  • test/system/notifications/pagination_test.rb
  • test/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.rb
  • bin/setup
  • config/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.rb
  • test/models/discord_driver_test.rb
  • test/system/notification/products_test.rb
  • config/puma.rb
  • test/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.rb
  • test/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.rb
  • test/system/admin/users_test.rb
  • test/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.rb
  • test/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.rb
  • config/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.rb
  • 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/puma.rb
  • config/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.rb
  • config/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_requestedcancel_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_codesubdivision_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.rbtest/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_matchcurrent_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_WORKERSMINITEST_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::Configurableconfig_accessorからclass_attributeへの移行は、PRの目的に記載されている非推奨警告に対応するものです。instance_accessor: falseにより、クラスレベルでのみアクセス可能な属性として、元のconfig_accessorの動作を維持しています。

初期化ファイル(config/initializers/discord.rb)では、これらの属性が正しくクラスレベルで設定されており、クラス内のすべての使用箇所(class << selfブロック内でguild_idauthorize_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

Comment thread bin/claude-system-test Outdated
export PROMPT_COMMAND="${PROMPT_COMMAND:-}"

# Ensure mise is activated for proper Ruby/Node versions
eval "$(mise activate bash)"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

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.

Suggested change
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.

Comment thread bin/claude-system-test Outdated
Comment on lines +49 to +50
# Replace the default in-process memory cache store with a durable alternative.
config.cache_store = :memory_store
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

git log --oneline --all -- config/environments/production.rb | head -20

Repository: 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 -100

Repository: fjordllc/bootcamp

Length of output: 43


🏁 Script executed:

git log --all -S "memory_store" --oneline -- config/environments/production.rb

Repository: 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 -200

Repository: 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 を使用している」など実装に合う説明に書き換える。

Comment thread test/system/corporate_training_inquiry_system_test.rb
Comment thread test/system/practice/not_logged_in_test.rb
Comment thread test/system/practices/mentor_test.rb Outdated
Comment thread test/system/product/unchecked_test.rb Outdated
Comment thread test/system/regular_events/announcement_test.rb Outdated
Comment thread test/system/works_test.rb
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ 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

📥 Commits

Reviewing files that changed from the base of the PR and between f49bff4 and 5ffa440.

⛔ Files ignored due to path filters (1)
  • Gemfile.lock is excluded by !**/*.lock
📒 Files selected for processing (13)
  • Gemfile
  • bin/jobs
  • config/environments/development.rb
  • config/environments/production.rb
  • config/initializers/good_job.rb
  • config/initializers/mission_control.rb
  • config/queue.yml
  • config/recurring.yml
  • config/routes.rb
  • db/migrate/20250828192201_create_good_jobs.rb
  • db/migrate/20260104051844_create_solid_queue_tables.rb
  • db/migrate/20260104051945_drop_good_job_tables.rb
  • db/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.rb
  • config/environments/development.rb
  • config/recurring.yml
  • config/queue.yml
  • config/environments/production.rb
  • config/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.rb
  • db/migrate/20260104051844_create_solid_queue_tables.rb
  • config/environments/development.rb
  • db/migrate/20260104051945_drop_good_job_tables.rb
  • config/environments/production.rb
  • db/schema.rb
  • config/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.rb
  • db/migrate/20260104051844_create_solid_queue_tables.rb
  • config/environments/development.rb
  • db/migrate/20260104051945_drop_good_job_tables.rb
  • config/environments/production.rb
  • db/schema.rb
  • config/initializers/mission_control.rb
db/**

📄 CodeRabbit inference engine (AGENTS.md)

Database migrations and schema should be stored in db/ directory; app-specific utilities in lib/; static assets in public/

Files:

  • db/migrate/20260104051844_create_solid_queue_tables.rb
  • db/migrate/20260104051945_drop_good_job_tables.rb
  • db/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.rb
  • db/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.rb
  • config/environments/production.rb
  • 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 config/** : Configuration files in `config/` should include environment settings, routes, and lints (`.rubocop.yml`, `config/slim_lint.yml`)

Applied to files:

  • config/environments/development.rb
  • config/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.rb
  • config/environments/production.rb
  • config/initializers/mission_control.rb
  • 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: Use `bin/setup` for local database setup and dependency installation; avoid manual tweaks in `config/` without team discussion

Applied to files:

  • config/environments/development.rb
  • config/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.rb
  • 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:

  • config/environments/production.rb
  • 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:

  • config/environments/production.rb
  • 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:

  • config/environments/production.rb
  • Gemfile
📚 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_queuemission_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_allindex_solid_queue_poll_by_queueindex_solid_queue_dispatch_all などのインデックスは、キュー操作のパフォーマンスを最適化します。
  • based on learnings: 外部 gem が生成するマイグレーションは gem 内部のロジックと連携しているため、そのまま使用することが適切です。

1135-1140: SolidQueue 外部キー制約は適切に設定されています。

on_delete: :cascade により、ジョブ削除時に関連する実行レコードが自動的にクリーンアップされます。これはキューシステムのデータ整合性を維持するための正しいアプローチです。

Comment thread config/initializers/mission_control.rb Outdated
Comment on lines +3 to +7
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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

本番環境で認証情報が未設定の場合のセキュリティリスク

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5ffa440 and f6d583d.

⛔ Files ignored due to path filters (1)
  • Gemfile.lock is 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 の範囲内で問題なく機能しています。このバージョン指定に懸念はありません。

Comment thread Gemfile Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_namenil のままです。これにより 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ユーザーの唯一の作品)を削除しています。削除後のページ状態は同一のはずですが、管理者テストにのみ空状態メッセージ「作品はまだありません。」のアサーションが追加されています。

両テストで一貫性を保つため、以下のいずれかを検討してください:

  1. 「destroy my work」テストにも同じ空状態メッセージのアサーションを追加する
  2. 管理者テストのみこのアサーションを行う明確な理由を文書化する
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"' EXIT
config/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

📥 Commits

Reviewing files that changed from the base of the PR and between f6d583d and 19800ce.

⛔ Files ignored due to path filters (3)
  • Gemfile.lock is excluded by !**/*.lock
  • public/icon.png is excluded by !**/*.png
  • public/icon.svg is excluded by !**/*.svg
📒 Files selected for processing (67)
  • Gemfile
  • app/models/discord/server.rb
  • app/models/discord/times_category.rb
  • app/models/report_exporter.rb
  • app/models/user.rb
  • bin/ci
  • bin/claude-system-test
  • bin/dev
  • bin/jobs
  • bin/rails-test-all-with-report
  • bin/rubocop
  • bin/setup
  • config/ci.rb
  • config/environments/development.rb
  • config/environments/production.rb
  • config/environments/test.rb
  • config/initializers/assets.rb
  • config/initializers/content_security_policy.rb
  • config/initializers/discord.rb
  • config/initializers/filter_parameter_logging.rb
  • config/initializers/good_job.rb
  • config/initializers/mission_control.rb
  • config/initializers/new_framework_defaults_8_1.rb
  • config/puma.rb
  • config/queue.yml
  • config/recurring.yml
  • config/routes.rb
  • db/migrate/20250828192201_create_good_jobs.rb
  • db/migrate/20260104051844_create_solid_queue_tables.rb
  • db/migrate/20260104051945_drop_good_job_tables.rb
  • db/schema.rb
  • public/400.html
  • public/404.html
  • public/406-unsupported-browser.html
  • public/422.html
  • public/500.html
  • test/fixtures/users.yml
  • test/models/discord_driver_test.rb
  • test/supports/mention_helper.rb
  • test/system/admin/users_test.rb
  • test/system/corporate_training_inquiry_system_test.rb
  • test/system/events/crud_test.rb
  • test/system/events/wip_test.rb
  • test/system/home/events_test.rb
  • test/system/markdown_test.rb
  • test/system/mentor/courses_test.rb
  • test/system/notification/mention_test.rb
  • test/system/notification/products_test.rb
  • test/system/notification/questions_test.rb
  • test/system/notifications/pagination_test.rb
  • test/system/notifications_bell_test.rb
  • test/system/pages/notification_test.rb
  • test/system/practice/not_logged_in_test.rb
  • test/system/practices/mentor_test.rb
  • test/system/practices/summary_test.rb
  • test/system/product/unchecked_test.rb
  • test/system/products/wip_test.rb
  • test/system/questions/wip_test.rb
  • test/system/questions_test.rb
  • test/system/regular_events/announcement_test.rb
  • test/system/regular_events/crud_test.rb
  • test/system/regular_events/participation_test.rb
  • test/system/reports/notification_test.rb
  • test/system/reset_password_test.rb
  • test/system/users/profile_test.rb
  • test/system/works_test.rb
  • test/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 in test/fixtures/; test files should be named *_test.rb
Use Minitest + Capybara for system tests; place unit and integration tests under matching test/* directories

Files:

  • test/system/practices/summary_test.rb
  • test/system/regular_events/participation_test.rb
  • test/system/practices/mentor_test.rb
  • test/system/products/wip_test.rb
  • test/system/events/wip_test.rb
  • test/system/admin/users_test.rb
  • test/system/pages/notification_test.rb
  • test/system/works_test.rb
  • test/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.rb
  • db/migrate/20260104051844_create_solid_queue_tables.rb
  • app/models/report_exporter.rb
  • config/initializers/discord.rb
  • test/system/regular_events/participation_test.rb
  • test/system/practices/mentor_test.rb
  • test/system/products/wip_test.rb
  • test/test_helper.rb
  • test/system/events/wip_test.rb
  • db/migrate/20260104051945_drop_good_job_tables.rb
  • config/ci.rb
  • test/system/admin/users_test.rb
  • test/system/pages/notification_test.rb
  • test/system/works_test.rb
  • config/environments/production.rb
  • db/schema.rb
  • test/system/notifications_bell_test.rb
  • config/environments/development.rb
  • test/supports/mention_helper.rb
  • app/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.rb
  • db/migrate/20260104051844_create_solid_queue_tables.rb
  • app/models/report_exporter.rb
  • config/initializers/discord.rb
  • test/system/regular_events/participation_test.rb
  • test/system/practices/mentor_test.rb
  • test/system/products/wip_test.rb
  • test/test_helper.rb
  • test/system/events/wip_test.rb
  • db/migrate/20260104051945_drop_good_job_tables.rb
  • config/ci.rb
  • test/system/admin/users_test.rb
  • test/system/pages/notification_test.rb
  • test/system/works_test.rb
  • config/environments/production.rb
  • db/schema.rb
  • test/system/notifications_bell_test.rb
  • config/environments/development.rb
  • test/supports/mention_helper.rb
  • app/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.rb
  • test/system/regular_events/participation_test.rb
  • test/system/practices/mentor_test.rb
  • test/system/products/wip_test.rb
  • test/test_helper.rb
  • test/system/events/wip_test.rb
  • test/system/admin/users_test.rb
  • test/system/pages/notification_test.rb
  • test/system/works_test.rb
  • test/system/notifications_bell_test.rb
  • test/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.rb
  • test/system/regular_events/participation_test.rb
  • test/system/practices/mentor_test.rb
  • test/system/products/wip_test.rb
  • test/test_helper.rb
  • test/system/events/wip_test.rb
  • test/system/admin/users_test.rb
  • test/system/pages/notification_test.rb
  • test/system/works_test.rb
  • test/system/notifications_bell_test.rb
  • test/supports/mention_helper.rb
db/**

📄 CodeRabbit inference engine (AGENTS.md)

Database migrations and schema should be stored in db/ directory; app-specific utilities in lib/; static assets in public/

Files:

  • db/migrate/20260104051844_create_solid_queue_tables.rb
  • db/migrate/20260104051945_drop_good_job_tables.rb
  • db/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 under javascript/ (Shakapacker)

Files:

  • app/models/report_exporter.rb
  • app/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.rb
  • config/ci.rb
  • config/environments/production.rb
  • config/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.rb
  • test/system/products/wip_test.rb
  • Gemfile
  • config/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.rb
  • test/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.rb
  • test/system/events/wip_test.rb
  • test/system/pages/notification_test.rb
  • test/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.rb
  • test/system/events/wip_test.rb
  • test/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.rb
  • config/ci.rb
  • Gemfile
  • bin/setup
  • bin/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.rb
  • Gemfile
  • bin/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.rb
  • 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: Use `bin/setup` for local database setup and dependency installation; avoid manual tweaks in `config/` without team discussion

Applied to files:

  • test/test_helper.rb
  • config/ci.rb
  • bin/dev
  • config/environments/production.rb
  • bin/setup
  • config/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.rb
  • config/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.rb
  • Gemfile
📚 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.rb
  • db/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.rb
  • 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:

  • config/ci.rb
  • Gemfile
  • config/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
  • 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:

  • config/ci.rb
  • Gemfile
  • config/environments/production.rb
  • config/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.html
  • public/422.html
  • public/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.rb
  • test/system/pages/notification_test.rb
  • test/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.rb
  • test/system/pages/notification_test.rb
  • test/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.rb
  • db/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.rb
  • test/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:

  • Gemfile
  • 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:

  • Gemfile
  • config/environments/production.rb
  • config/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:

  • Gemfile
  • config/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.rb
  • config/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 の期待される動作です。

Comment thread config/environments/production.rb Outdated
Comment on lines +52 to +54
# 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 } }
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 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.

Comment thread Gemfile Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 19800ce and 1e81502.

⛔ Files ignored due to path filters (1)
  • Gemfile.lock is excluded by !**/*.lock
📒 Files selected for processing (14)
  • .cloudbuild/cloudbuild-staging.yaml
  • .cloudbuild/cloudbuild.yaml
  • .traceroute.yml
  • Gemfile
  • app/jobs/ai_answer_create_job.rb
  • app/models/ai/answer_generator.rb
  • app/models/ai_answer_creator.rb
  • config/ci.rb
  • config/initializers/active_support_notifications.rb
  • config/initializers/inflections.rb
  • db/schema.rb
  • test/jobs/ai_answer_create_job_test.rb
  • test/system/admin/users_test.rb
  • test/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 under javascript/ (Shakapacker)

Files:

  • app/models/ai_answer_creator.rb
  • app/jobs/ai_answer_create_job.rb
  • app/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.rb
  • app/jobs/ai_answer_create_job.rb
  • test/jobs/ai_answer_create_job_test.rb
  • test/test_helper.rb
  • app/models/ai/answer_generator.rb
  • config/ci.rb
  • config/initializers/inflections.rb
  • config/initializers/active_support_notifications.rb
  • test/system/admin/users_test.rb
  • db/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.rb
  • app/jobs/ai_answer_create_job.rb
  • test/jobs/ai_answer_create_job_test.rb
  • test/test_helper.rb
  • app/models/ai/answer_generator.rb
  • config/ci.rb
  • config/initializers/inflections.rb
  • config/initializers/active_support_notifications.rb
  • test/system/admin/users_test.rb
  • db/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 in test/fixtures/; test files should be named *_test.rb
Use Minitest + Capybara for system tests; place unit and integration tests under matching test/* directories

Files:

  • test/jobs/ai_answer_create_job_test.rb
  • 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/jobs/ai_answer_create_job_test.rb
  • test/test_helper.rb
  • 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/jobs/ai_answer_create_job_test.rb
  • test/test_helper.rb
  • test/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.rb
  • config/initializers/inflections.rb
  • config/initializers/active_support_notifications.rb
db/**

📄 CodeRabbit inference engine (AGENTS.md)

Database migrations and schema should be stored in db/ directory; app-specific utilities in lib/; static assets in public/

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.rb
  • config/ci.rb
  • 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:

  • 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.rb
  • 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:

  • test/test_helper.rb
  • 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 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.rb
  • 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:

  • config/ci.rb
  • 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:

  • config/ci.rb
  • Gemfile
📚 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 の命名規約(AIAi)への対応として適切です。

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の開発環境として適切な構成です。

Comment thread .cloudbuild/cloudbuild.yaml Outdated
Comment on lines +109 to +110
- '--set-env-vars=MISSION_CONTROL_USER=$_MISSION_CONTROL_USER'
- '--set-env-vars=MISSION_CONTROL_PASSWORD=$_MISSION_CONTROL_PASSWORD'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# Get an overview of the repository structure
git ls-files | head -20

Repository: fjordllc/bootcamp

Length of output: 570


🏁 Script executed:

# Check the cloudbuild.yaml file to see the full context
cat -n .cloudbuild/cloudbuild.yaml | head -150

Repository: 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 || true

Repository: 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 || true

Repository: fjordllc/bootcamp

Length of output: 43


🏁 Script executed:

# Check for any Cloud Build substitution variable definitions
rg -n "substitutions:" -A 10 .cloudbuild/cloudbuild.yaml

Repository: 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 || true

Repository: fjordllc/bootcamp

Length of output: 99


🏁 Script executed:

# Check the full substitutions section in cloudbuild.yaml
cat .cloudbuild/cloudbuild.yaml | tail -20

Repository: fjordllc/bootcamp

Length of output: 789


🏁 Script executed:

# Read the mission_control initializer file
cat config/initializers/mission_control.rb

Repository: 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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 制約についてコメントを追加することを推奨します。

capybaraselenium-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

📥 Commits

Reviewing files that changed from the base of the PR and between 19800ce and c6c5aa0.

⛔ Files ignored due to path filters (1)
  • Gemfile.lock is excluded by !**/*.lock
📒 Files selected for processing (20)
  • .cloudbuild/cloudbuild-staging.yaml
  • Gemfile
  • app/jobs/ai_answer_create_job.rb
  • app/models/ai/answer_generator.rb
  • app/models/ai_answer_creator.rb
  • config/ci.rb
  • config/environments/development.rb
  • config/environments/production.rb
  • config/initializers/active_support_notifications.rb
  • config/initializers/inflections.rb
  • db/schema.rb
  • test/jobs/ai_answer_create_job_test.rb
  • test/models/ai/answer_generator_test.rb
  • test/system/admin/users_test.rb
  • test/system/corporate_training_inquiry_system_test.rb
  • test/system/notification/tabs_badges_test.rb
  • test/system/practices/mentor_test.rb
  • test/system/product/unchecked_test.rb
  • test/system/regular_events/announcement_test.rb
  • test/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 in test/fixtures/; test files should be named *_test.rb
Use Minitest + Capybara for system tests; place unit and integration tests under matching test/* directories

Files:

  • test/jobs/ai_answer_create_job_test.rb
  • test/system/admin/users_test.rb
  • test/system/notification/tabs_badges_test.rb
  • test/system/practices/mentor_test.rb
  • test/system/corporate_training_inquiry_system_test.rb
  • test/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.rb
  • test/test_helper.rb
  • config/ci.rb
  • app/jobs/ai_answer_create_job.rb
  • test/system/admin/users_test.rb
  • app/models/ai/answer_generator.rb
  • config/initializers/active_support_notifications.rb
  • config/initializers/inflections.rb
  • test/system/notification/tabs_badges_test.rb
  • app/models/ai_answer_creator.rb
  • test/system/practices/mentor_test.rb
  • test/system/corporate_training_inquiry_system_test.rb
  • test/models/ai/answer_generator_test.rb
  • db/schema.rb
  • config/environments/production.rb
  • config/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.rb
  • test/test_helper.rb
  • config/ci.rb
  • app/jobs/ai_answer_create_job.rb
  • test/system/admin/users_test.rb
  • app/models/ai/answer_generator.rb
  • config/initializers/active_support_notifications.rb
  • config/initializers/inflections.rb
  • test/system/notification/tabs_badges_test.rb
  • app/models/ai_answer_creator.rb
  • test/system/practices/mentor_test.rb
  • test/system/corporate_training_inquiry_system_test.rb
  • test/models/ai/answer_generator_test.rb
  • db/schema.rb
  • config/environments/production.rb
  • config/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.rb
  • test/test_helper.rb
  • test/system/admin/users_test.rb
  • test/system/notification/tabs_badges_test.rb
  • test/system/practices/mentor_test.rb
  • test/system/corporate_training_inquiry_system_test.rb
  • test/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.rb
  • test/test_helper.rb
  • test/system/admin/users_test.rb
  • test/system/notification/tabs_badges_test.rb
  • test/system/practices/mentor_test.rb
  • test/system/corporate_training_inquiry_system_test.rb
  • test/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.rb
  • config/initializers/active_support_notifications.rb
  • config/initializers/inflections.rb
  • config/environments/production.rb
  • config/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 under javascript/ (Shakapacker)

Files:

  • app/jobs/ai_answer_create_job.rb
  • app/models/ai/answer_generator.rb
  • app/models/ai_answer_creator.rb
db/**

📄 CodeRabbit inference engine (AGENTS.md)

Database migrations and schema should be stored in db/ directory; app-specific utilities in lib/; static assets in public/

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.rb
  • config/ci.rb
  • test/system/notification/tabs_badges_test.rb
  • test/system/corporate_training_inquiry_system_test.rb
  • 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:

  • 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.rb
  • config/ci.rb
  • config/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
  • 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 config/** : Configuration files in `config/` should include environment settings, routes, and lints (`.rubocop.yml`, `config/slim_lint.yml`)

Applied to files:

  • test/test_helper.rb
  • config/environments/production.rb
  • config/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.rb
  • test/system/corporate_training_inquiry_system_test.rb
  • config/environments/production.rb
  • 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:

  • config/ci.rb
  • 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:

  • config/ci.rb
  • config/environments/production.rb
  • config/environments/development.rb
  • Gemfile
📚 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.rb
  • db/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.rb
  • config/environments/production.rb
  • 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:

  • test/system/corporate_training_inquiry_system_test.rb
  • config/environments/production.rb
  • 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/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.rb
  • config/environments/production.rb
  • config/environments/development.rb
  • Gemfile
📚 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 への変更も過去のレビューで指摘された通り正しく対応されています。

Comment thread test/system/practices/mentor_test.rb
Comment thread test/system/practices/mentor_test.rb Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

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

📥 Commits

Reviewing files that changed from the base of the PR and between 19800ce and c6c5aa0.

⛔ Files ignored due to path filters (1)
  • Gemfile.lock is excluded by !**/*.lock
📒 Files selected for processing (20)
  • .cloudbuild/cloudbuild-staging.yaml
  • Gemfile
  • app/jobs/ai_answer_create_job.rb
  • app/models/ai/answer_generator.rb
  • app/models/ai_answer_creator.rb
  • config/ci.rb
  • config/environments/development.rb
  • config/environments/production.rb
  • config/initializers/active_support_notifications.rb
  • config/initializers/inflections.rb
  • db/schema.rb
  • test/jobs/ai_answer_create_job_test.rb
  • test/models/ai/answer_generator_test.rb
  • test/system/admin/users_test.rb
  • test/system/corporate_training_inquiry_system_test.rb
  • test/system/notification/tabs_badges_test.rb
  • test/system/practices/mentor_test.rb
  • test/system/product/unchecked_test.rb
  • test/system/regular_events/announcement_test.rb
  • test/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 in test/fixtures/; test files should be named *_test.rb
Use Minitest + Capybara for system tests; place unit and integration tests under matching test/* directories

Files:

  • test/system/notification/tabs_badges_test.rb
  • test/models/ai/answer_generator_test.rb
  • test/system/regular_events/announcement_test.rb
  • test/jobs/ai_answer_create_job_test.rb
  • test/system/admin/users_test.rb
  • test/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.rb
  • test/models/ai/answer_generator_test.rb
  • config/initializers/inflections.rb
  • app/models/ai/answer_generator.rb
  • app/jobs/ai_answer_create_job.rb
  • test/system/regular_events/announcement_test.rb
  • test/jobs/ai_answer_create_job_test.rb
  • test/system/admin/users_test.rb
  • config/initializers/active_support_notifications.rb
  • db/schema.rb
  • app/models/ai_answer_creator.rb
  • test/system/product/unchecked_test.rb
  • config/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.rb
  • test/models/ai/answer_generator_test.rb
  • config/initializers/inflections.rb
  • app/models/ai/answer_generator.rb
  • app/jobs/ai_answer_create_job.rb
  • test/system/regular_events/announcement_test.rb
  • test/jobs/ai_answer_create_job_test.rb
  • test/system/admin/users_test.rb
  • config/initializers/active_support_notifications.rb
  • db/schema.rb
  • app/models/ai_answer_creator.rb
  • test/system/product/unchecked_test.rb
  • config/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.rb
  • test/models/ai/answer_generator_test.rb
  • test/system/regular_events/announcement_test.rb
  • test/jobs/ai_answer_create_job_test.rb
  • test/system/admin/users_test.rb
  • test/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.rb
  • test/models/ai/answer_generator_test.rb
  • test/system/regular_events/announcement_test.rb
  • test/jobs/ai_answer_create_job_test.rb
  • test/system/admin/users_test.rb
  • test/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.rb
  • config/initializers/active_support_notifications.rb
  • config/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 under javascript/ (Shakapacker)

Files:

  • app/models/ai/answer_generator.rb
  • app/jobs/ai_answer_create_job.rb
  • app/models/ai_answer_creator.rb
db/**

📄 CodeRabbit inference engine (AGENTS.md)

Database migrations and schema should be stored in db/ directory; app-specific utilities in lib/; static assets in public/

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.rb
  • Gemfile
📚 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
  • 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 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.rb
  • test/system/product/unchecked_test.rb
  • config/environments/production.rb
  • Gemfile
📚 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.rb
  • 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/regular_events/announcement_test.rb
  • config/environments/production.rb
  • 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:

  • test/system/regular_events/announcement_test.rb
  • config/environments/production.rb
  • Gemfile
📚 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.rb
  • 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 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.rb
  • 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: 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 というファイル名に対して AiAnswerCreateJobAI ではなく 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.rbdestroyメソッドでStripe::Subscription.update(subscription_id, cancel_at_period_end: true)を使用しており、テストのスタブと一致しています。Card.destroy_allはStripe APIをラップしたカスタムクラスのメソッドで、ActiveRecordのdestroy_allではないため、スタブ処理は適切です。

Comment thread db/schema.rb
- 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対象に追加
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 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

📥 Commits

Reviewing files that changed from the base of the PR and between da1149f and 9b1a57d.

📒 Files selected for processing (3)
  • bin/setup
  • test/system/events/crud_test.rb
  • test/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 in test/fixtures/; test files should be named *_test.rb
Use Minitest + Capybara for system tests; place unit and integration tests under matching test/* 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/setup
  • test/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 アップグレードに伴う開発環境セットアップフローの改善として適切です。

Comment thread bin/setup Outdated
Comment on lines 18 to 25
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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

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).

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
test/system/admin/users_test.rb (1)

185-186: 退会テストの Stripe API 回避方法について、卒業テストとの一貫性を検討してください。

退会テストでは subscription_idcustomer_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

📥 Commits

Reviewing files that changed from the base of the PR and between 9b1a57d and 3692ee8.

📒 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 in test/fixtures/; test files should be named *_test.rb
Use Minitest + Capybara for system tests; place unit and integration tests under matching test/* 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 のフィードバック(成功メッセージ)とデータベースへの永続化の両方を確認しており、テストの信頼性を高めています。

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3692ee8 and 45dd5ee.

⛔ Files ignored due to path filters (2)
  • package-lock.json is excluded by !**/package-lock.json
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (5)
  • .circleci/config.yml
  • AGENTS.md
  • bin/setup
  • bin/yarn
  • package.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.md
  • bin/setup
  • package.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.md
  • 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 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.md
  • 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 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: falsepkg-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 による並列実行も適切に設定されています。

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 45dd5ee and 25b1feb.

📒 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

Comment thread README.md
Comment on lines 16 to 19
```
$ bin/setup
$ foreman start -f Procfile.dev
$ bin/dev
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

マークダウンリンター違反を修正してください。

静的解析ツール(markdownlint-cli2)が以下の問題を検出しています:

  1. Line 16 (MD040): コードブロックに言語を指定してください(bash または shell
  2. 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")から先頭のドルサインを削除するか、もしドルサインでシェルプロンプト付きの出力例を示す意図ならそのままにして出力行と入力行を適切に分ける(つまり出力例でなければ
"$" を削る)ことで修正してください。

Comment thread README.md
Comment on lines +48 to 49
$ bin/lint
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

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.

Suggested change
$ 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.

Comment thread README.md
Comment on lines +62 to 63
$ npx eslint 'app/javascript/**/*.{js,vue,jsx}' --fix
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# package.jsonのscripts セクションを確認
cat package.json | grep -A 30 '"scripts"' | head -40

Repository: fjordllc/bootcamp

Length of output: 1139


🏁 Script executed:

# bin/lintスクリプトの内容を確認
cat bin/lint

Repository: fjordllc/bootcamp

Length of output: 172


🏁 Script executed:

# README.mdの該当行周辺を確認(60-70行目)
sed -n '60,70p' README.md

Repository: fjordllc/bootcamp

Length of output: 241


ドルサイン削除と、READMEのコマンド例をyarn lintに統一してください。また、ファイルパターンから.vueを削除してください。

README.md の下記について複数の問題が確認されました:

  1. MD014違反: ドルサイン($)を削除してください
  2. コマンド実行方法の不一致: 直接 npx を指定していますが、package.json の公式設定と bin/lint スクリプトでは yarn lint を使用しています
  3. ファイルパターンの誤り: README に記載されている .vue 拡張子は、実際の package.json スクリプト(lint:eslintlint: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.

Comment thread README.md
Comment on lines +68 to 69
$ npx prettier app/javascript/**/*.{js,vue,jsx} --write
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's find and read the README.md file
fd -name "README.md" | head -5

Repository: fjordllc/bootcamp

Length of output: 291


🏁 Script executed:

# Read the relevant lines from README.md
head -n 80 README.md | tail -n 30

Repository: fjordllc/bootcamp

Length of output: 504


🏁 Script executed:

# Also check lines around 62
head -n 70 README.md | tail -n 20

Repository: 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 ($) but no command output is shown. The rule expects plain commands (no $) unless you need to show command output interleaved with the commands. Rationale: omitting $ makes code easier to copy/paste and less noisy.

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 -1

Repository: 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違反(ドルサイン)と、ファイルパターン・実行方法の修正が必要です。

  1. ドルサイン($)を削除してください(MD014違反)
  2. ファイルパターンを .{js,vue,jsx} から .{js,jsx} に修正してください(package.json の lint:prettier スクリプトと一致させる)
  3. 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.

Suggested change
$ 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}.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 25b1feb and cd73f02.

📒 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

Comment thread README.md

```
$ ./bin/lint
$ bin/lint
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

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.

Suggested change
$ 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).

Comment thread README.md

```shell
$ eslint 'app/javascript/**/*.{js,vue,jsx}' --fix
$ npx eslint 'app/javascript/**/*.{js,vue,jsx}' --fix
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Line 62: マークダウンリンター違反(MD014)と、ファイルパターン・実行方法の修正が必要です。

  1. ドルサイン($)を削除してください(MD014)
  2. ファイルパターンから .vue を削除してください(package.json のスクリプトで対応していません)
  3. 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.

Suggested change
$ 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).

Comment thread README.md

```shell
$ prettier app/javascript/**/*.{js,vue,jsx} --write
$ npx prettier app/javascript/**/*.{js,vue,jsx} --write
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Line 68: マークダウンリンター違反(MD014)と、ファイルパターン・実行方法の修正が必要です。

  1. ドルサイン($)を削除してください(MD014)
  2. ファイルパターンから .vue を削除してください(package.json のスクリプトで対応していません)
  3. yarn lint:prettier コマンドの使用を推奨してください
🔎 推奨修正
-$ npx prettier app/javascript/**/*.{js,vue,jsx}' --write
+yarn lint:prettier --write

Committable 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で拒否メールが送信されていないことを検証
@komagata komagata merged commit 2cfb702 into main Jan 9, 2026
1 of 2 checks passed
@komagata komagata deleted the chore/rails-8.1.1 branch January 9, 2026 10:56
@github-actions github-actions Bot mentioned this pull request Jan 9, 2026
17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant