Add DuoAgentPlatformModelMetadataService to support DAP

What does this MR do and why?

  • Add DuoAgentPlatformModelMetadataService to support resolving the model metadata for DAP under different conditions.

This code adds a new service that helps determine which AI model to use for GitLab's Duo Agent Platform feature across different deployment types. The service implements a priority system where:

  • For self-hosted GitLab instances using their own AI models, it uses admin-configured settings
  • For cloud-connected self-managed instances, it allows admins to set instance-wide defaults that users can potentially override
  • For GitLab.com, it supports both organization/group-level defaults and user preferences

The changes also simplify the model metadata handling by removing some feature flag checks and ensuring the service always returns a consistent format (either empty data or properly formatted model information). The code includes comprehensive tests to verify the service works correctly across all these different scenarios and handles edge cases like missing data or errors gracefully.

Essentially, this creates a unified way to manage AI model selection that adapts to different GitLab deployment types while maintaining a clear hierarchy of who can configure what models are available.

Related to #568111

Edited by Manoj M J

Merge request reports

Loading