Loading
Drop group from CD models and GraphQL surface
What does this MR do and why?
Align the CD models and GraphQL surface with the organization-only ownership decided in the Rails design proposal and PRD. Group ownership is deferred to a later iteration.
Changes:
- Models:
Cd::ApplicationandCd::Environmentno longer readgroup_id(addedignore_columnfor 19.3 drop). Removedbelongs_to :groupand thefor_groups/for_namespacescopes. - GraphQL types: removed the
groupfield and batch loader fromCdApplicationandCdEnvironment. Granular token boundaries are now instance-only. - GraphQL mutations: removed the
group_pathargument, theMutations::ResolvesGroupinclude, and theexactly_one_ofvalidation fromCdApplicationCreateandCdEnvironmentCreate.organizationIdis now required. - GraphQL resolvers: deleted the group-level
Resolvers::Cd::ApplicationsResolverandResolvers::Cd::EnvironmentsResolver. The organization-level resolvers are unchanged. - Services and policies: dropped the
parent.is_a?(::Group)branch inCd::Applications::CreateServiceandCd::Environments::CreateService; parent is always an organization. Policies now delegate to organization only. - Group surface: removed
has_many :cd_applications/has_many :cd_environmentsfrom the Group model, and the matchingcdApplications/cdEnvironmentsfields from the Group GraphQL type. - Specs, factories, and generated GraphQL docs / introspection schema updated to match.
Notes
- The
organization_idsharding key on thecd_*tables was already established in !239900 (merged) (19.1), which addedorganization_idas the required sharding key across all CD tables while keepinggroup_idin place as an optional owner. - Column drops (plus their FKs and unique indexes) follow in 19.3 as a separate post-deploy migration via https://gitlab.com/gitlab-org/gitlab/-/work_items/602934.
- The frontend team has been notified (https://gitlab.com/gitlab-org/gitlab/-/work_items/602765#note_3454308724). The only existing consumer (
cd_applications.query.graphql+applications_index.vue) is being migrated to the org-level query in !240759 (merged).
References
- https://gitlab.com/gitlab-org/gitlab/-/work_items/602765
- https://gitlab.com/gitlab-org/gitlab/-/work_items/602442
- https://gitlab.com/gitlab-org/gitlab/-/work_items/602444
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.
Edited by Agnes Slota