Add Self-hosted Model Form to Create Page
What does this MR do and why?
This MR is part of the work taking place to convert the self-hosted models configuration pages from HAML to Vue. The work is feature flagged behind custom_models_vue_app and implements this Figma design.
What this MR does:
- Adds reusable
SelfHostedModelsFormcomponent (can also be used for building the Edit page) - Uses
SelfHostedModelsFormin the skeleton create page added in !160674 (merged) - Invokes
createSelfHostedModelmutation for data - Handles required field validations
- Handles server validations
This MR is split from !159043 (closed) to make the work easier to review (the original MR will be closed)
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
| Before | After |
|---|---|
| Screen_Recording_2024-07-19_at_2.59.30_PM | Screen_Recording_2024-07-19_at_2.50.41_PM |
How to set up and validate locally
You will need:
- An active GitLab ultimate license
- Disable SAAS mode when running GDK
-
echo $GITLAB_SIMULATE_SAASshould return0 - See the docs for more information
-
- Run the following commands in your terminal
add_on = GitlabSubscriptions::AddOn.find_or_create_by!(name: "code_suggestions") {|e| e.description = "Test"}
add_on_purchase = GitlabSubscriptions::AddOnPurchase.create!(add_on: add_on, expires_on: 1.month.from_now, quantity: 5, purchase_xid: 'A-S0001')
Feature.enable(:self_managed_code_suggestions)
Feature.enable(:ai_custom_model)
Feature.enable(:custom_models_vue_app)
ApplicationSetting.first.update(duo_features_enabled: true)
- Navigate to your GDK instance in browser
- Click on "Admin" button at the bottom of the left sidebar
- Open the "AI-powered features" drop down in the admin area sidebar
- Click on "Self-hosted models"
- You may may be asked to accept some terms and conditions with usage (accept them)
- If you do not have any models created, you will see an empty state where you will be prompted to create a new one. If you already have models, you will see a table and a button labeled "New model". Both will lead to the same "Create" skeleton page which is what this MR has added.
Related to #463135 (closed)
Edited by Julie Huang