Skip to content

FeatureToggle用のコードを削除#8956

Merged
komagata merged 2 commits intomainfrom
fix/revert-feature-toggle
Jul 20, 2025
Merged

FeatureToggle用のコードを削除#8956
komagata merged 2 commits intomainfrom
fix/revert-feature-toggle

Conversation

@masyuko0222
Copy link
Copy Markdown
Contributor

@masyuko0222 masyuko0222 commented Jul 18, 2025

以下の2つのPRがmainにマージされているが、不具合が見つかったため、応急処置でコードを削除する。

機能認可をControllerのbefore_actionで行うようにしていたため、実際にそのアクションを実行(URLに遷移)しないと、認可が行われないという現象。
上記が原因で、認可を受けているはずなのにViewに表示されないという不具合(URLを直接叩いてbefore_actionを実行させればViewにも表示されるようになる)

Summary by CodeRabbit

  • 削除

    • フィーチャートグル(Feature Toggle)機能および関連画面・ナビゲーションリンクを削除しました。
    • 「FeatureToggle」ページへのナビゲーションリンクを削除しました。
    • フィーチャートグルに関するコントローラー、設定、テスト、データベーステーブルを削除しました。
  • データベース

    • 機能フラグ関連のテーブル(flipper_features、flipper_gates)を削除しました。

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jul 18, 2025

Walkthrough

Flipperによるフィーチャートグル機能全体がアプリケーションから削除されました。関連するGem、初期化ファイル、コントローラ、ビュー、ルーティング、DBテーブル、テスト、設定ファイルが一括して削除・整理されています。

Changes

ファイル/グループ 変更概要
.traceroute.yml ignore_unreachable_actionsリストからfeature toggle関連エントリを削除
Gemfile 'flipper-active_record'の依存を削除
app/controllers/application_controller.rb FeatureToggleモジュールのincludeを削除
app/controllers/concerns/feature_toggle.rb FeatureToggleモジュール(feature判定・有効化メソッド含む)を削除
app/controllers/test_feature_toggle_controller.rb TestFeatureToggleController(feature有効化テスト用コントローラ)を削除
app/views/application/_global_nav.slim FeatureToggleページへのナビゲーションリンクを削除
app/views/test_feature_toggle/index.html.slim @user.name表示行を削除
config/initializers/flipper.rb Flipperの初期化設定ファイルを削除
config/routes.rb test_feature_toggleリソースのルートを削除
db/migrate/20250718134145_drop_flipper_tables.rb flipper_gates, flipper_featuresテーブルを削除するマイグレーションを追加
db/schema.rb flipper_gates, flipper_featuresテーブルをスキーマから削除
test/controllers/concerns/feature_toggle_test.rb FeatureToggle concernのテスト一式を削除

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant App
    participant Flipper(DB)

    User->>App: アクセス
    App--xFlipper(DB): Flipperによるfeature判定呼び出しなし
    App->>User: 通常のレスポンス
Loading

Possibly related PRs

Suggested reviewers

  • komagata
  • su-su-su-su

Poem

さよならFlipper、うさぎは言う、
トグルの魔法、今はもう無い。
コードは軽く、テーブルも消え、
ふわふわ跳ねて、次の夢へ。
🐇✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 RuboCop (1.76.1)
db/schema.rb

rubocop-minitest extension supports plugin, specify plugins: rubocop-minitest instead of require: rubocop-minitest in /.rubocop.yml.
For more information, see https://docs.rubocop.org/rubocop/plugin_migration_guide.html.
rubocop-capybara extension supports plugin, specify plugins: rubocop-capybara instead of require: rubocop-capybara in /.rubocop.yml.
For more information, see https://docs.rubocop.org/rubocop/plugin_migration_guide.html.
Unable to find gem rubocop-fjord; is the gem installed? Gem::MissingSpecError
/var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader_resolver.rb:309:in rescue in gem_config_path' /var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader_resolver.rb:293:in gem_config_path'
/var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader_resolver.rb:84:in block (2 levels) in resolve_inheritance_from_gems' /var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader_resolver.rb:82:in reverse_each'
/var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader_resolver.rb:82:in block in resolve_inheritance_from_gems' /var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader_resolver.rb:76:in each_pair'
/var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader_resolver.rb:76:in resolve_inheritance_from_gems' /var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader.rb:66:in load_file'
/var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_store.rb:29:in options_config=' /var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/cli.rb:160:in act_on_options'
/var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/cli.rb:47:in block in run' /var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/cli.rb:81:in profile_if_needed'
/var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/cli.rb:43:in run' /var/lib/gems/3.1.0/gems/rubocop-1.77.0/exe/rubocop:19:in <top (required)>'
/usr/local/bin/rubocop:25:in load' /usr/local/bin/rubocop:25:in

'

db/migrate/20250718134145_drop_flipper_tables.rb

rubocop-minitest extension supports plugin, specify plugins: rubocop-minitest instead of require: rubocop-minitest in /.rubocop.yml.
For more information, see https://docs.rubocop.org/rubocop/plugin_migration_guide.html.
rubocop-capybara extension supports plugin, specify plugins: rubocop-capybara instead of require: rubocop-capybara in /.rubocop.yml.
For more information, see https://docs.rubocop.org/rubocop/plugin_migration_guide.html.
Unable to find gem rubocop-fjord; is the gem installed? Gem::MissingSpecError
/var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader_resolver.rb:309:in rescue in gem_config_path' /var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader_resolver.rb:293:in gem_config_path'
/var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader_resolver.rb:84:in block (2 levels) in resolve_inheritance_from_gems' /var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader_resolver.rb:82:in reverse_each'
/var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader_resolver.rb:82:in block in resolve_inheritance_from_gems' /var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader_resolver.rb:76:in each_pair'
/var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader_resolver.rb:76:in resolve_inheritance_from_gems' /var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader.rb:66:in load_file'
/var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_store.rb:29:in options_config=' /var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/cli.rb:160:in act_on_options'
/var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/cli.rb:47:in block in run' /var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/cli.rb:81:in profile_if_needed'
/var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/cli.rb:43:in run' /var/lib/gems/3.1.0/gems/rubocop-1.77.0/exe/rubocop:19:in <top (required)>'
/usr/local/bin/rubocop:25:in load' /usr/local/bin/rubocop:25:in

'


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dccc9bc and ac22e1c.

⛔ Files ignored due to path filters (1)
  • Gemfile.lock is excluded by !**/*.lock
📒 Files selected for processing (12)
  • .traceroute.yml (0 hunks)
  • Gemfile (0 hunks)
  • app/controllers/application_controller.rb (0 hunks)
  • app/controllers/concerns/feature_toggle.rb (0 hunks)
  • app/controllers/test_feature_toggle_controller.rb (0 hunks)
  • app/views/application/_global_nav.slim (0 hunks)
  • app/views/test_feature_toggle/index.html.slim (0 hunks)
  • config/initializers/flipper.rb (0 hunks)
  • config/routes.rb (0 hunks)
  • db/migrate/20250718134145_drop_flipper_tables.rb (1 hunks)
  • db/schema.rb (1 hunks)
  • test/controllers/concerns/feature_toggle_test.rb (0 hunks)
💤 Files with no reviewable changes (10)
  • Gemfile
  • .traceroute.yml
  • app/views/test_feature_toggle/index.html.slim
  • app/views/application/_global_nav.slim
  • app/controllers/application_controller.rb
  • config/routes.rb
  • config/initializers/flipper.rb
  • test/controllers/concerns/feature_toggle_test.rb
  • app/controllers/test_feature_toggle_controller.rb
  • app/controllers/concerns/feature_toggle.rb
🚧 Files skipped from review as they are similar to previous changes (2)
  • db/schema.rb
  • db/migrate/20250718134145_drop_flipper_tables.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
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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)
db/migrate/20250718134145_drop_flipper_tables.rb (1)

1-6: マイグレーションのロールバック動作について確認が必要

drop_tablechangeメソッドで使用する場合、Rails はロールバック時にテーブルを再作成しようとしますが、元のテーブル構造(カラム、インデックス、制約など)の情報がないため、正しくロールバックできません。

Flipperの完全削除が目的であれば問題ありませんが、より安全な実装を検討してください。

class DropFlipperTables < ActiveRecord::Migration[6.1]
-  def change
+  def up
    drop_table :flipper_gates, if_exists: true
    drop_table :flipper_features, if_exists: true
  end
+
+  def down
+    # Flipper機能を完全に削除するため、ロールバックは意図的に無効化
+    raise ActiveRecord::IrreversibleMigration, "Flipperテーブルの削除は不可逆的な操作です"
+  end
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 036299c and dccc9bc.

⛔ Files ignored due to path filters (1)
  • Gemfile.lock is excluded by !**/*.lock
