Skip to content

Refactor AI enabled logic

Jessie Young requested to merge jy-duo-chat-button-followup into master

What does this MR do and why?

  • Based on comment here: !135548 (comment 1645154924)
  • This is mostly a straight refactor.
  • The one way the code has changed is that enabled_for no longer checks the ai_feature_enabled method, which was removed. That method always returned true when not on Gitlab.com. Duo Chat is currently available on SaaS only, so this is unexpected. Likely an oversight from when this logic was first added when TanukiBot was being added as a feature (which eventually morphed and turned into Duo Chat)
  • ai_feature_enabled logic originally added here: !120115 (merged)

Screenshots or screen recordings

This is a refactor, so there is no behavior change.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports