Add group readiness flag and owner settings data
What does this MR do and why?
This is the second of three MRs for the group readiness section "Run GitLab Duo agents and flows in this group". The first MR prepared shared frontend components. The third MR will add the readiness card. This MR is backend only and makes no visible change.
A group's GitLab Duo settings page knows only the values of that group. Other owners control some switches. On GitLab.com, the top-level group owns the Agent Platform setting and the foundational agents default for a subgroup. On a self-managed instance, the instance administrator owns them. The readiness card must tell a Group Owner if those switches are on. It must also tell the Owner where to change them.
Behind the new feature flag duo_group_agent_readiness_settings, the group settings helper adds four values to the page data. The flag has type wip, is off by default, and uses the top-level group as the actor.
duo_agent_platform_owner_enabled: the Agent Platform value of the owner.duo_agent_platform_owner_settings_path: a link to the settings page of the owner. The link goes to the GitLab Duo settings of the top-level group when the user can administer that group. It goes to the Admin GitLab Duo page when the user is an instance administrator. Otherwise the value is empty.foundational_agents_owner_enabled: the foundational agents default of the owner.root_ancestor_name: the name of the top-level group. The card copy uses it.
The flag also reaches the frontend on both pages that mount the group GitLab Duo settings app. These are the group General settings page and the GitLab Duo Configuration page.
An earlier draft also exposed an inherited GitLab Duo availability value and its source. This MR drops both. The cascading settings data on the page already holds the lock state and the locking ancestor. That data names the correct group when an intermediate group locks the setting.
With the flag off, the page data does not change.
References
- Epic for group readiness: gitlab-org#23651
- Issue, which this MR only partly covers: #629953
- Rollout issue: #630145
- First MR, shared frontend components: !258416 (merged)
Screenshots or screen recordings
No user-facing change.
How to set up and validate locally
- In a Rails console, run
Feature.enable(:duo_group_agent_readiness_settings). - Open the General settings page of a group and expand GitLab Duo. You can also open the GitLab Duo Configuration page of the group.
- Inspect the root element of the settings app. Its
data-attributes now include the four new values. - Disable the flag and reload the page. The four attributes are gone.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.