Loading
Move the Orbit GraphQL API under one orbit object
What does this MR do and why?
Moves the Orbit GraphQL API under one orbit object, and moves the frontend to it. Behavior does not change. The instance trial and the group list fix build on this shape.
Query.orbitlists groups with the same arguments asQuery.groups, plus an Orbit filter, and lists the excluded groups.Group.orbitandProject.orbitalways return an object, with the Orbit state, the access, and the indexing state. The fields that need Orbit access stay empty without it.- The permission to turn Orbit on moves to the user permissions. The two exclusion mutations get an
orbitname.
The old fields stay, so that a page from another version works during a deploy. A follow-up MR removes them.
Old and new fields
| Old | New |
|---|---|
groups(withKnowledgeGraphEnabled:) |
orbit { groups(enabled:) } |
knowledgeGraphExcludedNamespaces |
orbit { excludedGroups } |
Group.knowledgeGraphEnabled |
Group.orbit.enabled |
Group.knowledgeGraphAvailable |
Group.userPermissions.updateKnowledgeGraphSetting |
Group.orbitAccess |
Group.orbit.access |
Group.orbitTrial |
Group.orbit.access.trial |
orbit.indexingStatus { phase domains } |
orbit.indexing { state areas } |
SYNCING, ERROR |
INDEXING, FAILED |
itemCounts { domains { entities } } |
itemCounts { areas { itemTypes } } |
projects { gaps totalKnown } |
projects { notIndexed total } |
knowledgeGraphExcludedNamespaceCreate, Destroy |
orbitExcludedGroupCreate, Destroy |
New schema (the old fields stay until the follow-up)
type Query {
orbit: Orbit
}
type Group {
orbit: OrbitNamespace
}
type Project {
orbit: OrbitNamespace
}
type GroupPermissions {
readOrbitSetting: Boolean!
readOrbitTrial: Boolean!
startOrbitTrial: Boolean!
updateKnowledgeGraphSetting: Boolean!
}
type Orbit {
excludedGroups(
after: String
before: String
first: Int
last: Int
): GroupConnection
groups(
active: Boolean = null
after: String
aimedForDeletion: Boolean
allAvailable: Boolean = true
before: String
enabled: Boolean = false
first: Int
ids: [ID!]
includeSubgroups: Boolean = false
last: Int
markedForDeletionOn: Date
not: BaseGroupsResolverNegatedParams
ownedOnly: Boolean = false
parentPath: ID
search: String
sort: String = "name_asc"
topLevelOnly: Boolean = false
visibilityLevel: VisibilityLevelsEnum
): GroupConnection
}
type OrbitNamespace {
access: OrbitAccess
enabled: Boolean
enabledAt: Time
indexing: OrbitIndexing
itemCounts: OrbitItemCounts
}
type OrbitAccess {
reason: OrbitAccessReason
state: OrbitAccessState!
trial: OrbitTrial
turnOnDenialReason: OrbitTurnOnDenialReason
}
type OrbitTrial {
credits: OrbitTrialCredits
expiresOn: Date
offer: OrbitTrialOffer
state: OrbitTrialState!
}
type OrbitIndexing {
areas: [OrbitIndexingArea!]
projects: OrbitIndexingProjects
state: OrbitIndexingState
}
type OrbitIndexingArea {
name: String!
state: OrbitIndexingState
}
type OrbitIndexingProjects {
indexed: Int
notIndexed: Int
total: Int
}
enum OrbitIndexingState {
FAILED
INDEXING
NOT_STARTED
READY
UNKNOWN
}
type OrbitItemCounts {
areas: [OrbitItemCountArea!]
}
type OrbitItemCountArea {
itemTypes: [OrbitItemTypeCount!]
name: String!
}
type OrbitItemTypeCount {
count: BigInt
name: String!
}
type Mutation {
orbitExcludedGroupCreate(
input: OrbitExcludedGroupCreateInput!
): OrbitExcludedGroupCreatePayload
orbitExcludedGroupDestroy(
input: OrbitExcludedGroupDestroyInput!
): OrbitExcludedGroupDestroyPayload
}References
- Builds the base for !261678 (merged) (instance trial) and !261855 (closed) (group list fix).
- Earlier design of the access state: https://gitlab.com/gitlab-org/orbit/knowledge-graph/-/snippets/6066521
Screenshots or screen recordings
No UI change.
How to set up and validate locally
-
In
/-/graphql-explorer, run:{ orbit { groups(topLevelOnly: true, allAvailable: false, enabled: true) { nodes { fullPath orbit { enabled access { state } indexing { state areas { name state } } } } } } } -
Open Your work > Orbit, a group's Settings > Orbit, and Admin area > Orbit. They show the same data as on
master.
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 Jean-Gabriel Doyon