dotCMS / core

Headless/Hybrid Content Management System for Enterprises
http://dotcms.com
Other
845 stars 465 forks source link

We need to refactor the config approach on AI APIs #29519

Open jdotcms opened 1 month ago

jdotcms commented 1 month ago

Parent Issue

No response

User Story

As an user, I want to be able to save changes on the config and get them automatically on the IA apis

Acceptance Criteria

Currently it is not working properly, my thought is that the approach used to handle the config is not right, we need to refactor it

Proposed Objective

Core Features

Proposed Priority

Priority 3 - Average

External Links... Slack Conversations, Support Tickets, Figma Designs, etc.

No response

Assumptions & Initiation Needs

No response

Quality Assurance Notes & Workarounds

No response

Sub-Tasks & Estimates

No response

john-thomas-dotcms commented 1 month ago

Slack thread: https://dotcms.slack.com/archives/CQNF9PCFQ/p1723151016456439

john-thomas-dotcms commented 1 month ago

Initial thoughts (from the Slack thread):

There are a few ways we could handle defaults and fall-throughs from the site config to the System Host config in Apps (in general, not just for dotAI).

When a site doesn't have all required fields filled in:

  1. The entire site config is inactive.
    • Use the System Host config in it's entirely, ignoring any values in the site config.
  2. Use default values for all blank fields.
    • IOW, don't fall-through to the System Host config for individual fields.
  3. Use values from the System Host config for all blank fields.
    • IOW, fall-through to the System Host config on a field-by-field basis.
    • If both the site config and the System Host config have blank values for the same field, then use the default value.
  4. Make the fall-through behavior configurable between # 1 and # 3.
    • The SAML App has this capability - you can mark a site config as Active, even if it's missing some required fields, and then it will fall through. But this isn't a general capability for all Apps.

Here's my current take on these:

My current preference would be to implement # 4 as it's implemented for the SAML App, but to make that a general feature that applies to all Apps.