📒 Files selected for processing (12)
  • .traceroute.yml (0 hunks)
  • Gemfile (0 hunks)
  • app/controllers/application_controller.rb (0 hunks)
  • app/controllers/concerns/feature_toggle.rb (0 hunks)
  • app/controllers/test_feature_toggle_controller.rb (0 hunks)
  • app/views/application/_global_nav.slim (0 hunks)
  • app/views/test_feature_toggle/index.html.slim (0 hunks)
  • config/initializers/flipper.rb (0 hunks)
  • config/routes.rb (0 hunks)
  • db/migrate/20250718134145_drop_flipper_tables.rb (1 hunks)
  • db/schema.rb (1 hunks)
  • test/controllers/concerns/feature_toggle_test.rb (0 hunks)
💤 Files with no reviewable changes (10)
  • .traceroute.yml
  • config/routes.rb
  • app/controllers/application_controller.rb
  • app/views/test_feature_toggle/index.html.slim
  • Gemfile
  • app/controllers/test_feature_toggle_controller.rb
  • app/views/application/_global_nav.slim
  • app/controllers/concerns/feature_toggle.rb
  • test/controllers/concerns/feature_toggle_test.rb
  • config/initializers/flipper.rb
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rb

Instructions used from:

Sources:
⚙️ CodeRabbit Configuration File

🧠 Learnings (2)
db/schema.rb (1)
Learnt from: thmz337
PR: fjordllc/bootcamp#8857
File: db/migrate/20250624141527_remove_experience_from_users.rb:6-8
Timestamp: 2025-06-27T14:06:44.472Z
Learning: Railsのマイグレーションのdownメソッドでは、元のスキーマの正確な定義を確認してから制約を追加する必要がある。元のカラムに制約がない場合、ロールバック時に制約を追加すると元の状態と異なってしまう。
db/migrate/20250718134145_drop_flipper_tables.rb (1)
Learnt from: thmz337
PR: fjordllc/bootcamp#8857
File: db/migrate/20250624141527_remove_experience_from_users.rb:6-8
Timestamp: 2025-06-27T14:06:44.472Z
Learning: Railsのマイグレーションのdownメソッドでは、元のスキーマの正確な定義を確認してから制約を追加する必要がある。元のカラムに制約がない場合、ロールバック時に制約を追加すると元の状態と異なってしまう。
⏰ 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 (1)
db/schema.rb (1)

13-13: スキーマバージョンの更新が適切

マイグレーションファイルと一致するスキーマバージョンに正しく更新されており、Flipperテーブルが完全に削除されています。

@masyuko0222 masyuko0222 force-pushed the fix/revert-feature-toggle branch from dccc9bc to ac22e1c Compare July 18, 2025 23:31
Copy link
Copy Markdown
Member

@komagata komagata left a comment

Choose a reason for hiding this comment

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

確認させて頂きました。OKです〜🙆‍♂️

@komagata komagata merged commit abcf915 into main Jul 20, 2025
5 checks passed
@komagata komagata deleted the fix/revert-feature-toggle branch July 20, 2025 15:29
@github-actions github-actions bot mentioned this pull request Jul 20, 2025
87 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.

2 participants