Skip to content

Draft: Proposal 1

Nikola Milojevic requested to merge proposal-1 into proposal-0-common

The Config

# config/unit_primitives/code_suggestions.yml
---
name: code_suggestions
description:
cut_off_date: 2024-02-15T00:00:00+00:00
min_gitlab_version_for_free_access:
min_gitlab_version: '16.8'
unit_primitive_issue_url:
introduced_by_url:
documentation_url:
group: group::code suggestions
feature_category: code_suggestions
backend_services:
  - ai_gateway
add_ons:
  - duo_pro1
  - duo_enterprise
license_types:
  - premium
  - ultimate
# config/backend_services/ai_gateway.yml
---
name: ai_gateway
description:
project_url: https://gitlab.com/gitlab-org/modelops/applied-ml/code-suggestions/ai-assist
group: group::ai framework
jwt_aud: gitlab-ai-gateway
# config/add_ons/duo_pro.yml
---
name: duo_pro
description:
# config/license_types/ultimate.yml
---
name: ultimate
description:

...

The API:

> Gitlab::CloudConnector::AccessData::BackendServices.find_by_name(:ai_gateway).unit_primitives.find_by_name(:duo_chat).add_ons.map(&:name)
> [:duo_pro, :duo_enterprise]

> Gitlab::CloudConnector::AccessData::UnitPrimitives.find_by_name(:duo_chat).backend_services.map(&:name)
> [:ai_gateway]

> Gitlab::CloudConnector::AccessData::AddOn.find_by_name(:duo_pro).unit_primitives.map(&:name)
> [:code_suggestions, :duo_chat, :documentation_search]

> Gitlab::CloudConnector::AccessData::LicenseType.find_by_name(:premium).unit_primitives.map(&:name)
> [:code_suggestions, :duo_chat, :documentation_search]

> Gitlab::CloudConnector::AccessData::UnitPrimitives.all.map(&:name)
> [:code_suggestions, :documentation_search, :duo_chat, :explain_vulnerability, :generate_commit_message, :glab_ask_git_command, :resolve_vulnerability, :summarize_comments, :troubleshoot_job]

I extracted the common code from both Proposal 1 and Proposal 2 at Draft: Add configs relations and api (!9 - closed), so it's easier to review/compare

Edited by Nikola Milojevic

Merge request reports

Loading