Add new fields to GroupType
What does this MR do and why?
This is part of the ongoing Organization work by the grouptenant scale group. Read the blueprint to learn more https://docs.gitlab.com/ee/architecture/blueprints/organization/index.html.
Fields introduced are:
- descendantGroupsCount
- groupMembersCount
- projectsCount
Query plans
Raw Query
SELECT COUNT(projects) AS "count_projects", "namespaces"."id" AS "namespaces_id"
FROM "namespaces"
LEFT OUTER JOIN "projects" ON "projects"."archived" != TRUE AND "projects"."namespace_id" = "namespaces"."id"
WHERE "namespaces"."type" = 'Group'
AND "namespaces"."id" IN
(1755573, 1761696, 1793858, 1819570, 1920469, 2287432, 2351283, 2452873, 2593421, 2639717, 2750817, 2843837,
2907304, 3345373, 3455548, 3887963, 3910297, 3925021, 3930213, 3952433)
GROUP BY "namespaces"."id";
Raw Query
SELECT COUNT(members) AS "count_members", "namespaces"."id" AS "namespaces_id"
FROM "namespaces"
LEFT OUTER JOIN "members" ON "members"."source_type" = 'Namespace' AND "members"."requested_at" IS NULL AND
"members"."access_level" != 5 AND "members"."source_id" = "namespaces"."id" AND
"members"."type" = 'GroupMember'
WHERE "namespaces"."type" = 'GROUP'
AND "namespaces"."id" IN
(1755573, 1761696, 1793858, 1819570, 1920469, 2287432, 2351283, 2452873, 2593421, 2639717, 2750817, 2843837,
2907304, 3345373, 3455548, 3887963, 3910297, 3925021, 3930213, 3952433)
GROUP BY "namespaces"."id";
Raw Query
SELECT COUNT(children_namespaces) AS "count_children_namespaces", "namespaces"."id" AS "namespaces_id"
FROM "namespaces"
LEFT OUTER JOIN "namespaces" "children_namespaces" ON "children_namespaces"."type" = 'Group' AND
"children_namespaces"."parent_id" = "namespaces"."id"
WHERE "namespaces"."type" = 'Group'
AND "namespaces"."id" IN
(1755573, 1761696, 1793858, 1819570, 1920469, 2287432, 2351283, 2452873, 2593421, 2639717, 2750817, 2843837,
2907304, 3345373, 3455548, 3887963, 3910297, 3925021, 3930213, 3952433)
GROUP BY "namespaces"."id";
How to set up and validate locally
Run the following query on GraphiQL https://gdk.test:3000/-/graphql-explorer:
Query
{
organization(id: "gid://gitlab/Organizations::Organization/1") {
id
path
groups(sort: NAME_DESC) {
edges {
node {
id
descendantGroupsCount
groupMembersCount
projectsCount
}
}
}
}
}
Output
{
"data": {
"organization": {
"id": "gid://gitlab/Organizations::Organization/1",
"path": "default",
"groups": {
"edges": [
{
"node": {
"id": "gid://gitlab/Group/35",
"descendantGroupsCount": 0,
"groupMembersCount": 5,
"projectsCount": 2
}
},
{
"node": {
"id": "gid://gitlab/Group/31",
"descendantGroupsCount": 0,
"groupMembersCount": 5,
"projectsCount": 1
}
},
{
"node": {
"id": "gid://gitlab/Group/27",
"descendantGroupsCount": 0,
"groupMembersCount": 5,
"projectsCount": 1
}
},
{
"node": {
"id": "gid://gitlab/Group/24",
"descendantGroupsCount": 0,
"groupMembersCount": 4,
"projectsCount": 2
}
},
{
"node": {
"id": "gid://gitlab/Group/33",
"descendantGroupsCount": 0,
"groupMembersCount": 5,
"projectsCount": 1
}
},
{
"node": {
"id": "gid://gitlab/Group/29",
"descendantGroupsCount": 0,
"groupMembersCount": 5,
"projectsCount": 1
}
},
{
"node": {
"id": "gid://gitlab/Group/109",
"descendantGroupsCount": 0,
"groupMembersCount": 1,
"projectsCount": 0
}
},
{
"node": {
"id": "gid://gitlab/Group/110",
"descendantGroupsCount": 0,
"groupMembersCount": 1,
"projectsCount": 0
}
},
{
"node": {
"id": "gid://gitlab/Group/108",
"descendantGroupsCount": 1,
"groupMembersCount": 1,
"projectsCount": 0
}
},
{
"node": {
"id": "gid://gitlab/Group/107",
"descendantGroupsCount": 2,
"groupMembersCount": 1,
"projectsCount": 0
}
}
]
}
}
}
}
Related to #420702 (closed)
Merge request reports
Activity
changed milestone to %16.7
assigned to @abdwdd
- A deleted user
added databasereview pending documentation labels
1 Message 📖 This merge request adds or changes documentation files. A review from the Technical Writing team before you merge is recommended. Reviews can happen after you merge. Documentation review
The following files require a review from a technical writer:
-
doc/api/graphql/reference/index.md
(Link to current live version)
The review does not need to block merging this merge request. See the:
-
Metadata for the
*.md
files that you've changed. The first few lines of each*.md
file identify the stage and group most closely associated with your docs change. - The Technical Writer assigned for that stage and group.
- Documentation workflows for information on when to assign a merge request for review.
Reviewer roulette
Changes that require review have been detected!
Please refer to the table below for assigning reviewers and maintainers suggested by Danger in the specified category:
Category Reviewer Maintainer backend @imand3r
(UTC-8, 13.5 hours behind author)
@garyh
(UTC-6, 11.5 hours behind author)
Please check reviewer's status!
Feel free to override these selections if you think someone else would be better-suited or use the GitLab Review Workload Dashboard to find other available reviewers.
To read more on how to use the reviewer roulette, please take a look at the Engineering workflow and code review guidelines. Please consider assigning a reviewer or maintainer who is a domain expert in the area of the merge request.
Once you've decided who will review this merge request, assign them as a reviewer! Danger does not automatically notify them for you.
If needed, you can retry the
🔁 danger-review
job that generated this comment.Generated by
🚫 DangerEdited by Ghost User-
added 1 commit
- db05fa43 - Use ActiveRecord association for custom join instead of Arel
- Resolved by Leonardo da Rosa
@radbatnag could you please perform the initial backend review?
requested review from @radbatnag
assigned to @dstull
mentioned in issue #420702 (closed)
requested review from @carlad-gl
requested review from @l.rosa and removed review request for @carlad-gl
- Resolved by Leonardo da Rosa
👋 @carlad-gl
, thanks for approving this merge request.This is the first time the merge request has been approved. To ensure we don't only run predictive pipelines, and we don't break
master
, a new pipeline will be started shortly.Please wait for the pipeline to start before resolving this discussion and set auto-merge for the new pipeline. See merging a merge request for more details.
added pipeline:mr-approved label
E2E Test Result Summary
allure-report-publisher
generated test report!e2e-test-on-gdk:
✅ test report for 2ccf06eeexpand test summary
+-----------------------------------------------------------------------+ | suites summary | +------------------+--------+--------+---------+-------+-------+--------+ | | passed | failed | skipped | flaky | total | result | +------------------+--------+--------+---------+-------+-------+--------+ | Create | 54 | 0 | 7 | 0 | 61 | ✅ | | Govern | 66 | 0 | 1 | 0 | 67 | ✅ | | Plan | 55 | 0 | 0 | 0 | 55 | ✅ | | Manage | 0 | 0 | 1 | 0 | 1 | ➖ | | Verify | 31 | 0 | 0 | 0 | 31 | ✅ | | Monitor | 8 | 0 | 0 | 0 | 8 | ✅ | | Data Stores | 23 | 0 | 0 | 0 | 23 | ✅ | | Framework sanity | 0 | 0 | 1 | 0 | 1 | ➖ | | Release | 5 | 0 | 0 | 0 | 5 | ✅ | | Package | 5 | 0 | 1 | 0 | 6 | ✅ | | Analytics | 2 | 0 | 0 | 0 | 2 | ✅ | +------------------+--------+--------+---------+-------+-------+--------+ | Total | 249 | 0 | 11 | 0 | 260 | ✅ | +------------------+--------+--------+---------+-------+-------+--------+
Edited by Ghost Userrequested review from @proglottis and removed review request for @radbatnag
- Resolved by Leonardo da Rosa
- Resolved by Leonardo da Rosa
removed review request for @l.rosa
requested review from @l.rosa
removed review request for @proglottis
added databaseapproved label and removed databasereview pending label
enabled an automatic merge when the pipeline for 98a7d0fd succeeds
- Resolved by Leonardo da Rosa
@dstull do you mind in performing a rebase before I set auto-merge?
🙇
added 1415 commits
-
db05fa43...f41d5392 - 1413 commits from branch
master
- 78a14faf - Add new fields to GroupType
- 2ccf06ee - Use ActiveRecord association for custom join instead of Arel
-
db05fa43...f41d5392 - 1413 commits from branch
enabled an automatic merge when the pipeline for d7846950 succeeds
Hello @abdwdd
👋 The database team is looking for ways to improve the database review process and we would love your help!
If you'd be open to someone on the database team reaching out to you for a chat, or if you'd like to leave some feedback asynchronously, just post a reply to this comment mentioning:
@gitlab-org/database-team
And someone will be by shortly!
Thanks for your help!
❤ This message was generated automatically. You're welcome to improve it.
mentioned in commit db64313a
mentioned in incident gitlab-org/quality/engineering-productivity/master-broken-incidents#4681 (closed)
mentioned in commit 3a11d488
mentioned in merge request !139966 (merged)
added workflowstaging-canary label
added workflowcanary label and removed workflowstaging-canary label
added workflowstaging label and removed workflowcanary label
added workflowproduction label and removed workflowstaging label
added workflowpost-deploy-db-staging label and removed workflowproduction label
added workflowpost-deploy-db-production label and removed workflowpost-deploy-db-staging label
mentioned in commit 71f41019