Move so that getSetupData is run on provider config changes
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3561403. -->
Reported by: [marcus_johansson](https://www.drupal.org/user/385947)
>>>
<p>[Tracker]<br>
<strong>Update Summary: </strong>[One-line status update for stakeholders]<br>
<strong>Short Description: </strong>Unify when a provider is setup<br>
<strong>Check-in Date: </strong>MM/DD/YYYY<br>
<em>Metadata is used by the <a href="https://www.drupalstarforge.ai/" title="AI Tracker">AI Tracker.</a> Docs and additional fields <a href="https://www.drupalstarforge.ai/ai-dashboard/docs" title="AI Issue Tracker Documentation">here</a>.</em><br>
[/Tracker]</p>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>Currently we have a problem that we have two different solutions on how the triggering of the fact that a provider is setup happens - via the form of the provider and also on config changes like using the setupAiProvider action for instance.</p>
<p>One part of the is that providers can setup default models, if they are not set, via the provider manager. They use the method defaultIfNone in the form and in the action.</p>
<p>We should unify this, so we neither need that logic in the action or for the providers to explictly call this method. We already have the method getSetupData where they can describe what should happen with the provider when getting setup, this is the only thing that should be needed.</p>
<p>In 2.0.0 we should either add a common config schema name for providers or have them add a third party setting and based on this we can use ConfigEvents on update, create and delete to see when this gets changed.</p>
<p>But open for ideas.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>1. Come up with the best plan for this.<br>
2. Rewrite this issue to execute this plan.</p>
issue