Commit 0aa8a75d authored by Vitaly Slobodin's avatar Vitaly Slobodin

Merge branch...

Merge branch '326101-require-id-field-for-all-graphql-entities-in-all-queries-and-mutations' into 'master'

Require id field for all GraphQL operations

See merge request gitlab-org/gitlab!74180
parents efb8c564 58b52a50
......@@ -124,9 +124,9 @@ overrides:
parserOptions:
parser: '@graphql-eslint/eslint-plugin'
operations:
- '{,ee/,jh/}app/**/*.graphql'
# You can run `bundle exec rake gitlab:graphql:schema:dump` and then uncomment this line
# schema: './tmp/tests/graphql/gitlab_schema.graphql'
- '{,ee/,jh/}app/**/*.graphql'
# You can run `bundle exec rake gitlab:graphql:schema:dump` and then uncomment this line
# schema: './tmp/tests/graphql/gitlab_schema.graphql'
rules:
filenames/match-regex: off
spaced-comment: off
......@@ -138,3 +138,4 @@ overrides:
#'@graphql-eslint/known-type-names': error
'@graphql-eslint/no-anonymous-operations': error
'@graphql-eslint/unique-operation-name': error
# '@graphql-eslint/require-id-when-available': error
query getAlertsCount($searchTerm: String, $projectPath: ID!, $assigneeUsername: String = "") {
project(fullPath: $projectPath) {
id
alertManagementAlertStatusCounts(search: $searchTerm, assigneeUsername: $assigneeUsername) {
all
open
......
......@@ -3,6 +3,9 @@
mutation createHttpIntegration($projectPath: ID!, $name: String!, $active: Boolean!) {
httpIntegrationCreate(input: { projectPath: $projectPath, name: $name, active: $active }) {
errors
# We have ID in a deeply nested fragment
# TODO: Uncomment next line when https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75220 is merged and the rule is enabled
# # eslint-disable-next-line @graphql-eslint/require-id-when-available
integration {
...HttpIntegrationItem
}
......
......@@ -3,6 +3,9 @@
mutation destroyHttpIntegration($id: ID!) {
httpIntegrationDestroy(input: { id: $id }) {
errors
# We have ID in a deeply nested fragment
# TODO: Uncomment next line when https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75220 is merged and the rule is enabled
# # eslint-disable-next-line @graphql-eslint/require-id-when-available
integration {
...HttpIntegrationItem
}
......
......@@ -3,6 +3,9 @@
mutation resetHttpIntegrationToken($id: ID!) {
httpIntegrationResetToken(input: { id: $id }) {
errors
# We have ID in a deeply nested fragment
# TODO: Uncomment next line when https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75220 is merged and the rule is enabled
# # eslint-disable-next-line @graphql-eslint/require-id-when-available
integration {
...HttpIntegrationItem
}
......
......@@ -3,6 +3,9 @@
mutation updateHttpIntegration($id: ID!, $name: String!, $active: Boolean!) {
httpIntegrationUpdate(input: { id: $id, name: $name, active: $active }) {
errors
# We have ID in a deeply nested fragment
# TODO: Uncomment next line when https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75220 is merged and the rule is enabled
# # eslint-disable-next-line @graphql-eslint/require-id-when-available
integration {
...HttpIntegrationItem
}
......
......@@ -2,6 +2,7 @@
query getHttpIntegration($projectPath: ID!, $id: ID) {
project(fullPath: $projectPath) {
id
alertManagementHttpIntegrations(id: $id) {
nodes {
...HttpIntegrationPayloadData
......
......@@ -2,6 +2,7 @@
query getIntegrations($projectPath: ID!) {
project(fullPath: $projectPath) {
id
alertManagementIntegrations {
nodes {
...IntegrationItem
......
query parsePayloadFields($projectPath: ID!, $payload: String!) {
project(fullPath: $projectPath) {
id
alertManagementPayloadFields(payloadExample: $payload) {
path
label
......
......@@ -5,6 +5,7 @@ query analyticsGetGroupProjects(
$includeSubgroups: Boolean = false
) {
group(fullPath: $groupFullPath) {
id
projects(
search: $search
first: $first
......
query getKeepLatestArtifactProjectSetting($fullPath: ID!) {
project(fullPath: $fullPath) {
id
ciCdSettings {
keepLatestArtifact
}
......
......@@ -7,6 +7,7 @@ query BoardLabels(
$isProject: Boolean = false
) {
group(fullPath: $fullPath) @include(if: $isGroup) {
id
labels(searchTerm: $searchTerm, onlyGroupLabels: true, includeAncestorGroups: true) {
nodes {
...Label
......@@ -14,6 +15,7 @@ query BoardLabels(
}
}
project(fullPath: $fullPath) @include(if: $isProject) {
id
labels(searchTerm: $searchTerm, includeAncestorGroups: true) {
nodes {
...Label
......
......@@ -2,6 +2,9 @@
mutation createBoardList($boardId: BoardID!, $backlog: Boolean, $labelId: LabelID) {
boardListCreate(input: { boardId: $boardId, backlog: $backlog, labelId: $labelId }) {
# We have ID in a deeply nested fragment
# TODO: Uncomment next line when https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75220 is merged and the rule is enabled
# # eslint-disable-next-line @graphql-eslint/require-id-when-available
list {
...BoardListFragment
}
......
......@@ -2,6 +2,9 @@
mutation UpdateBoardList($listId: ID!, $position: Int, $collapsed: Boolean) {
updateBoardList(input: { listId: $listId, position: $position, collapsed: $collapsed }) {
# We have ID in a deeply nested fragment
# TODO: Uncomment next line when https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75220 is merged and the rule is enabled
# # eslint-disable-next-line @graphql-eslint/require-id-when-available
list {
...BoardListFragment
}
......
......@@ -8,9 +8,14 @@ query BoardLists(
$isProject: Boolean = false
) {
group(fullPath: $fullPath) @include(if: $isGroup) {
id
board(id: $boardId) {
id
hideBacklogList
lists(issueFilters: $filters) {
# We have ID in a deeply nested fragment
# TODO: Uncomment next line when https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75220 is merged and the rule is enabled
# # eslint-disable-next-line @graphql-eslint/require-id-when-available
nodes {
...BoardListFragment
}
......@@ -18,9 +23,14 @@ query BoardLists(
}
}
project(fullPath: $fullPath) @include(if: $isProject) {
id
board(id: $boardId) {
id
hideBacklogList
lists(issueFilters: $filters) {
# We have ID in a deeply nested fragment
# TODO: Uncomment next line when https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75220 is merged and the rule is enabled
# # eslint-disable-next-line @graphql-eslint/require-id-when-available
nodes {
...BoardListFragment
}
......
......@@ -2,6 +2,7 @@
query GroupBoard($fullPath: ID!, $boardId: ID!) {
workspace: group(fullPath: $fullPath) {
id
board(id: $boardId) {
...BoardScopeFragment
}
......
......@@ -3,6 +3,7 @@
query GroupBoardMembers($fullPath: ID!, $search: String) {
workspace: group(fullPath: $fullPath) {
__typename
id
assignees: groupMembers(search: $search, relations: [DIRECT, DESCENDANTS, INHERITED]) {
__typename
nodes {
......
query GroupBoardMilestones($fullPath: ID!, $searchTerm: String) {
group(fullPath: $fullPath) {
id
milestones(includeAncestors: true, searchTitle: $searchTerm) {
nodes {
id
......
......@@ -2,6 +2,7 @@
query group_boards($fullPath: ID!) {
group(fullPath: $fullPath) {
id
boards {
edges {
node {
......
......@@ -2,6 +2,7 @@
query boardsGetGroupProjects($fullPath: ID!, $search: String, $after: String) {
group(fullPath: $fullPath) {
id
projects(search: $search, after: $after, first: 100, includeSubgroups: true) {
nodes {
id
......
mutation issueSetSubscription($input: IssueSetSubscriptionInput!) {
updateIssuableSubscription: issueSetSubscription(input: $input) {
issue {
id
subscribed
}
errors
......
mutation issueSetTitle($input: UpdateIssueInput!) {
updateIssuableTitle: updateIssue(input: $input) {
issue {
id
title
}
errors
......
......@@ -11,7 +11,9 @@ query BoardListEE(
$first: Int
) {
group(fullPath: $fullPath) @include(if: $isGroup) {
id
board(id: $boardId) {
id
lists(id: $id, issueFilters: $filters) {
nodes {
id
......@@ -33,7 +35,9 @@ query BoardListEE(
}
}
project(fullPath: $fullPath) @include(if: $isProject) {
id
board(id: $boardId) {
id
lists(id: $id, issueFilters: $filters) {
nodes {
id
......
......@@ -2,6 +2,7 @@
query ProjectBoard($fullPath: ID!, $boardId: ID!) {
workspace: project(fullPath: $fullPath) {
id
board(id: $boardId) {
...BoardScopeFragment
}
......
......@@ -3,6 +3,7 @@
query ProjectBoardMembers($fullPath: ID!, $search: String) {
workspace: project(fullPath: $fullPath) {
__typename
id
assignees: projectMembers(search: $search) {
__typename
nodes {
......
query ProjectBoardMilestones($fullPath: ID!, $searchTerm: String) {
project(fullPath: $fullPath) {
id
milestones(searchTitle: $searchTerm, includeAncestors: true) {
nodes {
id
......
......@@ -2,6 +2,7 @@
query project_boards($fullPath: ID!) {
project(fullPath: $fullPath) {
id
boards {
edges {
node {
......
......@@ -5,6 +5,7 @@ query boardProjectMilestones(
$searchTitle: String
) {
project(fullPath: $fullPath) {
id
milestones(state: $state, includeAncestors: $includeAncestors, searchTitle: $searchTitle) {
edges {
node {
......
......@@ -4,8 +4,8 @@ fragment Token on ClusterAgentToken {
description
lastUsedAt
name
createdByUser {
id
name
}
}
......@@ -10,11 +10,13 @@ query getClusterAgent(
$beforeToken: String
) {
project(fullPath: $projectPath) {
id
clusterAgent(name: $agentName) {
id
createdAt
createdByUser {
id
name
}
......
......@@ -13,6 +13,7 @@ export function addAgentToStore(store, createClusterAgent, query, variables) {
const data = produce(sourceData, (draftData) => {
const configuration = {
id: clusterAgent.id,
name: clusterAgent.name,
path: getAgentConfigPath(clusterAgent.name),
webPath: clusterAgent.webPath,
......
......@@ -4,6 +4,7 @@ fragment ClusterAgentFragment on ClusterAgent {
webPath
tokens {
nodes {
id
lastUsedAt
}
}
......
query agentConfigurations($projectPath: ID!) {
project(fullPath: $projectPath) {
id
agentConfigurations {
nodes {
agentName
......@@ -8,6 +9,7 @@ query agentConfigurations($projectPath: ID!) {
clusterAgents {
nodes {
id
name
}
}
......
......@@ -12,6 +12,7 @@ query getAgents(
$beforeTree: String
) {
project(fullPath: $projectPath) {
id
clusterAgents(first: $first, last: $last, before: $beforeAgent, after: $afterAgent) {
nodes {
...ClusterAgentFragment
......@@ -28,6 +29,7 @@ query getAgents(
tree(path: ".gitlab/agents", ref: $defaultBranchName) {
trees(first: $first, last: $last, after: $afterTree, before: $beforeTree) {
nodes {
id
name
path
webPath
......
fragment ResolvedStatus on Discussion {
id
resolvable
resolved
resolvedAt
resolvedBy {
id
name
webUrl
}
......
......@@ -3,6 +3,8 @@
mutation uploadDesign($files: [Upload!]!, $projectPath: ID!, $iid: ID!) {
designManagementUpload(input: { projectPath: $projectPath, iid: $iid, files: $files }) {
# TODO: Uncomment next line when https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75220 is merged and the rule is enabled
# # eslint-disable-next-line @graphql-eslint/require-id-when-available
designs {
...DesignItem
versions {
......@@ -14,6 +16,7 @@ mutation uploadDesign($files: [Upload!]!, $projectPath: ID!, $iid: ID!) {
}
}
skippedDesigns {
id
filename
}
errors
......
......@@ -10,8 +10,11 @@ query getDesign(
project(fullPath: $fullPath) {
id
issue(iid: $iid) {
id
designCollection {
designs(atVersion: $atVersion, filenames: $filenames) {
# TODO: Uncomment next line when https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75220 is merged and the rule is enabled
# # eslint-disable-next-line @graphql-eslint/require-id-when-available
nodes {
...DesignItem
issue {
......
query errorDetails($fullPath: ID!, $errorId: ID!) {
project(fullPath: $fullPath) {
id
sentryErrors {
detailedError(id: $errorId) {
id
......
......@@ -6,6 +6,7 @@ fragment AlertListItem on AlertManagementAlert {
startedAt
eventCount
issue {
id
iid
state
title
......
......@@ -12,6 +12,7 @@ fragment AlertDetailItem on AlertManagementAlert {
endedAt
hosts
environment {
id
name
path
}
......
fragment TimelogFragment on Timelog {
timeSpent
user {
id
name
}
spentAt
note {
id
body
}
summary
......
# TODO: Uncomment next line when https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75220 is merged and the rule is enabled
# # eslint-disable-next-line @graphql-eslint/require-id-when-available
fragment UserAvailability on User {
status {
availability
......
mutation createMergeRequest($input: MergeRequestCreateInput!) {
mergeRequestCreate(input: $input) {
mergeRequest {
id
iid
}
errors
......
......@@ -2,6 +2,7 @@
query alertDetails($fullPath: ID!, $alertId: String) {
project(fullPath: $fullPath) {
id
alertManagementAlerts(iid: $alertId) {
nodes {
...AlertDetailItem
......
......@@ -14,6 +14,7 @@ query getAlerts(
$domain: AlertManagementDomainFilter = operations
) {
project(fullPath: $projectPath) {
id
alertManagementAlerts(
search: $searchTerm
assigneeUsername: $assigneeUsername
......
......@@ -6,6 +6,7 @@ query groupUsersSearch($search: String!, $fullPath: ID!) {
id
users: groupMembers(search: $search, relations: [DIRECT, DESCENDANTS, INHERITED]) {
nodes {
id
user {
...User
...UserAvailability
......
......@@ -3,6 +3,7 @@ query searchProjectMembers($fullPath: ID!, $search: String) {
id
projectMembers(search: $search) {
nodes {
id
user {
id
name
......
......@@ -3,8 +3,10 @@
query projectUsersSearch($search: String!, $fullPath: ID!) {
workspace: project(fullPath: $fullPath) {
id
users: projectMembers(search: $search, relations: [DIRECT, INHERITED, INVITED_GROUPS]) {
nodes {
id
user {
...User
...UserAvailability
......
fragment IdeProject on Project {
id
userPermissions {
createMergeRequestIn
readMergeRequest
......
# TODO: Uncomment next line when https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75220 is merged and the rule is enabled
# # eslint-disable-next-line @graphql-eslint/require-id-when-available
fragment IncidentFields on Issue {
severity
}
......@@ -6,6 +6,7 @@ query getIncidentsCountByStatus(
$assigneeUsername: String = ""
) {
project(fullPath: $projectPath) {
id
issueStatusCounts(
search: $searchTerm
types: $issueTypes
......
......@@ -14,6 +14,7 @@ query getIncidents(
$assigneeUsername: String = ""
) {
project(fullPath: $projectPath) {
id
issues(
search: $searchTerm
types: $issueTypes
......@@ -27,18 +28,21 @@ query getIncidents(
before: $prevPageCursor
) {
nodes {
id
iid
title
createdAt
state
labels {
nodes {
id
title
color
}
}
assignees {
nodes {
id
name
username
avatarUrl
......
query issueSuggestion($fullPath: ID!, $search: String) {
project(fullPath: $fullPath) {
id
issues(search: $search, sort: updated_desc, first: 5) {
edges {
node {
id
iid
title
confidential
......@@ -14,6 +16,7 @@ query issueSuggestion($fullPath: ID!, $search: String) {
createdAt
updatedAt
author {
id
name
username
avatarUrl
......
query getAlert($iid: String!, $fullPath: ID!) {
project(fullPath: $fullPath) {
id
issue(iid: $iid) {
id
alertManagementAlert {
......
mutation promoteToEpic($input: PromoteToEpicInput!) {
promoteToEpic(input: $input) {
epic {
id
webPath
}
errors
......
......@@ -26,6 +26,7 @@ query getIssues(
$lastPageSize: Int
) {
group(fullPath: $fullPath) @skip(if: $isProject) {
id
issues(
includeSubgroups: true
search: $search
......@@ -56,6 +57,7 @@ query getIssues(
}
}
project(fullPath: $fullPath) @include(if: $isProject) {
id
issues(
search: $search
sort: $sort
......
......@@ -16,6 +16,7 @@ query getIssuesCount(
$not: NegatedIssueFilterInput
) {
group(fullPath: $fullPath) @skip(if: $isProject) {
id
openedIssues: issues(
includeSubgroups: true
state: opened
......@@ -69,6 +70,7 @@ query getIssuesCount(
}
}
project(fullPath: $fullPath) @include(if: $isProject) {
id
openedIssues: issues(
state: opened
search: $search
......
query getIssuesListDetails($fullPath: ID!) {
project(fullPath: $fullPath) {
id
issues {
nodes {
id
labels {
nodes {
id
title
color
}
......
......@@ -2,6 +2,7 @@
query searchLabels($fullPath: ID!, $search: String, $isProject: Boolean = false) {
group(fullPath: $fullPath) @skip(if: $isProject) {
id
labels(searchTerm: $search, includeAncestorGroups: true, includeDescendantGroups: true) {
nodes {
...Label
......@@ -9,6 +10,7 @@ query searchLabels($fullPath: ID!, $search: String, $isProject: Boolean = false)
}
}
project(fullPath: $fullPath) @include(if: $isProject) {
id
labels(searchTerm: $search, includeAncestorGroups: true) {
nodes {
...Label
......
......@@ -2,6 +2,7 @@
query searchMilestones($fullPath: ID!, $search: String, $isProject: Boolean = false) {
group(fullPath: $fullPath) @skip(if: $isProject) {
id
milestones(searchTitle: $search, includeAncestors: true, includeDescendants: true) {
nodes {
...Milestone
......@@ -9,6 +10,7 @@ query searchMilestones($fullPath: ID!, $search: String, $isProject: Boolean = fa
}
}
project(fullPath: $fullPath) @include(if: $isProject) {
id
milestones(searchTitle: $search, includeAncestors: true) {
nodes {
...Milestone
......
query searchProjects($fullPath: ID!, $search: String) {
group(fullPath: $fullPath) {
id
projects(search: $search, includeSubgroups: true) {
nodes {
id
......
......@@ -2,8 +2,10 @@
query searchUsers($fullPath: ID!, $search: String, $isProject: Boolean = false) {
group(fullPath: $fullPath) @skip(if: $isProject) {
id
groupMembers(search: $search) {
nodes {
id
user {
...User
}
......@@ -11,8 +13,10 @@ query searchUsers($fullPath: ID!, $search: String, $isProject: Boolean = false)
}
}
project(fullPath: $fullPath) @include(if: $isProject) {
id
projectMembers(search: $search) {
nodes {
id
user {
...User
}
......
......@@ -5,6 +5,7 @@ query getProject(
$branchNamesSearchPattern: String!
) {
project(fullPath: $projectPath) {
id
repository {
branchNames(
limit: $branchNamesLimit
......
......@@ -2,6 +2,7 @@
query getJiraImportDetails($fullPath: ID!) {
project(fullPath: $fullPath) {
id
jiraImportStatus
jiraImports {
nodes {
......
......@@ -2,6 +2,7 @@ fragment JiraImport on JiraImport {
jiraProjectKey
scheduledAt
scheduledBy {
id
name
}
}
query jiraSearchProjectMembers($fullPath: ID!, $search: String) {
project(fullPath: $fullPath) {
id
projectMembers(search: $search) {
nodes {
id
user {
id
name
......
......@@ -7,6 +7,7 @@ query getJobs(
$statuses: [CiJobStatus!]
) {
project(fullPath: $fullPath) {
id
jobs(after: $after, before: $before, first: $first, last: $last, statuses: $statuses) {
pageInfo {
endCursor
......@@ -27,6 +28,7 @@ query getJobs(
triggered
createdByTag
detailedStatus {
id
detailsPath
group
icon
......@@ -34,6 +36,7 @@ query getJobs(
text
tooltip
action {
id
buttonTitle
icon
method
......@@ -51,11 +54,13 @@ query getJobs(
id
path
user {
id
webPath
avatarUrl
}
}
stage {
id
name
}
name
......
......@@ -7,6 +7,7 @@ query getDashboardValidationWarnings(
id
environments(name: $environmentName) {
nodes {
id
name
metricsDashboard(path: $dashboardPath) {
path
......
query mergeRequest($projectPath: ID!, $mergeRequestIID: String!) {
project(fullPath: $projectPath) {
id
mergeRequest(iid: $mergeRequestIID) {
id
title
createdAt
state
headPipeline {
id
detailedStatus {
id
icon
group
}
......
......@@ -9,6 +9,7 @@ query getContainerRepositoriesDetails(
$sort: ContainerRepositorySort
) {
project(fullPath: $fullPath) @skip(if: $isGroupPage) {
id
containerRepositories(
name: $name
after: $after
......@@ -24,6 +25,7 @@ query getContainerRepositoriesDetails(
}
}
group(fullPath: $fullPath) @include(if: $isGroupPage) {
id
containerRepositories(
name: $name
after: $after
......
......@@ -11,6 +11,7 @@ query getContainerRepositoryDetails($id: ID!) {
expirationPolicyStartedAt
expirationPolicyCleanupStatus
project {
id
visibility
path
containerExpirationPolicy {
......
......@@ -8,6 +8,7 @@ query getDependencyProxyDetails(
$before: String
) {
group(fullPath: $fullPath) {
id
dependencyProxyBlobCount
dependencyProxyTotalSize
dependencyProxyImagePrefix
......@@ -16,6 +17,7 @@ query getDependencyProxyDetails(
}
dependencyProxyManifests(after: $after, before: $before, first: $first, last: $last) {
nodes {
id
createdAt
imageName
}
......
......@@ -7,20 +7,24 @@ fragment PackageData on Package {
status
tags {
nodes {
id
name
}
}
pipelines(last: 1) {
nodes {
id
sha
ref
commitPath
user {
id
name
}
}
}
project {
id
fullPath
webUrl
}
......
......@@ -8,6 +8,7 @@ query getPackageDetails($id: ID!) {
updatedAt
status
project {
id
path
}
tags(first: 10) {
......@@ -25,9 +26,11 @@ query getPackageDetails($id: ID!) {
commitPath
path
user {
id
name
}
project {
id
name
webUrl
}
......@@ -86,15 +89,18 @@ query getPackageDetails($id: ID!) {
}
}
... on PypiMetadata {
id
requiredPython
}
... on ConanMetadata {
id
packageChannel
packageUsername
recipe
recipePath
}
... on MavenMetadata {
id
appName
appGroup
appVersion
......@@ -102,6 +108,7 @@ query getPackageDetails($id: ID!) {
}
... on NugetMetadata {
id
iconUrl
licenseUrl
projectUrl
......
......@@ -14,6 +14,7 @@ query getPackages(
$before: String
) {
project(fullPath: $fullPath) @skip(if: $isGroupPage) {
id
packages(
sort: $sort
packageName: $packageName
......@@ -33,6 +34,7 @@ query getPackages(
}
}
group(fullPath: $fullPath) @include(if: $isGroupPage) {
id
packages(
sort: $groupSort
packageName: $packageName
......
query getGroupPackagesSettings($fullPath: ID!) {
group(fullPath: $fullPath) {
id
dependencyProxySetting {
enabled
}
......
......@@ -2,6 +2,7 @@
query getProjectExpirationPolicy($projectPath: ID!) {
project(fullPath: $projectPath) {
id
containerExpirationPolicy {
...ContainerExpirationPolicyFields
}
......
query getMergeRequestState($projectPath: ID!, $iid: String!) {
workspace: project(fullPath: $projectPath) {
id
issuable: mergeRequest(iid: $iid) {
id
state
}
}
......
......@@ -22,6 +22,7 @@ mutation commitCIFile(
__typename
commit {
__typename
id
sha
}
commitPipelinePath
......
......@@ -5,6 +5,7 @@ query getAvailableBranches(
$searchPattern: String!
) {
project(fullPath: $projectFullPath) {
id
repository {
branchNames(limit: $limit, offset: $offset, searchPattern: $searchPattern)
}
......
query getBlobContent($projectPath: ID!, $path: String!, $ref: String) {
project(fullPath: $projectPath) {
id
repository {
blobs(paths: [$path], ref: $ref) {
nodes {
id
rawBlob
}
}
......
query getPipeline($fullPath: ID!, $sha: String!) {
project(fullPath: $fullPath) {
id
pipeline(sha: $sha) {
id
iid
status
commit {
id
title
webPath
}
detailedStatus {
id
detailsPath
icon
group
......
query getTemplate($projectPath: ID!, $templateName: String!) {
project(fullPath: $projectPath) {
id
ciTemplate(name: $templateName) {
content
}
......
query getLatestCommitSha($projectPath: ID!, $ref: String) {
project(fullPath: $projectPath) {
id
repository {
tree(ref: $ref) {
lastCommit {
id
sha
}
}
......
query getDagVisData($projectPath: ID!, $iid: ID!) {
project(fullPath: $projectPath) {
id
pipeline(iid: $iid) {
id
stages {
nodes {
id
name
groups {
nodes {
id
name
size
jobs {
nodes {
id
name
needs {
nodes {
id
name
}
}
......
query getPipelineHeaderData($fullPath: ID!, $iid: ID!) {
project(fullPath: $fullPath) {
id
pipeline(iid: $iid) {
id
iid
......@@ -11,6 +12,7 @@ query getPipelineHeaderData($fullPath: ID!, $iid: ID!) {
updatePipeline
}
detailedStatus {
id
detailsPath
icon
group
......
query getLinkedPipelines($fullPath: ID!, $iid: ID!) {
project(fullPath: $fullPath) {
id
pipeline(iid: $iid) {
id
path
downstream {
nodes {
id
path
project {
id
name
}
detailedStatus {
id
group
icon
label
......@@ -20,9 +24,11 @@ query getLinkedPipelines($fullPath: ID!, $iid: ID!) {
id
path
project {
id
name
}
detailedStatus {
id
group
icon
label
......
query searchNamespacesWhereUserCanCreateProjects($search: String) {
currentUser {
id
groups(permissionScope: CREATE_PROJECTS, search: $search) {
nodes {
id
......
query getPipelineCountByStatus($projectPath: ID!) {
project(fullPath: $projectPath) {
id
totalPipelines: pipelines {
count
}
......
query getProjectPipelineStatistics($projectPath: ID!) {
project(fullPath: $projectPath) {
id
pipelineAnalytics {
weekPipelinesTotals
weekPipelinesLabels
......
......@@ -35,6 +35,7 @@ fragment Release on Release {
__typename
nodes {
__typename
id
filepath
collectedAt
sha
......@@ -52,12 +53,14 @@ fragment Release on Release {
}
commit {
__typename
id
sha
webUrl
title
}
author {
__typename
id
webUrl
avatarUrl
username
......
......@@ -18,6 +18,7 @@ fragment ReleaseForEditing on Release {
}
milestones {
nodes {
id
title
}
}
......
......@@ -16,6 +16,7 @@ query allReleasesDeprecated(
) {
project(fullPath: $fullPath) {
__typename
id
releases(first: $first, last: $last, before: $before, after: $after, sort: $sort) {
__typename
nodes {
......
......@@ -2,6 +2,7 @@
query oneRelease($fullPath: ID!, $tagName: String!) {
project(fullPath: $fullPath) {
id
release(tagName: $tagName) {
...Release
}
......
......@@ -2,6 +2,7 @@
query oneReleaseForEditing($fullPath: ID!, $tagName: String!) {
project(fullPath: $fullPath) {
id
release(tagName: $tagName) {
...ReleaseForEditing
}
......
......@@ -4,6 +4,7 @@ mutation toggleLock($projectPath: ID!, $filePath: String!, $lock: Boolean!) {
id
pathLocks {
nodes {
id
path
}
}
......
......@@ -9,6 +9,7 @@ query getBlobInfo($projectPath: ID!, $filePath: String!, $ref: String!) {
}
pathLocks {
nodes {
id
path
}
}
......@@ -16,6 +17,7 @@ query getBlobInfo($projectPath: ID!, $filePath: String!, $ref: String!) {
empty
blobs(paths: [$filePath], ref: $ref) {
nodes {
id
webPath
name
size
......
......@@ -13,6 +13,7 @@ query getGroupRunners(
$sort: CiRunnerSort
) {
group(fullPath: $groupFullPath) {
id
runners(
membership: DESCENDANTS
before: $before
......
#import "ee_else_ce/runner/graphql/runner_details.fragment.graphql"
query getRunner($id: CiRunnerID!) {
# We have an id in deeply nested fragment
# TODO: Uncomment next line when https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75220 is merged and the rule is enabled
# # eslint-disable-next-line @graphql-eslint/require-id-when-available
runner(id: $id) {
...RunnerDetails
}
......
......@@ -5,6 +5,9 @@
mutation runnerUpdate($input: RunnerUpdateInput!) {
runnerUpdate(input: $input) {
# We have an id in deep nested fragment
# TODO: Uncomment next line when https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75220 is merged and the rule is enabled
# # eslint-disable-next-line @graphql-eslint/require-id-when-available
runner {
...RunnerDetails
}
......
mutation updateIssueLocked($input: IssueSetLockedInput!) {
issueSetLocked(input: $input) {
issue {
id
discussionLocked
}
errors
......
mutation updateMergeRequestLocked($input: MergeRequestSetLockedInput!) {
mergeRequestSetLocked(input: $input) {
mergeRequest {
id
discussionLocked
}
errors
......
......@@ -3,6 +3,7 @@ mutation updateIssuableSeverity($projectPath: ID!, $severity: IssuableSeverity!,
errors
issue {
iid
id
severity
}
}
......
query epicConfidential($fullPath: ID!, $iid: ID) {
workspace: group(fullPath: $fullPath) {
__typename
id
issuable: epic(iid: $iid) {
__typename
id
......
query epicDueDate($fullPath: ID!, $iid: ID) {
workspace: group(fullPath: $fullPath) {
__typename
id
issuable: epic(iid: $iid) {
__typename
id
......
......@@ -4,6 +4,7 @@
query epicParticipants($fullPath: ID!, $iid: ID) {
workspace: group(fullPath: $fullPath) {
__typename
id
issuable: epic(iid: $iid) {
__typename
id
......
query epicReference($fullPath: ID!, $iid: ID) {
workspace: group(fullPath: $fullPath) {
__typename
id
issuable: epic(iid: $iid) {
__typename
id
......
query epicStartDate($fullPath: ID!, $iid: ID) {
workspace: group(fullPath: $fullPath) {
__typename
id
issuable: epic(iid: $iid) {
__typename
id
......
query epicSubscribed($fullPath: ID!, $iid: ID) {
workspace: group(fullPath: $fullPath) {
__typename
id
emailsDisabled
issuable: epic(iid: $iid) {
__typename
......
query epicTodos($fullPath: ID!, $iid: ID) {
workspace: group(fullPath: $fullPath) {
__typename
id
issuable: epic(iid: $iid) {
__typename
id
......
......@@ -3,6 +3,7 @@
subscription issuableAssigneesUpdated($issuableId: IssuableID!) {
issuableAssigneesUpdated(issuableId: $issuableId) {
... on Issue {
id
assignees {
nodes {
...User
......
query issueConfidential($fullPath: ID!, $iid: String) {
workspace: project(fullPath: $fullPath) {
__typename
id
issuable: issue(iid: $iid) {
__typename
id
......
query issueDueDate($fullPath: ID!, $iid: String) {
workspace: project(fullPath: $fullPath) {
__typename
id
issuable: issue(iid: $iid) {
__typename
id
......
query issueReference($fullPath: ID!, $iid: String) {
workspace: project(fullPath: $fullPath) {
id
__typename
issuable: issue(iid: $iid) {
__typename
......
query issueSubscribed($fullPath: ID!, $iid: String) {
workspace: project(fullPath: $fullPath) {
__typename
id
issuable: issue(iid: $iid) {
__typename
id
......
query issueTimeTracking($fullPath: ID!, $iid: String) {
workspace: project(fullPath: $fullPath) {
__typename
id
issuable: issue(iid: $iid) {
__typename
id
......
query issueTodos($fullPath: ID!, $iid: String!) {
workspace: project(fullPath: $fullPath) {
__typename
id
issuable: issue(iid: $iid) {
__typename
id
......
......@@ -3,6 +3,7 @@
query mergeRequestMilestone($fullPath: ID!, $iid: String!) {
workspace: project(fullPath: $fullPath) {
__typename
id
issuable: mergeRequest(iid: $iid) {
__typename
id
......
query mergeRequestReference($fullPath: ID!, $iid: String!) {
workspace: project(fullPath: $fullPath) {
__typename
id
issuable: mergeRequest(iid: $iid) {
__typename
id
......
query mergeRequestSubscribed($fullPath: ID!, $iid: String!) {
workspace: project(fullPath: $fullPath) {
__typename
id
issuable: mergeRequest(iid: $iid) {
__typename
id
......
query mergeRequestTimeTracking($fullPath: ID!, $iid: String!) {
workspace: project(fullPath: $fullPath) {
__typename
id
issuable: mergeRequest(iid: $iid) {
__typename
id
......
query mergeRequestTodos($fullPath: ID!, $iid: String!) {
workspace: project(fullPath: $fullPath) {
__typename
id
issuable: mergeRequest(iid: $iid) {
__typename
id
......
......@@ -3,6 +3,7 @@
query projectIssueMilestone($fullPath: ID!, $iid: String!) {
workspace: project(fullPath: $fullPath) {
__typename
id
issuable: issue(iid: $iid) {
__typename
id
......
......@@ -3,6 +3,7 @@
query projectMilestones($fullPath: ID!, $title: String, $state: MilestoneStateEnum) {
workspace: project(fullPath: $fullPath) {
__typename
id
attributes: milestones(
searchTitle: $title
state: $state
......
query sidebarDetails($fullPath: ID!, $iid: String!) {
project(fullPath: $fullPath) {
id
issue(iid: $iid) {
id
iid
}
}
......
query mergeRequestSidebarDetails($fullPath: ID!, $iid: String!) {
project(fullPath: $fullPath) {
id
mergeRequest(iid: $iid) {
id
iid # currently unused.
}
}
......
mutation updateEpicTitle($input: UpdateEpicInput!) {
updateIssuableTitle: updateEpic(input: $input) {
epic {
id
title
}
errors
......
fragment SnippetProject on Snippet {
project {
fullPath
webUrl
}
}
......@@ -2,6 +2,7 @@ mutation CreateSnippet($input: CreateSnippetInput!) {
createSnippet(input: $input) {
errors
snippet {
id
webUrl
}
}
......
......@@ -2,6 +2,7 @@ mutation UpdateSnippet($input: UpdateSnippetInput!) {
updateSnippet(input: $input) {
errors
snippet {
id
webUrl
}
}
......
query sourceContent($project: ID!, $sourcePath: String!) {
project(fullPath: $project) {
id
fullPath
file(path: $sourcePath) @client {
title
......
#import "~/graphql_shared/fragments/user.fragment.graphql"
fragment StateVersion on TerraformStateVersion {
id
downloadPath
serial
updatedAt
createdByUser {
...User
}
job {
id
detailedStatus {
id
detailsPath
group
icon
label
text
}
pipeline {
id
path
......
......@@ -3,13 +3,12 @@
query getStates($projectPath: ID!, $first: Int, $last: Int, $before: String, $after: String) {
project(fullPath: $projectPath) {
id
terraformStates(first: $first, last: $last, before: $before, after: $after) {
count
nodes {
...State
}
pageInfo {
...PageInfo
}
......
query getCIJobTokenScope($fullPath: ID!) {
project(fullPath: $fullPath) {
id
ciCdSettings {
jobTokenScopeEnabled
}
......
query getProjectsWithCIJobTokenScope($fullPath: ID!) {
project(fullPath: $fullPath) {
id
ciJobTokenScope {
projects {
nodes {
id
name
fullPath
}
......
query getAllIssues($projectPath: ID!) {
project(fullPath: $projectPath) {
id
issues {
nodes {
id
......
query getProjectIssues($projectPath: ID!) {
project(fullPath: $projectPath) {
id
issues {
count
}
......
query getState($projectPath: ID!, $iid: String!) {
project(fullPath: $projectPath) {
id
archived
onlyAllowMergeIfPipelineSucceeds
mergeRequest(iid: $iid) {
id
autoMergeEnabled
commitCount
conflicts
......
query userPermissionsQuery($projectPath: ID!, $iid: String!) {
project(fullPath: $projectPath) {
id
mergeRequest(iid: $iid) {
id
userPermissions {
canMerge
pushToSourceBranch
......
fragment autoMergeEnabled on MergeRequest {
id
autoMergeStrategy
mergeUser {
id
......
......@@ -2,6 +2,7 @@
query autoMergeEnabled($projectPath: ID!, $iid: String!) {
project(fullPath: $projectPath) {
id
mergeRequest(iid: $iid) {
...autoMergeEnabled
}
......
query autoMergeFailedQuery($projectPath: ID!, $iid: String!) {
project(fullPath: $projectPath) {
id
mergeRequest(iid: $iid) {
id
mergeError
}
}
......
query workInProgress($projectPath: ID!, $iid: String!) {
project(fullPath: $projectPath) {
id
mergeRequest(iid: $iid) {
id
shouldBeRebased
sourceBranchProtected
}
......
query mrUserPermission($projectPath: ID!, $iid: String!) {
project(fullPath: $projectPath) {
id
mergeRequest(iid: $iid) {
id
userPermissions {
updateMergeRequest
}
......
query missingBranchQuery($projectPath: ID!, $iid: String!) {
project(fullPath: $projectPath) {
id
mergeRequest(iid: $iid) {
id
sourceBranchExists
}
}
......
query getReadyToMergeStatus($projectPath: ID!, $iid: String!) {
project(fullPath: $projectPath) {
id
mergeRequest(iid: $iid) {
id
userPermissions {
canMerge
}
......
fragment ReadyToMerge on Project {
id
onlyAllowMergeIfPipelineSucceeds
mergeRequestsFfOnlyEnabled
squashReadOnly
mergeRequest(iid: $iid) {
id
autoMergeEnabled
shouldRemoveSourceBranch
forceRemoveSourceBranch
......@@ -26,6 +28,7 @@ fragment ReadyToMerge on Project {
mergeError
commitsWithoutMergeCommits {
nodes {
id
sha
shortId
title
......
query rebaseQuery($projectPath: ID!, $iid: String!) {
project(fullPath: $projectPath) {
id
mergeRequest(iid: $iid) {
id
rebaseInProgress
targetBranch
userPermissions {
......
mutation toggleDraftStatus($projectPath: ID!, $iid: String!, $draft: Boolean!) {
mergeRequestSetDraft(input: { projectPath: $projectPath, iid: $iid, draft: $draft }) {
mergeRequest {
id
mergeableDiscussionsState
title
draft
......
......@@ -2,6 +2,7 @@ mutation createAlertIssue($projectPath: ID!, $iid: String!) {
createAlertIssue(input: { iid: $iid, projectPath: $projectPath }) {
errors
issue {
id
iid
webUrl
}
......
......@@ -3,6 +3,7 @@
query alertDetailsAssignees($fullPath: ID!, $alertId: String) {
project(fullPath: $fullPath) {
id
alertManagementAlerts(iid: $alertId) {
nodes {
...AlertDetailItem
......
......@@ -2,6 +2,7 @@
query epicLabels($fullPath: ID!, $iid: ID) {
workspace: group(fullPath: $fullPath) {
id
issuable: epic(iid: $iid) {
id
labels {
......
......@@ -2,6 +2,7 @@
query issueLabels($fullPath: ID!, $iid: String) {
workspace: project(fullPath: $fullPath) {
id
issuable: issue(iid: $iid) {
id
labels {
......
......@@ -2,6 +2,7 @@
query mergeRequestLabels($fullPath: ID!, $iid: String!) {
workspace: project(fullPath: $fullPath) {
id
issuable: mergeRequest(iid: $iid) {
id
labels {
......
......@@ -7,6 +7,7 @@ query alertAssignees(
$iid: String!
) {
workspace: project(fullPath: $fullPath) {
id
issuable: alertManagementAlert(domain: $domain, iid: $iid) {
iid
assignees {
......
......@@ -4,6 +4,7 @@
query issueAssignees($fullPath: ID!, $iid: String!) {
workspace: project(fullPath: $fullPath) {
__typename
id
issuable: issue(iid: $iid) {
__typename
id
......
......@@ -4,6 +4,7 @@
query issueParticipants($fullPath: ID!, $iid: String!) {
workspace: project(fullPath: $fullPath) {
__typename
id
issuable: issue(iid: $iid) {
__typename
id
......
......@@ -3,6 +3,7 @@
query getMrAssignees($fullPath: ID!, $iid: String!) {
workspace: project(fullPath: $fullPath) {
id
issuable: mergeRequest(iid: $iid) {
id
assignees {
......
......@@ -3,6 +3,7 @@
query getMrParticipants($fullPath: ID!, $iid: String!) {
workspace: project(fullPath: $fullPath) {
id
issuable: mergeRequest(iid: $iid) {
id
participants {
......
fragment JobArtifacts on Pipeline {
id
jobs(securityReportTypes: $reportTypes) {
nodes {
id
name
artifacts {
nodes {
......
......@@ -4,11 +4,14 @@ query securityReportDownloadPaths(
$reportTypes: [SecurityReportTypeEnum!]
) {
project(fullPath: $projectPath) {
id
mergeRequest(iid: $iid) {
id
headPipeline {
id
jobs(securityReportTypes: $reportTypes) {
nodes {
id
name
artifacts {
nodes {
......
......@@ -2,8 +2,8 @@
query getPipelineCorpuses($projectPath: ID!, $iid: ID, $reportTypes: [SecurityReportTypeEnum!]) {
project(fullPath: $projectPath) {
id
pipeline(iid: $iid) {
id
...JobArtifacts
}
}
......
......@@ -10,6 +10,7 @@ query getProjectContainerRepositories(
) {
project(fullPath: $fullPath) @skip(if: $isGroupPage) {
__typename
id
containerRepositoriesCount
containerRepositories(
name: $name
......@@ -43,6 +44,7 @@ query getProjectContainerRepositories(
}
group(fullPath: $fullPath) @include(if: $isGroupPage) {
__typename
id
containerRepositoriesCount
containerRepositories(
name: $name
......
......@@ -4,6 +4,7 @@ query permissions($fullPath: ID!, $iid: String!) {
id
issue(iid: $iid) {
__typename
id
userPermissions {
__typename
createDesign
......
......@@ -4,6 +4,7 @@ query getDesignList($fullPath: ID!, $iid: String!, $atVersion: ID) {
id
issue(iid: $iid) {
__typename
id
designCollection {
__typename
copyState
......
......@@ -47,6 +47,7 @@ fragment EpicNode on Epic {
hasIssues
group {
__typename
id
fullPath
}
}
......@@ -70,6 +71,9 @@ query childItems(
__typename
edges {
__typename
# We have an id in deeply nested fragment
# TODO: Uncomment next line when https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75220 is merged and the rule is enabled
# # eslint-disable-next-line @graphql-eslint/require-id-when-available
node {
__typename
...EpicNode
......@@ -86,6 +90,7 @@ query childItems(
__typename
node {
__typename
id
iid
epicIssueId
title
......@@ -106,6 +111,7 @@ query childItems(
__typename
node {
__typename
id
webUrl
name
username
......@@ -115,6 +121,7 @@ query childItems(
}
milestone {
__typename
id
title
startDate
dueDate
......
query epicDetails($fullPath: ID!, $iid: ID!) {
group(fullPath: $fullPath) {
__typename
id
epic(iid: $iid) {
__typename
id
participants {
__typename
edges {
__typename
node {
__typename
id
name
avatarUrl
webUrl
......
......@@ -5,16 +5,19 @@ fragment LinkedPipelineData on Pipeline {
path
status: detailedStatus {
__typename
id
group
label
icon
}
sourceJob {
__typename
id
name
}
project {
__typename
id
name
fullPath
}
......@@ -23,6 +26,7 @@ fragment LinkedPipelineData on Pipeline {
query getPipelineDetails($projectPath: ID!, $iid: ID!) {
project(fullPath: $projectPath) {
__typename
id
pipeline(iid: $iid) {
__typename
id
......@@ -45,11 +49,14 @@ query getPipelineDetails($projectPath: ID!, $iid: ID!) {
__typename
nodes {
__typename
id
name
status: detailedStatus {
__typename
id
action {
__typename
id
icon
path
title
......@@ -59,8 +66,10 @@ query getPipelineDetails($projectPath: ID!, $iid: ID!) {
__typename
nodes {
__typename
id
status: detailedStatus {
__typename
id
label
group
icon
......@@ -71,17 +80,20 @@ query getPipelineDetails($projectPath: ID!, $iid: ID!) {
__typename
nodes {
__typename
id
name
scheduledAt
needs {
__typename
nodes {
__typename
id
name
}
}
status: detailedStatus {
__typename
id
icon
tooltip
hasDetails
......@@ -89,6 +101,7 @@ query getPipelineDetails($projectPath: ID!, $iid: ID!) {
group
action {
__typename
id
buttonTitle
icon
path
......
......@@ -11,6 +11,7 @@ query allReleases(
) {
project(fullPath: $fullPath) {
__typename
id
releases(first: $first, last: $last, before: $before, after: $after, sort: $sort) {
__typename
nodes {
......@@ -50,6 +51,7 @@ query allReleases(
__typename
nodes {
__typename
id
filepath
collectedAt
sha
......@@ -67,12 +69,14 @@ query allReleases(
}
commit {
__typename
id
sha
webUrl
title
}
author {
__typename
id
webUrl
avatarUrl
username
......
query pathLastCommit($projectPath: ID!, $path: String, $ref: String!) {
project(fullPath: $projectPath) {
id
__typename
id
repository {
__typename
tree(path: $path, ref: $ref) {
__typename
lastCommit {
__typename
id
sha
title
titleHtml
......@@ -19,6 +20,7 @@ query pathLastCommit($projectPath: ID!, $path: String, $ref: String!) {
authorGravatar
author {
__typename
id
name
avatarUrl
webPath
......@@ -30,8 +32,10 @@ query pathLastCommit($projectPath: ID!, $path: String, $ref: String!) {
__typename
node {
__typename
id
detailedStatus {
__typename
id
detailsPath
icon
tooltip
......
query CanCreateProjectSnippet($fullPath: ID!) {
project(fullPath: $fullPath) {
__typename
id
userPermissions {
__typename
createSnippet
......
......@@ -49,6 +49,7 @@ query GetSnippetQuery($ids: [SnippetID!]) {
}
project {
__typename
id
fullPath
webUrl
}
......
query CanCreatePersonalSnippet {
currentUser {
__typename
id
userPermissions {
__typename
createSnippet
......
......@@ -17,6 +17,9 @@ mutation createHttpIntegrationEE(
}
) {
errors
# We have an id in deeply nested fragment
# TODO: Uncomment next line when https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75220 is merged and the rule is enabled
# # eslint-disable-next-line @graphql-eslint/require-id-when-available
integration {
...HttpIntegrationItem
}
......
......@@ -17,6 +17,9 @@ mutation updateHttpIntegrationEE(
}
) {
errors
# We have an id in deeply nested fragment
# TODO: Uncomment next line when https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75220 is merged and the rule is enabled
# # eslint-disable-next-line @graphql-eslint/require-id-when-available
integration {
...HttpIntegrationItem
}
......
query GroupReleaseStats($fullPath: ID!) {
group(fullPath: $fullPath) {
id
stats {
releaseStats {
releasesCount
......
......@@ -18,6 +18,7 @@ query getThroughputTableData(
$notMilestoneTitle: String
) {
project(fullPath: $fullPath) {
id
mergeRequests(
first: $firstPageSize
last: $lastPageSize
......@@ -38,16 +39,19 @@ query getThroughputTableData(
...PageInfo
}
nodes {
id
iid
title
createdAt
mergedAt
webUrl
milestone {
id
title
}
assignees {
nodes {
id
avatarUrl
name
webUrl
......@@ -62,7 +66,9 @@ query getThroughputTableData(
}
pipelines {
nodes {
id
detailedStatus {
id
icon
}
}
......
......@@ -2,6 +2,7 @@
query repoAnalyticsGetGroupProjects($groupFullPath: ID!, $after: String) {
group(fullPath: $groupFullPath) {
id
projects(hasCodeCoverage: true, after: $after, first: 100) {
nodes {
name
......
query getGroupTestCoverage($groupFullPath: ID!, $startDate: Date!) {
group(fullPath: $groupFullPath) {
id
codeCoverageActivities(startDate: $startDate) {
nodes {
projectCount
......
query getProjectsTestCoverage($groupFullPath: ID!, $projectIds: [ID!]) {
group(fullPath: $groupFullPath) {
id
projects(hasCodeCoverage: true, ids: $projectIds) {
nodes {
fullPath
......
......@@ -18,6 +18,9 @@ mutation createBoardListEE(
assigneeId: $assigneeId
}
) {
# We have an id in deeply nested fragment
# TODO: Uncomment next line when https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75220 is merged and the rule is enabled
# # eslint-disable-next-line @graphql-eslint/require-id-when-available
list {
...BoardListFragment
}
......
......@@ -8,9 +8,14 @@ query ListIssues(
$isProject: Boolean = false
) {
group(fullPath: $fullPath) @include(if: $isGroup) {
id
board(id: $boardId) {
id
hideBacklogList
lists(issueFilters: $filters) {
# We have an id in deeply nested fragment
# TODO: Uncomment next line when https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75220 is merged and the rule is enabled
# # eslint-disable-next-line @graphql-eslint/require-id-when-available
nodes {
...BoardListFragment
}
......@@ -18,9 +23,14 @@ query ListIssues(
}
}
project(fullPath: $fullPath) @include(if: $isProject) {
id
board(id: $boardId) {
id
hideBacklogList
lists(issueFilters: $filters) {
# We have an id in deeply nested fragment
# TODO: Uncomment next line when https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75220 is merged and the rule is enabled
# # eslint-disable-next-line @graphql-eslint/require-id-when-available
nodes {
...BoardListFragment
}
......
......@@ -2,6 +2,7 @@
query EpicBoard($fullPath: ID!, $boardId: BoardsEpicBoardID!) {
workspace: group(fullPath: $fullPath) {
id
board: epicBoard(id: $boardId) {
id
name
......
......@@ -2,7 +2,9 @@
query boardListEpics($fullPath: ID!, $boardId: BoardsEpicBoardID!, $filters: EpicFilters) {
group(fullPath: $fullPath) {
id
board: epicBoard(id: $boardId) {
id
lists(epicFilters: $filters) {
nodes {
...EpicBoardListFragment
......
query EpicBoards($fullPath: ID!) {
group(fullPath: $fullPath) {
id
epicBoards {
nodes {
id
......
......@@ -3,6 +3,9 @@
mutation CreateEpic($input: CreateEpicInput!) {
createEpic(input: $input) {
# We have an id in deeply nested fragment
# TODO: Uncomment next line when https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75220 is merged and the rule is enabled
# # eslint-disable-next-line @graphql-eslint/require-id-when-available
epic {
...EpicNode
labels {
......
......@@ -9,7 +9,9 @@ query BoardEE(
$after: String
) {
group(fullPath: $fullPath) @include(if: $isGroup) {
id
board(id: $boardId) {
id
epics(first: 10, issueFilters: $issueFilters, after: $after) {
edges {
node {
......@@ -27,7 +29,9 @@ query BoardEE(
}
}
project(fullPath: $fullPath) @include(if: $isProject) {
id
board(id: $boardId) {
id
epics(first: 10, issueFilters: $issueFilters, after: $after) {
edges {
node {
......
......@@ -2,6 +2,7 @@
query GroupBoardIterations($fullPath: ID!, $title: String) {
group(fullPath: $fullPath) {
id
iterations(includeAncestors: true, title: $title) {
nodes {
...IterationFragment
......
query EpicLabels($fullPath: ID!, $search: String) {
group(fullPath: $fullPath) {
id
labels(
includeAncestorGroups: true
includeDescendantGroups: true
......
query EpicUsers($fullPath: ID!, $search: String) {
group(fullPath: $fullPath) {
id
groupMembers(relations: [DIRECT, DESCENDANTS, INHERITED], search: $search) {
nodes {
id
user {
id
name
......
......@@ -2,6 +2,9 @@
mutation boardListUpdateLimitMetrics($input: BoardListUpdateLimitMetricsInput!) {
boardListUpdateLimitMetrics(input: $input) {
# We have an id in deeply nested fragment
# TODO: Uncomment next line when https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75220 is merged and the rule is enabled
# # eslint-disable-next-line @graphql-eslint/require-id-when-available
list {
...BoardListFragment
}
......
......@@ -10,12 +10,17 @@ query epicBoardListEpics(
$first: Int
) {
group(fullPath: $fullPath) {
id
epicBoard(id: $boardId) {
id
lists(id: $id) {
nodes {
id
epics(first: $first, after: $after, filters: $filters) {
edges {
# We have an id in deeply nested fragment
# TODO: Uncomment next line when https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75220 is merged and the rule is enabled
# # eslint-disable-next-line @graphql-eslint/require-id-when-available
node {
...EpicNode
relativePosition
......
......@@ -2,6 +2,7 @@
query ProjectBoardIterations($fullPath: ID!, $title: String) {
project(fullPath: $fullPath) {
id
iterations(includeAncestors: true, title: $title) {
nodes {
...IterationFragment
......
......@@ -2,7 +2,9 @@
query getCodeQualityViolations($projectPath: ID!, $iid: ID!, $first: Int, $after: String) {
project(fullPath: $projectPath) {
id
pipeline(iid: $iid) {
id
codeQualityReports(first: $first, after: $after) {
count
nodes {
......
query environment($fullPath: ID!, $environmentName: String) {
project(fullPath: $fullPath) {
id
environment(name: $environmentName) {
id
latestOpenedMostSevereAlert {
title
severity
detailsUrl
startedAt
prometheusAlert {
id
humanizedText
}
}
......
mutation createEpic($input: CreateEpicInput!) {
createEpic(input: $input) {
epic {
id
webUrl
}
errors
......
......@@ -19,6 +19,7 @@ query groupEpics(
$isSignedIn: Boolean = false
) {
group(fullPath: $groupPath) {
id
epics(
state: $state
authorUsername: $authorUsername
......@@ -45,6 +46,7 @@ query groupEpics(
userDiscussionsCount @include(if: $isSignedIn)
confidential
group {
id
fullPath
}
author {
......
......@@ -11,6 +11,7 @@ fragment EscalationPolicy on EscalationPolicyType {
name
}
user {
id
username
name
avatarUrl
......
......@@ -2,6 +2,7 @@
query getEscalationPolicies($projectPath: ID!) {
project(fullPath: $projectPath) {
id
incidentManagementEscalationPolicies {
nodes {
...EscalationPolicy
......
query getOncallSchedules($projectPath: ID!) {
project(fullPath: $projectPath) {
id
incidentManagementOncallSchedules {
nodes {
iid
......
......@@ -2,6 +2,7 @@ fragment EpicNode on Epic {
id
iid
group {
id
fullPath
}
title
......
query getIncidentState($iid: String!, $fullPath: ID!) {
project(fullPath: $fullPath) {
id
issue(iid: $iid) {
id
state
......
# TODO: Uncomment next line when https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75220 is merged and the rule is enabled
# # eslint-disable-next-line @graphql-eslint/require-id-when-available
fragment IncidentFields on Issue {
severity
statusPagePublishedIncident
......
query getSlaDueAt($iid: String!, $fullPath: ID!) {
project(fullPath: $fullPath) {
id
issue(iid: $iid) {
id
slaDueAt
......
......@@ -30,6 +30,7 @@ query getIssuesEE(
$lastPageSize: Int
) {
group(fullPath: $fullPath) @skip(if: $isProject) {
id
issues(
includeSubepics: true
includeSubgroups: true
......@@ -68,6 +69,7 @@ query getIssuesEE(
}
}
project(fullPath: $fullPath) @include(if: $isProject) {
id
issues(
includeSubepics: true
search: $search
......
......@@ -20,6 +20,7 @@ query getIssuesCountEE(
$not: NegatedIssueFilterInput
) {
group(fullPath: $fullPath) @skip(if: $isProject) {
id
openedIssues: issues(
includeSubepics: true
includeSubgroups: true
......@@ -88,6 +89,7 @@ query getIssuesCountEE(
}
}
project(fullPath: $fullPath) @include(if: $isProject) {
id
openedIssues: issues(
includeSubepics: true
state: opened
......
......@@ -2,6 +2,7 @@
query searchIterations($fullPath: ID!, $search: String, $id: ID, $isProject: Boolean = false) {
group(fullPath: $fullPath) @skip(if: $isProject) {
id
iterations(title: $search, id: $id, includeAncestors: true) {
nodes {
...Iteration
......@@ -9,6 +10,7 @@ query searchIterations($fullPath: ID!, $search: String, $id: ID, $isProject: Boo
}
}
project(fullPath: $fullPath) @include(if: $isProject) {
id
iterations(title: $search, id: $id, includeAncestors: true) {
nodes {
...Iteration
......
mutation createIteration($input: CreateIterationInput!) {
createIteration(input: $input) {
iteration {
id
title
description
descriptionHtml
......
......@@ -7,6 +7,7 @@ fragment IterationIssues on IssueConnection {
...PageInfo
}
nodes {
id
iid
title
webUrl
......
......@@ -8,6 +8,7 @@ fragment IterationIssuesWithLabels on IssueConnection {
...PageInfo
}
nodes {
id
iid
labels {
nodes {
......
......@@ -4,16 +4,19 @@ query onDemandScanCounts(
$finishedScope: PipelineScopeEnum
) {
all: project(fullPath: $fullPath) {
id
pipelines(source: "ondemand_dast_scan") {
count
}
}
running: project(fullPath: $fullPath) {
id
pipelines(source: "ondemand_dast_scan", scope: $runningScope) {
count
}
}
finished: project(fullPath: $fullPath) {
id
pipelines(source: "ondemand_dast_scan", scope: $finishedScope) {
count
}
......
......@@ -9,6 +9,7 @@ query onDemandScans(
$before: String
) {
project(fullPath: $fullPath) {
id
pipelines(
source: "ondemand_dast_scan"
scope: $scope
......@@ -25,14 +26,17 @@ query onDemandScans(
path
createdAt
detailedStatus {
id
detailsPath
text
group
icon
}
dastProfile {
id
name
dastSiteProfile {
id
targetUrl
}
}
......
mutation dastProfileCreate($input: DastProfileCreateInput!) {
dastProfileCreate(input: $input) {
dastProfile {
id
editPath
}
pipelineUrl
......
mutation dastProfileUpdate($input: DastProfileUpdateInput!) {
dastProfileUpdate(input: $input) {
dastProfile {
id
editPath
}
pipelineUrl
......
query getOncallSchedulesWithRotations($projectPath: ID!) {
project(fullPath: $projectPath) {
id
incidentManagementOncallSchedules {
nodes {
iid
......
......@@ -2,9 +2,13 @@
query getShiftsForRotations($projectPath: ID!, $startsAt: Time!, $endsAt: Time!, $iids: [ID!]) {
project(fullPath: $projectPath) {
id
incidentManagementOncallSchedules(iids: $iids) {
nodes {
rotations {
# We have an id in deeply nested fragment
# TODO: Uncomment next line when https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75220 is merged and the rule is enabled
# # eslint-disable-next-line @graphql-eslint/require-id-when-available
nodes {
...OnCallRotationWithShifts
}
......
......@@ -3,6 +3,7 @@ mutation createRequirement($createRequirementInput: CreateRequirementInput!) {
clientMutationId
errors
requirement {
id
iid
}
}
......
......@@ -14,6 +14,7 @@ query projectRequirementsEE(
$sortBy: Sort = CREATED_DESC
) {
project(fullPath: $projectPath) {
id
requirements(
first: $firstPageSize
last: $lastPageSize
......
query projectRequirements($projectPath: ID!) {
project(fullPath: $projectPath) {
id
requirementStatesCount {
opened
archived
......
#import "~/graphql_shared/fragments/author.fragment.graphql"
fragment Requirement on Requirement {
id
iid
title
titleHtml
......
query apiFuzzingCiConfiguration($fullPath: ID!) {
project(fullPath: $fullPath) {
id
apiFuzzingCiConfiguration {
scanModes
scanProfiles {
......
query DastFailedSiteValidations($fullPath: ID!) {
project(fullPath: $fullPath) {
id
validations: dastSiteValidations(status: FAILED_VALIDATION) {
nodes {
id
normalizedTargetUrl
}
}
......
......@@ -2,6 +2,7 @@
query DastProfiles($fullPath: ID!, $after: String, $before: String, $first: Int, $last: Int) {
project(fullPath: $fullPath) {
id
dastProfiles(after: $after, before: $before, first: $first, last: $last) {
pageInfo {
...PageInfo
......
......@@ -8,6 +8,7 @@ query DastScannerProfiles(
$last: Int
) {
project(fullPath: $fullPath) {
id
scannerProfiles: dastScannerProfiles(
after: $after
before: $before
......
......@@ -2,6 +2,7 @@
query DastSiteProfiles($fullPath: ID!, $after: String, $before: String, $first: Int, $last: Int) {
project(fullPath: $fullPath) {
id
siteProfiles: dastSiteProfiles(after: $after, before: $before, first: $first, last: $last)
@connection(key: "dastSiteProfiles") {
pageInfo {
......
query project($fullPath: ID!, $urls: [String!]) {
project(fullPath: $fullPath) {
id
validations: dastSiteValidations(normalizedTargetUrls: $urls) {
nodes {
id
normalizedTargetUrl
status
}
......
......@@ -2,6 +2,7 @@
query sastCiConfiguration($fullPath: ID!) {
project(fullPath: $fullPath) {
id
sastCiConfiguration {
global {
nodes {
......
#import "ee/security_dashboard/graphql/fragments/vulnerability_severities_count.fragment.graphql"
# TODO: Uncomment next line when https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75220 is merged and the rule is enabled
# # eslint-disable-next-line @graphql-eslint/require-id-when-available
fragment ProjectVulnerabilitySeveritiesCount on Project {
vulnerabilitySeveritiesCount(state: [DETECTED, CONFIRMED]) {
...VulnerabilitySeveritiesCount
......
......@@ -12,7 +12,9 @@ fragment VulnerabilityFragment on Vulnerability {
falsePositive @include(if: $vetEnabled)
issueLinks {
nodes {
id
issue {
id
iid
webUrl
webPath
......@@ -29,10 +31,12 @@ fragment VulnerabilityFragment on Vulnerability {
...VulnerabilityLocation
}
project {
id
nameWithNamespace
}
reportType
scanner {
id
vendor
}
}
fragment VulnerabilityScanner on VulnerabilityScanner {
id
externalId
name
reportType
......
query vulnerability($id: VulnerabilityID!) {
vulnerability(id: $id) {
id
state
confirmedAt
detectedAt
......
query groupProjects($fullPath: ID!, $ids: [ID!], $search: String, $pageSize: Int) {
group(fullPath: $fullPath) {
id
projects(includeSubgroups: true, ids: $ids, search: $search, first: $pageSize) {
nodes {
id
......
......@@ -2,6 +2,7 @@
query groupSpecificScanners($fullPath: ID!) {
group(fullPath: $fullPath) {
id
vulnerabilityScanners {
nodes {
...VulnerabilityScanner
......
......@@ -16,6 +16,7 @@ query groupVulnerabilities(
$vetEnabled: Boolean = false
) {
group(fullPath: $fullPath) {
id
vulnerabilities(
after: $after
first: $first
......
......@@ -3,6 +3,7 @@
query groupVulnerabilityGrades($fullPath: ID!) {
group(fullPath: $fullPath) {
id
vulnerabilityGrades(includeSubgroups: true) {
grade
projects {
......
query groupVulnerabilityHistory($fullPath: ID!, $startDate: ISO8601Date!, $endDate: ISO8601Date!) {
group(fullPath: $fullPath) {
id
vulnerabilitiesCountByDay(startDate: $startDate, endDate: $endDate) {
nodes {
date
......
......@@ -13,6 +13,7 @@ query pipelineFindings(
$vetEnabled: Boolean = false
) {
project(fullPath: $fullPath) {
id
pipeline(iid: $pipelineId) {
id
securityReportFindings(
......@@ -35,6 +36,7 @@ query pipelineFindings(
}
reportType
scanner {
id
vendor
}
state
......
......@@ -7,6 +7,7 @@ query pipelineSecuritySummary(
$reportTypes: [SecurityReportTypeEnum!]
) {
project(fullPath: $fullPath) {
id
pipeline(iid: $pipelineIid) {
id
...JobArtifacts
......
query autoFixMrsCount($fullPath: ID!) {
project(fullPath: $fullPath) {
id
mergeRequests(labels: "GitLab-auto-fix", state: opened) {
count
}
......
query securityScanners($fullPath: ID!) {
project(fullPath: $fullPath) {
id
securityScanners {
available
enabled
......
......@@ -2,6 +2,7 @@
query projectSpecificScanners($fullPath: ID!) {
project(fullPath: $fullPath) {
id
vulnerabilityScanners {
nodes {
...VulnerabilityScanner
......
......@@ -17,6 +17,7 @@ query projectVulnerabilities(
$vetEnabled: Boolean = false
) {
project(fullPath: $fullPath) {
id
vulnerabilities(
after: $after
first: $first
......@@ -33,6 +34,7 @@ query projectVulnerabilities(
...VulnerabilityFragment
externalIssueLinks @include(if: $includeExternalIssueLinks) {
nodes {
id
issue: externalIssue {
externalTracker
webUrl
......@@ -43,6 +45,7 @@ query projectVulnerabilities(
}
hasSolutions
mergeRequest {
id
webUrl
state
securityAutoFix
......
......@@ -4,6 +4,7 @@ query projectVulnerabilitiesCount(
$endDate: ISO8601Date!
) {
project(fullPath: $fullPath) {
id
vulnerabilitiesCountByDay(startDate: $startDate, endDate: $endDate) {
nodes {
date
......
......@@ -29,6 +29,7 @@ query vulnerabilitySeveritiesCount(
}
}
group(fullPath: $fullPath) @include(if: $isGroup) {
id
vulnerabilitySeveritiesCount(
projectId: $projectId
severity: $severity
......@@ -43,6 +44,7 @@ query vulnerabilitySeveritiesCount(
}
}
project(fullPath: $fullPath) @include(if: $isProject) {
id
vulnerabilitySeveritiesCount(
severity: $severity
reportType: $reportType
......
query epicAncestors($fullPath: ID!, $iid: ID) {
workspace: group(fullPath: $fullPath) {
__typename
id
issuable: epic(iid: $iid) {
__typename
id
......
......@@ -8,6 +8,7 @@ query issueEpics(
$iidStartsWith: String
) {
workspace: group(fullPath: $fullPath) {
id
attributes: epics(
search: $title
in: $in
......
......@@ -3,6 +3,7 @@
query issueIterationsAliased($fullPath: ID!, $title: String, $state: IterationState) {
workspace: group(fullPath: $fullPath) {
__typename
id
attributes: iterations(title: $title, state: $state) {
nodes {
...IterationFragment
......
query issueHealthStatus($fullPath: ID!, $iid: String) {
workspace: project(fullPath: $fullPath) {
__typename
id
issuable: issue(iid: $iid) {
__typename
id
......
query issueSprint($fullPath: ID!, $iid: String!) {
project(fullPath: $fullPath) {
id
issue(iid: $iid) {
id
iteration {
......
query issueWeight($fullPath: ID!, $iid: String) {
workspace: project(fullPath: $fullPath) {
id
__typename
issuable: issue(iid: $iid) {
__typename
......
......@@ -2,6 +2,7 @@
query issueIterations($fullPath: ID!, $title: String, $state: IterationState) {
group(fullPath: $fullPath) {
id
iterations(title: $title, state: $state) {
nodes {
...IterationFragment
......
......@@ -3,6 +3,7 @@
query projectIssueEpic($fullPath: ID!, $iid: String!) {
workspace: project(fullPath: $fullPath) {
__typename
id
issuable: issue(iid: $iid) {
__typename
id
......
......@@ -3,6 +3,7 @@
query projectIssueIteration($fullPath: ID!, $iid: String!) {
workspace: project(fullPath: $fullPath) {
__typename
id
issuable: issue(iid: $iid) {
__typename
id
......
query getIssueHealthStatus($fullPath: ID!, $iid: String!) {
project(fullPath: $fullPath) {
id
issue(iid: $iid) {
id
healthStatus
}
}
......
......@@ -16,6 +16,7 @@ query projectIssues(
$nextPageCursor: String = ""
) {
project(fullPath: $projectPath) {
id
name
issueStatusCounts(
types: $types
......@@ -40,6 +41,7 @@ query projectIssues(
before: $prevPageCursor
) {
nodes {
id
iid
title
description
......
......@@ -3,6 +3,7 @@ mutation moveTestCase($moveTestCaseInput: IssueMoveInput!) {
errors
clientMutationId
issue {
id
webUrl
}
}
......
......@@ -2,6 +2,7 @@
query projectTestCase($projectPath: ID!, $testCaseId: String) {
project(fullPath: $projectPath) {
id
name
issue(iid: $testCaseId) {
...TestCase
......
......@@ -19,6 +19,7 @@ fragment TestCase on Issue {
confidential
moved
movedTo {
id
webUrl
}
author {
......
query projectTestCaseTaskList($projectPath: ID!, $testCaseId: String) {
project(fullPath: $projectPath) {
__typename
id
issue(iid: $testCaseId) {
__typename
id
......
fragment Environments on NetworkPolicy {
environments {
nodes {
id
name
}
}
......
query getAgentCount($projectPath: ID!) {
project(fullPath: $projectPath) {
id
clusterAgents {
count
}
......
......@@ -2,6 +2,7 @@
query networkPolicies($fullPath: ID!, $environmentId: EnvironmentID) {
project(fullPath: $fullPath) {
id
networkPolicies(environmentId: $environmentId) {
nodes {
name
......
query scanExecutionPolicies($fullPath: ID!) {
project(fullPath: $fullPath) {
id
scanExecutionPolicies {
nodes {
name
......
......@@ -2,6 +2,7 @@
query autoMergeEnabledEE($projectPath: ID!, $iid: String!) {
project(fullPath: $projectPath) {
id
mergeRequest(iid: $iid) {
...autoMergeEnabled
mergeTrainsCount
......
......@@ -4,6 +4,7 @@ query readyToMergeEE($projectPath: ID!, $iid: String!) {
project(fullPath: $projectPath) {
...ReadyToMerge
mergeRequest(iid: $iid) {
id
mergeTrainsCount
}
}
......
......@@ -2,6 +2,7 @@ fragment EpicNode on Epic {
id
iid
group {
id
fullPath
}
title
......
......@@ -2,12 +2,16 @@
query searchEpics($fullPath: ID!, $search: String, $state: EpicState) {
group(fullPath: $fullPath) {
id
epics(
search: $search
state: $state
includeAncestorGroups: true
includeDescendantGroups: false
) {
# We have an id in deeply nested fragment
# TODO: Uncomment next line when https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75220 is merged and the rule is enabled
# # eslint-disable-next-line @graphql-eslint/require-id-when-available
nodes {
...EpicNode
}
......
query getSecurityReportSummary($fullPath: ID!, $pipelineIid: ID!) {
project(fullPath: $fullPath) {
id
pipeline(iid: $pipelineIid) {
id
securityReportSummary {
dast {
scannedResourcesCsvPath
......
......@@ -2,6 +2,7 @@ mutation vulnerabilityExternalIssueLinkCreate($input: VulnerabilityExternalIssue
vulnerabilityExternalIssueLinkCreate(input: $input) {
errors
externalIssueLink {
id
externalIssue {
webUrl
}
......
export const groupReleaseStatsQueryResponse = {
data: {
group: {
id: '1',
stats: {
releaseStats: {
releasesCount: 2811,
......
......@@ -66,7 +66,7 @@ describe('Test coverage table component', () => {
beforeEach(() => {
getProjectsTestCoverageSpy = jest.fn().mockResolvedValue({
data: { group: { projects: { nodes: projects } } },
data: { group: { id: '1', projects: { nodes: projects } } },
});
});
......@@ -118,6 +118,7 @@ describe('Test coverage table component', () => {
getProjectsTestCoverageSpy = jest.fn().mockResolvedValue({
data: {
group: {
id: '1',
projects: {
nodes: [
{
......
......@@ -108,7 +108,9 @@ describe('Codequality report app', () => {
const emptyResponse = {
data: {
project: {
id: '1',
pipeline: {
id: 'pipeline-1',
codeQualityReports: {
...codeQualityViolations,
nodes: [],
......
export const mockDownstreamQueryResponse = {
data: {
project: {
id: '1',
pipeline: {
path: '/root/ci-project/-/pipelines/790',
id: 'pipeline-1',
downstream: {
nodes: [
{
id: 'gid://gitlab/Ci::Pipeline/612',
path: '/root/job-log-sections/-/pipelines/612',
project: { name: 'job-log-sections', __typename: 'Project' },
project: { id: '1', name: 'job-log-sections', __typename: 'Project' },
detailedStatus: {
id: 'status-1',
group: 'success',
icon: 'status_success',
label: 'passed',
......@@ -30,7 +33,9 @@ export const mockDownstreamQueryResponse = {
export const mockUpstreamQueryResponse = {
data: {
project: {
id: '1',
pipeline: {
id: 'pipeline-1',
path: '/root/ci-project/-/pipelines/790',
downstream: {
nodes: [],
......@@ -39,8 +44,9 @@ export const mockUpstreamQueryResponse = {
upstream: {
id: 'gid://gitlab/Ci::Pipeline/610',
path: '/root/trigger-downstream/-/pipelines/610',
project: { name: 'trigger-downstream', __typename: 'Project' },
project: { id: '1', name: 'trigger-downstream', __typename: 'Project' },
detailedStatus: {
id: 'status-1',
group: 'success',
icon: 'status_success',
label: 'passed',
......@@ -57,15 +63,18 @@ export const mockUpstreamQueryResponse = {
export const mockUpstreamDownstreamQueryResponse = {
data: {
project: {
id: '1',
pipeline: {
id: 'pipeline-1',
path: '/root/ci-project/-/pipelines/790',
downstream: {
nodes: [
{
id: 'gid://gitlab/Ci::Pipeline/612',
path: '/root/job-log-sections/-/pipelines/612',
project: { name: 'job-log-sections', __typename: 'Project' },
project: { id: '1', name: 'job-log-sections', __typename: 'Project' },
detailedStatus: {
id: 'status-1',
group: 'success',
icon: 'status_success',
label: 'passed',
......@@ -79,8 +88,9 @@ export const mockUpstreamDownstreamQueryResponse = {
upstream: {
id: 'gid://gitlab/Ci::Pipeline/610',
path: '/root/trigger-downstream/-/pipelines/610',
project: { name: 'trigger-downstream', __typename: 'Project' },
project: { id: '1', name: 'trigger-downstream', __typename: 'Project' },
detailedStatus: {
id: 'status-1',
group: 'success',
icon: 'status_success',
label: 'passed',
......@@ -96,9 +106,11 @@ export const mockUpstreamDownstreamQueryResponse = {
export const mockStages = [
{
id: 'stage-1',
name: 'build',
title: 'build: passed',
status: {
id: 'status-1',
icon: 'status_success',
text: 'passed',
label: 'passed',
......@@ -114,9 +126,11 @@ export const mockStages = [
dropdown_path: '/root/ci-project/-/pipelines/611/stage.json?stage=build',
},
{
id: 'stage-2',
name: 'test',
title: 'test: passed',
status: {
id: 'status-2',
icon: 'status_success',
text: 'passed',
label: 'passed',
......@@ -132,9 +146,11 @@ export const mockStages = [
dropdown_path: '/root/ci-project/-/pipelines/611/stage.json?stage=test',
},
{
id: 'stage-3',
name: 'test_two',
title: 'test_two: passed',
status: {
id: 'status-3',
icon: 'status_success',
text: 'passed',
label: 'passed',
......@@ -150,9 +166,11 @@ export const mockStages = [
dropdown_path: '/root/ci-project/-/pipelines/611/stage.json?stage=test_two',
},
{
id: 'stage-4',
name: 'manual',
title: 'manual: skipped',
status: {
id: 'status-4',
icon: 'status_skipped',
text: 'skipped',
label: 'skipped',
......@@ -164,6 +182,7 @@ export const mockStages = [
favicon:
'/assets/ci_favicons/favicon_status_skipped-0b9c5e543588945e8c4ca57786bbf2d0c56631959c9f853300392d0315be829b.png',
action: {
id: 'action-4',
icon: 'play',
title: 'Play all manual',
path: '/root/ci-project/-/pipelines/611/stages/manual/play_manual',
......@@ -175,9 +194,11 @@ export const mockStages = [
dropdown_path: '/root/ci-project/-/pipelines/611/stage.json?stage=manual',
},
{
id: 'stage-5',
name: 'deploy',
title: 'deploy: passed',
status: {
id: 'status-5',
icon: 'status_success',
text: 'passed',
label: 'passed',
......@@ -193,9 +214,11 @@ export const mockStages = [
dropdown_path: '/root/ci-project/-/pipelines/611/stage.json?stage=deploy',
},
{
id: 'stage-6',
name: 'qa',
title: 'qa: passed',
status: {
id: 'status-6',
icon: 'status_success',
text: 'passed',
label: 'passed',
......
export const getEscalationPoliciesQueryResponse = {
data: {
project: {
id: '1',
incidentManagementEscalationPolicies: {
nodes: [
{
......
......@@ -25,12 +25,14 @@ Object {
"assignees": Array [
Object {
"avatarUrl": null,
"id": "user-2",
"name": "Kushal Pandya",
"webUrl": "https://gitlab-jira.atlassian.net/people/1920938475",
},
],
"author": Object {
"avatarUrl": null,
"id": 0,
"name": "jhope",
"webUrl": "https://gitlab-jira.atlassian.net/people/5e32f803e127810e82875bc1",
},
......@@ -42,6 +44,7 @@ Object {
"labels": Array [
Object {
"color": "#0052CC",
"id": "label-1",
"name": "backend",
"textColor": "#FFFFFF",
"title": "backend",
......@@ -60,6 +63,7 @@ Object {
"assignees": Array [],
"author": Object {
"avatarUrl": null,
"id": 1,
"name": "Gabe Weaver",
"webUrl": "https://gitlab-jira.atlassian.net/people/5e320a31fe03e20c9d1dccde",
},
......@@ -82,6 +86,7 @@ Object {
"assignees": Array [],
"author": Object {
"avatarUrl": null,
"id": 2,
"name": "Gabe Weaver",
"webUrl": "https://gitlab-jira.atlassian.net/people/5e320a31fe03e20c9d1dccde",
},
......
......@@ -29,6 +29,7 @@ export const mockJiraIssue1 = {
status: 'Selected for Development',
labels: [
{
id: 'label-1',
title: 'backend',
name: 'backend',
color: '#0052CC',
......@@ -36,12 +37,14 @@ export const mockJiraIssue1 = {
},
],
author: {
id: 'user-1',
name: 'jhope',
web_url: 'https://gitlab-jira.atlassian.net/people/5e32f803e127810e82875bc1',
avatar_url: null,
},
assignees: [
{
id: 'user-2',
name: 'Kushal Pandya',
web_url: 'https://gitlab-jira.atlassian.net/people/1920938475',
avatar_url: null,
......@@ -64,6 +67,7 @@ export const mockJiraIssue2 = {
status: 'Backlog',
labels: [],
author: {
id: 'user-3',
name: 'Gabe Weaver',
web_url: 'https://gitlab-jira.atlassian.net/people/5e320a31fe03e20c9d1dccde',
avatar_url: null,
......@@ -86,6 +90,7 @@ export const mockJiraIssue3 = {
status: 'Backlog',
labels: [],
author: {
id: 'user-3',
name: 'Gabe Weaver',
web_url: 'https://gitlab-jira.atlassian.net/people/5e320a31fe03e20c9d1dccde',
avatar_url: null,
......@@ -109,6 +114,7 @@ export const mockJiraIssue4 = {
status: 'Backlog',
labels: [],
author: {
id: 'user-3',
name: 'Gabe Weaver',
web_url: 'https://gitlab-jira.atlassian.net/people/5e320a31fe03e20c9d1dccde',
avatar_url: null,
......
......@@ -8,6 +8,7 @@ export const mockZentaoIssue1 = {
status: 'Selected for Development',
labels: [
{
id: 'label-1',
title: 'backend',
name: 'backend',
color: '#0052CC',
......@@ -15,12 +16,14 @@ export const mockZentaoIssue1 = {
},
],
author: {
id: 0,
name: 'jhope',
web_url: 'https://gitlab-zentao.atlassian.net/people/5e32f803e127810e82875bc1',
avatar_url: null,
},
assignees: [
{
id: 'user-2',
name: 'Kushal Pandya',
web_url: 'https://gitlab-zentao.atlassian.net/people/1920938475',
avatar_url: null,
......@@ -40,6 +43,7 @@ export const mockZentaoIssue2 = {
status: 'Backlog',
labels: [],
author: {
id: 1,
name: 'Gabe Weaver',
web_url: 'https://gitlab-zentao.atlassian.net/people/5e320a31fe03e20c9d1dccde',
avatar_url: null,
......@@ -59,6 +63,7 @@ export const mockZentaoIssue3 = {
status: 'Backlog',
labels: [],
author: {
id: 2,
name: 'Gabe Weaver',
web_url: 'https://gitlab-zentao.atlassian.net/people/5e320a31fe03e20c9d1dccde',
avatar_url: null,
......
......@@ -12,6 +12,7 @@ const defaults = {
export const dastScannerProfiles = (profiles = scannerProfiles) => ({
data: {
project: {
id: '1',
scannerProfiles: {
...defaults,
edges: profiles.map((profile) => ({
......@@ -26,6 +27,7 @@ export const dastScannerProfiles = (profiles = scannerProfiles) => ({
export const dastSiteProfiles = (profiles = siteProfiles) => ({
data: {
project: {
id: '1',
siteProfiles: {
...defaults,
edges: profiles.map((profile) => ({
......
......@@ -31,6 +31,7 @@ export const errorMsg = 'Something went wrong';
export const getOncallSchedulesQueryResponse = {
data: {
project: {
id: 'project-1',
incidentManagementOncallSchedules: {
nodes: [
{
......@@ -153,6 +154,7 @@ export const createRotationResponse = {
participants: {
nodes: [
{
id: '50',
user: {
id: 'gid://gitlab/User/50',
username: 'project_1_bot3',
......@@ -192,6 +194,7 @@ export const createRotationResponseWithErrors = {
participants: {
nodes: [
{
id: '50',
user: {
id: 'gid://gitlab/User/50',
username: 'project_1_bot3',
......
......@@ -12,6 +12,7 @@
"participants": {
"nodes": [
{
"id": "49",
"user": {
"id": "gid://gitlab/IncidentManagement::OncallParticipant/49",
"username": "nora.schaden",
......@@ -27,6 +28,7 @@
"nodes": [
{
"participant": {
"id": "1",
"colorWeight": "500",
"colorPalette": "blue",
"user": {
......@@ -41,6 +43,7 @@
},
{
"participant": {
"id": "2",
"colorWeight": "500",
"colorPalette": "orange",
"user": {
......@@ -70,6 +73,7 @@
"participants": {
"nodes": [
{
"id": "99",
"user": {
"id": "gid://gitlab/IncidentManagement::OncallParticipant/99",
"username": "david.oregan",
......@@ -85,6 +89,7 @@
"nodes": [
{
"participant": {
"id": "38",
"colorWeight": "500",
"colorPalette": "aqua",
"user": {
......@@ -99,6 +104,7 @@
},
{
"participant": {
"id": "39",
"colorWeight": "500",
"colorPalette": "green",
"user": {
......@@ -128,6 +134,7 @@
"participants": {
"nodes": [
{
"id": "48",
"user": {
"id": "gid://gitlab/IncidentManagement::OncallParticipant/48",
"username": "root",
......@@ -143,6 +150,7 @@
"nodes": [
{
"participant": {
"id": "40",
"colorWeight": "500",
"colorPalette": "magenta",
"user": {
......@@ -157,6 +165,7 @@
},
{
"participant": {
"id": "41",
"colorWeight": "600",
"colorPalette": "blue",
"user": {
......@@ -186,6 +195,7 @@
"participants": {
"nodes": [
{
"id": "51",
"user": {
"id": "gid://gitlab/IncidentManagement::OncallParticipant/51",
"username": "oregand",
......@@ -201,6 +211,7 @@
"nodes": [
{
"participant": {
"id": "43",
"colorWeight": "600",
"colorPalette": "orange",
"user": {
......@@ -215,6 +226,7 @@
},
{
"participant": {
"id": "44",
"colorWeight": "600",
"colorPalette": "aqua",
"user": {
......
......@@ -158,6 +158,7 @@ describe('On-call schedule wrapper', () => {
getOncallSchedulesQuerySpy = jest.fn().mockResolvedValue({
data: {
project: {
id: 'project-1',
incidentManagementOncallSchedules: {
nodes: [preExistingSchedule, newlyCreatedSchedule],
},
......
......@@ -16,8 +16,9 @@ export const mockLinkedPipelines = ({ hasDownstream = true, hasUpstream = true }
{
id: 'gid://gitlab/Ci::Pipeline/612',
path: '/root/job-log-sections/-/pipelines/612',
project: { name: 'job-log-sections', __typename: 'Project' },
project: { id: '1', name: 'job-log-sections', __typename: 'Project' },
detailedStatus: {
id: 'status-1',
group: 'success',
icon: 'status_success',
label: 'passed',
......@@ -34,8 +35,9 @@ export const mockLinkedPipelines = ({ hasDownstream = true, hasUpstream = true }
upstream = {
id: 'gid://gitlab/Ci::Pipeline/610',
path: '/root/trigger-downstream/-/pipelines/610',
project: { name: 'trigger-downstream', __typename: 'Project' },
project: { id: '1', name: 'trigger-downstream', __typename: 'Project' },
detailedStatus: {
id: 'status-1',
group: 'success',
icon: 'status_success',
label: 'passed',
......@@ -48,7 +50,9 @@ export const mockLinkedPipelines = ({ hasDownstream = true, hasUpstream = true }
return {
data: {
project: {
id: '1',
pipeline: {
id: 'pipeline-1',
path: '/root/ci-project/-/pipelines/790',
downstream,
upstream,
......
......@@ -8,6 +8,7 @@ export const mockUserPermissions = {
};
export const mockAuthor = {
id: 'user-1',
name: 'Administrator',
username: 'root',
avatarUrl: 'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
......@@ -36,6 +37,7 @@ export const mockTestReportMissing = {
};
export const requirement1 = {
id: 'req-1',
iid: '1',
title: 'Virtutis, magnitudinis animi, patientiae, fortitudinis fomentis dolor mitigari solet.',
titleHtml:
......@@ -56,6 +58,7 @@ export const requirement1 = {
};
export const requirement2 = {
id: 'req-2',
iid: '2',
title: 'Est autem officium, quod ita factum est, ut eius facti probabilis ratio reddi possit.',
titleHtml:
......@@ -76,6 +79,7 @@ export const requirement2 = {
};
export const requirement3 = {
id: 'req-3',
iid: '3',
title: 'Non modo carum sibi quemque, verum etiam vehementer carum esse',
titleHtml: 'Non modo carum sibi quemque, verum etiam vehementer carum esse',
......@@ -95,6 +99,7 @@ export const requirement3 = {
};
export const requirementArchived = {
id: 'req-arch',
iid: '23',
title: 'Cuius quidem, quoniam Stoicus fuit',
titleHtml: 'Cuius quidem, quoniam Stoicus fuit',
......@@ -189,6 +194,7 @@ export const mockInitialRequirementCounts = {
export const mockProjectRequirementCounts = {
data: {
project: {
id: '1',
requirementStatesCount: {
opened: mockInitialRequirementCounts.OPENED,
archived: mockInitialRequirementCounts.ARCHIVED,
......@@ -222,6 +228,7 @@ export const mockEmptyTestReportConnection = {
const projectRequirementBase = {
__typename: 'Requirement',
id: 'req-2',
iid: '1',
title: 'Requirement 1',
titleHtml: 'Requirement 1',
......@@ -300,6 +307,7 @@ const mockRequirementConnection = {
export const mockProjectRequirements = {
data: {
project: {
id: '1',
requirements: {
...mockRequirementConnection,
nodes: [{ ...mockProjectRequirementPassed }],
......
export const apiFuzzingConfigurationQueryResponse = {
data: {
project: {
id: '1',
apiFuzzingCiConfiguration: {
scanModes: ['HAR', 'OPENAPI'],
scanProfiles: [
......
export const dastSiteValidations = (nodes = []) => ({
data: {
project: {
id: '1',
validations: {
nodes,
},
......
......@@ -106,9 +106,11 @@ export const savedScans = [
export const failedSiteValidations = [
{
id: '1',
normalizedTargetUrl: 'http://example.com:80',
},
{
id: '2',
normalizedTargetUrl: 'https://example.com:443',
},
];
......@@ -3,6 +3,7 @@ import { makeEntities } from '../helpers';
export const sastCiConfigurationQueryResponse = {
data: {
project: {
id: '1',
sastCiConfiguration: {
global: {
nodes: makeEntities(2, { __typename: 'SastCiConfigurationEntity' }),
......
......@@ -210,6 +210,7 @@ describe('Group Security Dashboard Vulnerabilities Component', () => {
const mockQuery = jest.fn().mockResolvedValue({
data: {
group: {
id: 'group-1',
vulnerabilities: {
nodes: [],
pageInfo: { endCursor: '', hasNextPage: '' },
......
......@@ -4,6 +4,7 @@ export const generateVulnerabilities = () => [
detectedAt: '2020-07-29T15:36:54Z',
hasSolutions: true,
mergeRequest: {
id: 'mr-1',
webUrl: 'www.testmr.com/1',
state: 'status_warning',
securityAutoFix: true,
......@@ -29,16 +30,18 @@ export const generateVulnerabilities = () => [
'registry.gitlab.com/groulot/container-scanning-test/main:5f21de6956aee99ddb68ae49498662d9872f50ff',
},
project: {
id: 'project-1',
nameWithNamespace: 'Administrator / Security reports',
},
scanner: {
id: 'scanner-1',
vendor: 'GitLab',
},
issueLinks: {
nodes: [{ issue: { iid: 15 } }],
nodes: [{ id: 'issue-1', issue: { id: 'issue-1', iid: 15 } }],
},
externalIssueLinks: {
nodes: [{ issue: { iid: 15, externalTracker: 'jira' } }],
nodes: [{ id: 'issue-1', issue: { iid: 15, externalTracker: 'jira' } }],
},
},
{
......@@ -62,9 +65,11 @@ export const generateVulnerabilities = () => [
'/gitlab-org/security-reports2/-/blob/e5c61e4d5d0b8418011171def04ca0aa36532621/src/main/java/com/gitlab/security_products/tests/App.java',
},
project: {
id: 'project-2',
nameWithNamespace: 'Administrator / Vulnerability reports',
},
scanner: {
id: 'scanner-2',
vendor: 'GitLab',
},
},
......@@ -80,9 +85,11 @@ export const generateVulnerabilities = () => [
file: 'src/main/java/com/gitlab/security_products/tests/App.java',
},
project: {
id: 'project-3',
nameWithNamespace: 'Mixed Vulnerabilities / Dependency List Test 01',
},
scanner: {
id: 'scanner-3',
vendor: 'My Custom Scanner',
},
},
......@@ -95,6 +102,7 @@ export const generateVulnerabilities = () => [
file: 'yarn.lock',
},
project: {
id: 'project-4',
nameWithNamespace: 'Mixed Vulnerabilities / Rails App',
},
scanner: {},
......@@ -106,6 +114,7 @@ export const generateVulnerabilities = () => [
state: 'DISMISSED',
location: {},
project: {
id: 'project-5',
nameWithNamespace: 'Administrator / Security reports',
},
scanner: {},
......@@ -119,6 +128,7 @@ export const generateVulnerabilities = () => [
path: '/v1/trees',
},
project: {
id: 'project-6',
nameWithNamespace: 'Administrator / Security reports',
},
scanner: {},
......
......@@ -3,6 +3,7 @@ import { merge } from 'lodash';
export const pipelineSecurityReportSummary = {
data: {
project: {
id: 'project-1',
pipeline: {
id: 'gid://gitlab/Ci::Pipeline/99',
securityReportSummary: {
......@@ -69,6 +70,7 @@ export const pipelineSecurityReportSummary = {
jobs: {
nodes: [
{
id: 'job-1',
name: 'api_fuzzing',
artifacts: {
nodes: [
......@@ -86,6 +88,7 @@ export const pipelineSecurityReportSummary = {
},
},
{
id: 'job-2',
name: 'coverage_fuzzing',
artifacts: {
nodes: [
......@@ -103,6 +106,7 @@ export const pipelineSecurityReportSummary = {
},
},
{
id: 'job-3',
name: 'sast-tslint',
artifacts: {
nodes: [
......@@ -120,6 +124,7 @@ export const pipelineSecurityReportSummary = {
},
},
{
id: 'job-4',
name: 'sast-spotbugs',
artifacts: {
nodes: [
......@@ -137,6 +142,7 @@ export const pipelineSecurityReportSummary = {
},
},
{
id: 'job-5',
name: 'sast-sobelow',
artifacts: {
nodes: [
......@@ -154,6 +160,7 @@ export const pipelineSecurityReportSummary = {
},
},
{
id: 'job-6',
name: 'sast-pmd-apex',
artifacts: {
nodes: [
......@@ -171,6 +178,7 @@ export const pipelineSecurityReportSummary = {
},
},
{
id: 'job-7',
name: 'sast-eslint',
artifacts: {
nodes: [
......@@ -188,6 +196,7 @@ export const pipelineSecurityReportSummary = {
},
},
{
id: 'job-8',
name: 'secrets',
artifacts: {
nodes: [
......@@ -216,7 +225,9 @@ export const scansWithErrors = [{ errors: ['error description'], name: 'scan-nam
export const pipelineSecurityReportSummaryWithErrors = merge({}, pipelineSecurityReportSummary, {
data: {
project: {
id: 'project-1',
pipeline: {
id: 'pipeline-1',
securityReportSummary: {
dast: {
scans: {
......@@ -232,7 +243,9 @@ export const pipelineSecurityReportSummaryWithErrors = merge({}, pipelineSecurit
export const pipelineSecurityReportSummaryEmpty = merge({}, pipelineSecurityReportSummary, {
data: {
project: {
id: 'project-1',
pipeline: {
id: 'pipeline-1',
securityReportSummary: null,
},
},
......
......@@ -50,6 +50,7 @@ describe('Vulnerabilities app component', () => {
} = {}) => ({
data: {
project: {
id: 'project-1',
securityScanners: { available, enabled, pipelineRun },
},
},
......
......@@ -25,6 +25,7 @@ const getCountsRequestHandler = ({
return jest.fn().mockResolvedValue({
data: {
[dashboardType]: {
id: '1',
vulnerabilitySeveritiesCount: data,
},
},
......
......@@ -20,6 +20,7 @@ const createVulnerabilitiesRequestHandler = ({ hasNextPage }) =>
jest.fn().mockResolvedValue({
data: {
group: {
id: 'group-1',
vulnerabilities: {
nodes: [],
pageInfo: { endCursor: 'abc', hasNextPage },
......
......@@ -171,7 +171,9 @@ describe('Vulnerability Report', () => {
apolloProvider: createApolloProvider([
[
groupProjectsQuery,
jest.fn().mockResolvedValue({ data: { group: { projects: { nodes: [] } } } }),
jest
.fn()
.mockResolvedValue({ data: { group: { id: 'group-1', projects: { nodes: [] } } } }),
],
]),
});
......
......@@ -106,6 +106,7 @@ const vulnerabilityGrades = [
export const mockGroupVulnerabilityGrades = () => ({
data: {
group: {
id: 'group-1',
vulnerabilityGrades,
},
},
......@@ -132,6 +133,7 @@ export const mockProjectSecurityChartsWithoutData = () => ({
export const mockProjectSecurityChartsWithData = () => ({
data: {
project: {
id: 'project-1',
vulnerabilitiesCountByDay: {
nodes: [
{
......@@ -213,6 +215,7 @@ export const mockVulnerableProjectsInstance = () => ({
export const mockVulnerableProjectsGroup = () => ({
data: {
group: {
id: 'group-1',
projects: {
nodes: [
{
......@@ -228,6 +231,7 @@ export const mockVulnerableProjectsGroup = () => ({
export const mockVulnerabilitySeveritiesGraphQLResponse = ({ dashboardType }) => ({
data: {
[dashboardType]: {
id: '1',
vulnerabilitySeveritiesCount: {
__typename: 'VulnerabilitySeveritiesCount',
critical: 0,
......@@ -247,6 +251,7 @@ export const mockVulnerabilitySeveritiesGraphQLResponse = ({ dashboardType }) =>
export const mockPipelineFindingsResponse = ({ hasNextPage } = {}) => ({
data: {
project: {
id: 'project-1',
pipeline: {
id: 'gid://gitlab/Ci::Pipeline/59',
securityReportFindings: {
......
......@@ -66,6 +66,7 @@ describe('IterationDropdown', () => {
groupIterationsSpy = jest.fn().mockResolvedValue({
data: {
group: {
id: '1',
iterations: {
nodes: TEST_ITERATIONS,
},
......
......@@ -14,6 +14,7 @@ export const getHealthStatusQueryResponse = ({ state = 'opened', healthStatus =
return {
data: {
workspace: {
id: '1',
issuable: { id: 'gid://gitlab/Issue/1', state, healthStatus, __typename: 'Issue' },
__typename: 'Project',
},
......
......@@ -44,6 +44,7 @@ export const mockEpic2 = {
export const mockGroupIterationsResponse = {
data: {
workspace: {
id: '1',
iterations: {
nodes: [mockIteration1, mockIteration2],
},
......@@ -56,6 +57,7 @@ export const mockGroupIterationsResponse = {
export const mockGroupEpicsResponse = {
data: {
workspace: {
id: '1',
attributes: {
nodes: [mockEpic1, mockEpic2],
},
......@@ -68,6 +70,7 @@ export const mockGroupEpicsResponse = {
export const emptyGroupIterationsResponse = {
data: {
workspace: {
id: '1',
iterations: {
nodes: [],
},
......@@ -80,6 +83,7 @@ export const emptyGroupIterationsResponse = {
export const emptyGroupEpicsResponse = {
data: {
workspace: {
id: '1',
attributes: {
nodes: [],
},
......@@ -92,6 +96,7 @@ export const emptyGroupEpicsResponse = {
export const noCurrentIterationResponse = {
data: {
workspace: {
id: '1',
issuable: { id: mockIssueId, iteration: null, __typename: 'Issue' },
__typename: 'Project',
},
......@@ -101,6 +106,7 @@ export const noCurrentIterationResponse = {
export const noCurrentEpicResponse = {
data: {
workspace: {
id: '1',
issuable: { id: mockIssueId, attribute: null, __typename: 'Issue' },
__typename: 'Project',
},
......@@ -148,6 +154,7 @@ export const mockEpicMutationResponse = {
export const epicAncestorsResponse = () => ({
data: {
workspace: {
id: '1',
__typename: 'Group',
issuable: {
__typename: 'Epic',
......@@ -170,6 +177,7 @@ export const epicAncestorsResponse = () => ({
export const issueNoWeightResponse = () => ({
data: {
workspace: {
id: '1',
issuable: { id: mockIssueId, weight: null, __typename: 'Issue' },
__typename: 'Project',
},
......@@ -179,6 +187,7 @@ export const issueNoWeightResponse = () => ({
export const issueWeightResponse = () => ({
data: {
workspace: {
id: '1',
issuable: { id: mockIssueId, weight: 0, __typename: 'Issue' },
__typename: 'Project',
},
......
......@@ -14,7 +14,7 @@ describe('PolicyAlertPicker component', () => {
const createMockApolloProvider = ({ agentCount }) => {
const getAgentCountHandler = jest
.fn()
.mockResolvedValue({ data: { project: { clusterAgents: { count: agentCount } } } });
.mockResolvedValue({ data: { project: { id: '1', clusterAgents: { count: agentCount } } } });
return createMockApollo([[getAgentCount, getAgentCountHandler]]);
};
......
import { mockAlertDetails, mockAlerts, mockPageInfo } from './mock_data';
export const getAlertsQuerySpy = jest.fn().mockResolvedValue({
data: { project: { alertManagementAlerts: { nodes: mockAlerts, pageInfo: mockPageInfo } } },
data: {
project: { id: '1', alertManagementAlerts: { nodes: mockAlerts, pageInfo: mockPageInfo } },
},
});
export const emptyGetAlertsQuerySpy = jest.fn().mockResolvedValue({
data: {
project: {
id: '1',
alertManagementAlerts: {
nodes: [],
pageInfo: { endCursor: '', hasNextPage: false, hasPreviousPage: false, startCursor: '' },
......@@ -20,7 +23,7 @@ export const loadingQuerySpy = jest.fn().mockReturnValue(new Promise(() => {}));
export const apolloFailureResponse = jest.fn().mockRejectedValue();
export const getAlertDetailsQuerySpy = jest.fn().mockResolvedValue({
data: { project: { alertManagementAlerts: { nodes: [mockAlertDetails] } } },
data: { project: { id: '1', alertManagementAlerts: { nodes: [mockAlertDetails] } } },
});
export const getAlertDetailsQueryErrorMessage =
......@@ -34,6 +37,7 @@ export const networkPolicies = (nodes) =>
jest.fn().mockResolvedValue({
data: {
project: {
id: '1',
networkPolicies: {
nodes,
},
......@@ -45,6 +49,7 @@ export const scanExecutionPolicies = (nodes) =>
jest.fn().mockResolvedValue({
data: {
project: {
id: '3',
scanExecutionPolicies: {
nodes,
},
......
......@@ -186,7 +186,7 @@ export const mockNetworkPoliciesResponse = [
fromAutoDevops: false,
updatedAt: '2021-06-08T04:01:11Z',
environments: {
nodes: [{ name: 'production', __typename: 'Environment' }],
nodes: [{ id: 'env-1', name: 'production', __typename: 'Environment' }],
},
},
];
......@@ -251,7 +251,13 @@ export const mockAlerts = [
status: 'TRIGGERED',
startedAt: '2020-11-19T18:36:23Z',
eventCount: '1',
issue: { iid: '5', state: 'opened', title: 'Issue 01', webUrl: 'http://test.com/05' },
issue: {
id: 'issue-1',
iid: '5',
state: 'opened',
title: 'Issue 01',
webUrl: 'http://test.com/05',
},
assignees: {
nodes: [
{
......@@ -271,7 +277,13 @@ export const mockAlerts = [
status: 'ACKNOWLEDGED',
startedAt: '2020-11-16T21:59:28Z',
eventCount: '2',
issue: { iid: '6', state: 'closed', title: 'Issue 02', webUrl: 'http://test.com/06' },
issue: {
id: 'issue-2',
iid: '6',
state: 'closed',
title: 'Issue 02',
webUrl: 'http://test.com/06',
},
assignees: { nodes: [] },
},
{
......
......@@ -27,7 +27,7 @@ const MINUTES = {
};
const issueStateResponse = (state = 'opened') => ({
data: { project: { issue: { state, id: '1' } } },
data: { project: { id: 'project-1', issue: { state, id: '1' } } },
});
describe('Service Level Agreement', () => {
......
......@@ -3,6 +3,7 @@ export const vulnerabilityExternalIssueLinkCreateMockFactory = ({ errors = [] }
vulnerabilityExternalIssueLinkCreate: {
errors,
externalIssueLink: {
id: '1',
externalIssue: {
webUrl: 'http://foo.bar',
},
......
......@@ -34,6 +34,7 @@ export const updatePrometheusVariables = {
export const getIntegrationsQueryResponse = {
data: {
project: {
id: '1',
alertManagementIntegrations: {
nodes: [
{
......
......@@ -13,6 +13,7 @@ localVue.use(VueApollo);
const keepLatestArtifactProjectMock = {
data: {
project: {
id: '1',
ciCdSettings: { keepLatestArtifact: true },
},
},
......
......@@ -27,6 +27,7 @@ describe('ClusterAgentShow', () => {
id: '1',
createdAt: '2021-02-13T00:00:00Z',
createdByUser: {
id: 'user-1',
name: 'user-1',
},
name: 'token-1',
......@@ -39,7 +40,8 @@ describe('ClusterAgentShow', () => {
const createWrapper = ({ clusterAgent, queryResponse = null }) => {
const agentQueryResponse =
queryResponse || jest.fn().mockResolvedValue({ data: { project: { clusterAgent } } });
queryResponse ||
jest.fn().mockResolvedValue({ data: { project: { id: 'project-1', clusterAgent } } });
const apolloProvider = createMockApollo([[getAgentQuery, agentQueryResponse]]);
wrapper = extendedWrapper(
......
......@@ -26,6 +26,7 @@ describe('Agents', () => {
const apolloQueryResponse = {
data: {
project: {
id: '1',
clusterAgents: { nodes: agents, pageInfo, tokens: { nodes: [] }, count },
repository: { tree: { trees: { nodes: trees, pageInfo } } },
},
......@@ -75,6 +76,7 @@ describe('Agents', () => {
tokens: {
nodes: [
{
id: 'token-1',
lastUsedAt: testDate,
},
],
......@@ -86,6 +88,7 @@ describe('Agents', () => {
const trees = [
{
id: 'tree-1',
name: 'agent-2',
path: '.gitlab/agents/agent-2',
webPath: '/project/path/.gitlab/agents/agent-2',
......
......@@ -39,6 +39,7 @@ describe('InstallAgentModal', () => {
const apolloQueryResponse = {
data: {
project: {
id: '1',
clusterAgents: { nodes: [] },
agentConfigurations: { nodes: configurations },
},
......
......@@ -65,6 +65,7 @@ export const createAgentTokenErrorResponse = {
export const getAgentResponse = {
data: {
project: {
id: 'project-1',
clusterAgents: { nodes: [{ ...agent, tokens }], pageInfo, count },
repository: {
tree: {
......
......@@ -5,6 +5,7 @@ export const designListQueryResponse = {
id: '1',
issue: {
__typename: 'Issue',
id: 'issue-1',
designCollection: {
__typename: 'DesignCollection',
copyState: 'READY',
......@@ -97,6 +98,7 @@ export const permissionsQueryResponse = {
id: '1',
issue: {
__typename: 'Issue',
id: 'issue-1',
userPermissions: { __typename: 'UserPermissions', createDesign: true },
},
},
......
......@@ -643,6 +643,7 @@ describe('CE IssuesListApp component', () => {
const response = (isProject = true) => ({
data: {
[isProject ? 'project' : 'group']: {
id: '1',
issues: {
...defaultQueryResponse.data.project.issues,
nodes: [issueOne, issueTwo, issueThree, issueFour],
......
......@@ -6,6 +6,7 @@ import {
export const getIssuesQueryResponse = {
data: {
project: {
id: '1',
issues: {
pageInfo: {
hasNextPage: true,
......@@ -75,6 +76,7 @@ export const getIssuesQueryResponse = {
export const getIssuesCountsQueryResponse = {
data: {
project: {
id: '1',
openedIssues: {
count: 1,
},
......@@ -288,6 +290,7 @@ export const project3 = {
export const searchProjectsQueryResponse = {
data: {
group: {
id: '1',
projects: {
nodes: [project1, project2, project3],
},
......@@ -298,6 +301,7 @@ export const searchProjectsQueryResponse = {
export const emptySearchProjectsQueryResponse = {
data: {
group: {
id: '1',
projects: {
nodes: [],
},
......
......@@ -1474,6 +1474,7 @@ export const mockJobsInTable = [
export const mockJobsQueryResponse = {
data: {
project: {
id: '1',
jobs: {
pageInfo: {
endCursor: 'eyJpZCI6IjIzMTcifQ',
......@@ -1509,6 +1510,7 @@ export const mockJobsQueryResponse = {
triggered: null,
createdByTag: false,
detailedStatus: {
id: 'status-1',
detailsPath: '/root/ci-project/-/jobs/2336',
group: 'success',
icon: 'status_success',
......@@ -1516,6 +1518,7 @@ export const mockJobsQueryResponse = {
text: 'passed',
tooltip: 'passed',
action: {
id: 'action-1',
buttonTitle: 'Retry this job',
icon: 'retry',
method: 'post',
......@@ -1535,6 +1538,7 @@ export const mockJobsQueryResponse = {
id: 'gid://gitlab/Ci::Pipeline/473',
path: '/root/ci-project/-/pipelines/473',
user: {
id: 'user-1',
webPath: '/root',
avatarUrl:
'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
......@@ -1543,6 +1547,7 @@ export const mockJobsQueryResponse = {
__typename: 'Pipeline',
},
stage: {
id: 'stage-1',
name: 'deploy',
__typename: 'CiStage',
},
......@@ -1573,6 +1578,7 @@ export const mockJobsQueryResponse = {
export const mockJobsQueryEmptyResponse = {
data: {
project: {
id: '1',
jobs: [],
},
},
......
......@@ -37,6 +37,7 @@ export const graphQLImageListMock = {
data: {
project: {
__typename: 'Project',
id: '1',
containerRepositoriesCount: 2,
containerRepositories: {
__typename: 'ContainerRepositoryConnection',
......@@ -51,6 +52,7 @@ export const graphQLEmptyImageListMock = {
data: {
project: {
__typename: 'Project',
id: '1',
containerRepositoriesCount: 2,
containerRepositories: {
__typename: 'ContainerRepositoryConnection',
......@@ -65,6 +67,7 @@ export const graphQLEmptyGroupImageListMock = {
data: {
group: {
__typename: 'Group',
id: '1',
containerRepositoriesCount: 2,
containerRepositories: {
__typename: 'ContainerRepositoryConnection',
......@@ -120,6 +123,7 @@ export const containerRepositoryMock = {
project: {
visibility: 'public',
path: 'gitlab-test',
id: '1',
containerExpirationPolicy: {
enabled: false,
nextRunAt: '2020-11-27T08:59:27Z',
......@@ -243,6 +247,7 @@ export const dockerCommands = {
export const graphQLProjectImageRepositoriesDetailsMock = {
data: {
project: {
id: '1',
containerRepositories: {
nodes: [
{
......
......@@ -8,8 +8,8 @@ export const proxyData = () => ({
export const proxySettings = (extend = {}) => ({ enabled: true, ...extend });
export const proxyManifests = () => [
{ createdAt: '2021-09-22T09:45:28Z', imageName: 'alpine:latest' },
{ createdAt: '2021-09-21T09:45:28Z', imageName: 'alpine:stable' },
{ id: 'proxy-1', createdAt: '2021-09-22T09:45:28Z', imageName: 'alpine:latest' },
{ id: 'proxy-2', createdAt: '2021-09-21T09:45:28Z', imageName: 'alpine:stable' },
];
export const pagination = (extend) => ({
......@@ -26,6 +26,7 @@ export const proxyDetailsQuery = ({ extendSettings = {}, extend } = {}) => ({
group: {
...proxyData(),
__typename: 'Group',
id: '1',
dependencyProxySetting: {
...proxySettings(extendSettings),
__typename: 'DependencyProxySetting',
......
......@@ -16,11 +16,13 @@ export const packagePipelines = (extend) => [
ref: 'master',
sha: 'b83d6e391c22777fca1ed3012fce84f633d7fed0',
project: {
id: '1',
name: 'project14',
webUrl: 'http://gdk.test:3000/namespace14/project14',
__typename: 'Project',
},
user: {
id: 'user-1',
name: 'Administrator',
},
...extend,
......@@ -89,6 +91,7 @@ export const dependencyLinks = () => [
];
export const packageProject = () => ({
id: '1',
fullPath: 'gitlab-org/gitlab-test',
webUrl: 'http://gdk.test:3000/gitlab-org/gitlab-test',
__typename: 'Project',
......@@ -127,6 +130,7 @@ export const packageData = (extend) => ({
});
export const conanMetadata = () => ({
id: 'conan-1',
packageChannel: 'stable',
packageUsername: 'gitlab-org+gitlab-test',
recipe: 'package-8/1.0.0@gitlab-org+gitlab-test/stable',
......@@ -179,6 +183,7 @@ export const packageDetailsQuery = (extendPackage) => ({
...nugetMetadata(),
},
project: {
id: '1',
path: 'projectPath',
},
tags: {
......@@ -270,6 +275,7 @@ export const packageDestroyFileMutationError = () => ({
export const packagesListQuery = ({ type = 'group', extend = {}, extendPagination = {} } = {}) => ({
data: {
[type]: {
id: '1',
packages: {
count: 2,
nodes: [
......
......@@ -13,6 +13,7 @@ export const dependencyProxySettings = (extend) => ({
export const groupPackageSettingsMock = {
data: {
group: {
id: '1',
fullPath: 'foo_group_path',
packageSettings: packageSettings(),
dependencyProxySetting: dependencyProxySettings(),
......
......@@ -11,6 +11,7 @@ export const containerExpirationPolicyData = () => ({
export const expirationPolicyPayload = (override) => ({
data: {
project: {
id: '1',
containerExpirationPolicy: {
...containerExpirationPolicyData(),
...override,
......
......@@ -136,7 +136,7 @@ describe('Pipeline Status', () => {
describe('when pipeline is null', () => {
beforeEach(() => {
mockPipelineQuery.mockResolvedValue({
data: { project: { pipeline: null } },
data: { project: { id: '1', pipeline: null } },
});
createComponentWithApollo();
......
......@@ -39,6 +39,7 @@ job_build:
export const mockCiTemplateQueryResponse = {
data: {
project: {
id: 'project-1',
ciTemplate: {
content: mockCiYml,
},
......@@ -48,19 +49,22 @@ export const mockCiTemplateQueryResponse = {
export const mockBlobContentQueryResponse = {
data: {
project: { repository: { blobs: { nodes: [{ rawBlob: mockCiYml }] } } },
project: {
id: 'project-1',
repository: { blobs: { nodes: [{ id: 'blob-1', rawBlob: mockCiYml }] } },
},
},
};
export const mockBlobContentQueryResponseNoCiFile = {
data: {
project: { repository: { blobs: { nodes: [] } } },
project: { id: 'project-1', repository: { blobs: { nodes: [] } } },
},
};
export const mockBlobContentQueryResponseEmptyCiFile = {
data: {
project: { repository: { blobs: { nodes: [{ rawBlob: '' }] } } },
project: { id: 'project-1', repository: { blobs: { nodes: [{ rawBlob: '' }] } } },
},
};
......@@ -93,6 +97,7 @@ export const mockCiConfigQueryResponse = {
groups: {
nodes: [
{
id: 'group-1',
name: 'job_test_1',
size: 1,
jobs: {
......@@ -108,6 +113,7 @@ export const mockCiConfigQueryResponse = {
__typename: 'CiConfigGroup',
},
{
id: 'group-2',
name: 'job_test_2',
size: 1,
jobs: {
......@@ -170,9 +176,11 @@ export const mergeUnwrappedCiConfig = (mergedConfig) => {
export const mockCommitShaResults = {
data: {
project: {
id: '1',
repository: {
tree: {
lastCommit: {
id: 'commit-1',
sha: mockCommitSha,
},
},
......@@ -184,9 +192,11 @@ export const mockCommitShaResults = {
export const mockNewCommitShaResults = {
data: {
project: {
id: '1',
repository: {
tree: {
lastCommit: {
id: 'commit-1',
sha: 'eeff1122',
},
},
......@@ -198,9 +208,11 @@ export const mockNewCommitShaResults = {
export const mockEmptyCommitShaResults = {
data: {
project: {
id: '1',
repository: {
tree: {
lastCommit: {
id: 'commit-1',
sha: '',
},
},
......@@ -212,6 +224,7 @@ export const mockEmptyCommitShaResults = {
export const mockProjectBranches = {
data: {
project: {
id: '1',
repository: {
branchNames: [
'main',
......@@ -236,6 +249,7 @@ export const mockTotalBranchResults =
export const mockSearchBranches = {
data: {
project: {
id: '1',
repository: {
branchNames: ['test', 'better-feature', 'update-ci', 'test-merge-request'],
},
......@@ -248,6 +262,7 @@ export const mockTotalSearchResults = mockSearchBranches.data.project.repository
export const mockEmptySearchBranches = {
data: {
project: {
id: '1',
repository: {
branchNames: [],
},
......@@ -284,16 +299,19 @@ export const mockProjectPipeline = ({ hasStages = true } = {}) => {
: null;
return {
id: '1',
pipeline: {
id: 'gid://gitlab/Ci::Pipeline/118',
iid: '28',
shortSha: mockCommitSha,
status: 'SUCCESS',
commit: {
id: 'commit-1',
title: 'Update .gitlabe-ci.yml',
webPath: '/-/commit/aabbccdd',
},
detailedStatus: {
id: 'status-1',
detailsPath: '/root/sample-ci-project/-/pipelines/118',
group: 'success',
icon: 'status_success',
......@@ -461,6 +479,7 @@ export const mockCommitCreateResponse = {
errors: [],
commit: {
__typename: 'Commit',
id: 'commit-1',
sha: mockCommitNextSha,
},
commitPipelinePath: '',
......@@ -475,6 +494,7 @@ export const mockCommitCreateResponseNewEtag = {
errors: [],
commit: {
__typename: 'Commit',
id: 'commit-2',
sha: mockCommitNextSha,
},
commitPipelinePath: '/api/graphql:pipelines/sha/550ceace1acd373c84d02bd539cb9d4614f786db',
......
......@@ -6,9 +6,11 @@ Array [
"groups": Array [
Object {
"__typename": "CiGroup",
"id": "4",
"jobs": Array [
Object {
"__typename": "CiJob",
"id": "6",
"name": "build_a_nlfjkdnlvskfnksvjknlfdjvlvnjdkjdf_nvjkenjkrlngjeknjkl",
"needs": Array [],
"scheduledAt": null,
......@@ -18,6 +20,7 @@ Array [
"__typename": "StatusAction",
"buttonTitle": "Retry this job",
"icon": "retry",
"id": "8",
"path": "/root/abcd-dag/-/jobs/1482/retry",
"title": "Retry",
},
......@@ -25,6 +28,7 @@ Array [
"group": "success",
"hasDetails": true,
"icon": "status_success",
"id": "7",
"tooltip": "passed",
},
},
......@@ -36,14 +40,17 @@ Array [
"__typename": "DetailedStatus",
"group": "success",
"icon": "status_success",
"id": "5",
"label": "passed",
},
},
Object {
"__typename": "CiGroup",
"id": "9",
"jobs": Array [
Object {
"__typename": "CiJob",
"id": "11",
"name": "build_b",
"needs": Array [],
"scheduledAt": null,
......@@ -53,6 +60,7 @@ Array [
"__typename": "StatusAction",
"buttonTitle": "Retry this job",
"icon": "retry",
"id": "13",
"path": "/root/abcd-dag/-/jobs/1515/retry",
"title": "Retry",
},
......@@ -60,6 +68,7 @@ Array [
"group": "success",
"hasDetails": true,
"icon": "status_success",
"id": "12",
"tooltip": "passed",
},
},
......@@ -71,14 +80,17 @@ Array [
"__typename": "DetailedStatus",
"group": "success",
"icon": "status_success",
"id": "10",
"label": "passed",
},
},
Object {
"__typename": "CiGroup",
"id": "14",
"jobs": Array [
Object {
"__typename": "CiJob",
"id": "16",
"name": "build_c",
"needs": Array [],
"scheduledAt": null,
......@@ -88,6 +100,7 @@ Array [
"__typename": "StatusAction",
"buttonTitle": "Retry this job",
"icon": "retry",
"id": "18",
"path": "/root/abcd-dag/-/jobs/1484/retry",
"title": "Retry",
},
......@@ -95,6 +108,7 @@ Array [
"group": "success",
"hasDetails": true,
"icon": "status_success",
"id": "17",
"tooltip": "passed",
},
},
......@@ -106,14 +120,17 @@ Array [
"__typename": "DetailedStatus",
"group": "success",
"icon": "status_success",
"id": "15",
"label": "passed",
},
},
Object {
"__typename": "CiGroup",
"id": "19",
"jobs": Array [
Object {
"__typename": "CiJob",
"id": "21",
"name": "build_d 1/3",
"needs": Array [],
"scheduledAt": null,
......@@ -123,6 +140,7 @@ Array [
"__typename": "StatusAction",
"buttonTitle": "Retry this job",
"icon": "retry",
"id": "23",
"path": "/root/abcd-dag/-/jobs/1485/retry",
"title": "Retry",
},
......@@ -130,11 +148,13 @@ Array [
"group": "success",
"hasDetails": true,
"icon": "status_success",
"id": "22",
"tooltip": "passed",
},
},
Object {
"__typename": "CiJob",
"id": "24",
"name": "build_d 2/3",
"needs": Array [],
"scheduledAt": null,
......@@ -144,6 +164,7 @@ Array [
"__typename": "StatusAction",
"buttonTitle": "Retry this job",
"icon": "retry",
"id": "26",
"path": "/root/abcd-dag/-/jobs/1486/retry",
"title": "Retry",
},
......@@ -151,11 +172,13 @@ Array [
"group": "success",
"hasDetails": true,
"icon": "status_success",
"id": "25",
"tooltip": "passed",
},
},
Object {
"__typename": "CiJob",
"id": "27",
"name": "build_d 3/3",
"needs": Array [],
"scheduledAt": null,
......@@ -165,6 +188,7 @@ Array [
"__typename": "StatusAction",
"buttonTitle": "Retry this job",
"icon": "retry",
"id": "29",
"path": "/root/abcd-dag/-/jobs/1487/retry",
"title": "Retry",
},
......@@ -172,6 +196,7 @@ Array [
"group": "success",
"hasDetails": true,
"icon": "status_success",
"id": "28",
"tooltip": "passed",
},
},
......@@ -183,14 +208,17 @@ Array [
"__typename": "DetailedStatus",
"group": "success",
"icon": "status_success",
"id": "20",
"label": "passed",
},
},
Object {
"__typename": "CiGroup",
"id": "57",
"jobs": Array [
Object {
"__typename": "CiJob",
"id": "59",
"name": "test_c",
"needs": Array [],
"scheduledAt": null,
......@@ -201,6 +229,7 @@ Array [
"group": "success",
"hasDetails": true,
"icon": "status_success",
"id": "60",
"tooltip": null,
},
},
......@@ -212,6 +241,7 @@ Array [
"__typename": "DetailedStatus",
"group": "success",
"icon": "status_success",
"id": "58",
"label": null,
},
},
......@@ -226,9 +256,11 @@ Array [
"groups": Array [
Object {
"__typename": "CiGroup",
"id": "32",
"jobs": Array [
Object {
"__typename": "CiJob",
"id": "34",
"name": "test_a",
"needs": Array [
"build_c",
......@@ -242,6 +274,7 @@ Array [
"__typename": "StatusAction",
"buttonTitle": "Retry this job",
"icon": "retry",
"id": "36",
"path": "/root/abcd-dag/-/jobs/1514/retry",
"title": "Retry",
},
......@@ -249,6 +282,7 @@ Array [
"group": "success",
"hasDetails": true,
"icon": "status_success",
"id": "35",
"tooltip": "passed",
},
},
......@@ -260,14 +294,17 @@ Array [
"__typename": "DetailedStatus",
"group": "success",
"icon": "status_success",
"id": "33",
"label": "passed",
},
},
Object {
"__typename": "CiGroup",
"id": "40",
"jobs": Array [
Object {
"__typename": "CiJob",
"id": "42",
"name": "test_b 1/2",
"needs": Array [
"build_d 3/3",
......@@ -283,6 +320,7 @@ Array [
"__typename": "StatusAction",
"buttonTitle": "Retry this job",
"icon": "retry",
"id": "44",
"path": "/root/abcd-dag/-/jobs/1489/retry",
"title": "Retry",
},
......@@ -290,11 +328,13 @@ Array [
"group": "success",
"hasDetails": true,
"icon": "status_success",
"id": "43",
"tooltip": "passed",
},
},
Object {
"__typename": "CiJob",
"id": "67",
"name": "test_b 2/2",
"needs": Array [
"build_d 3/3",
......@@ -310,6 +350,7 @@ Array [
"__typename": "StatusAction",
"buttonTitle": "Retry this job",
"icon": "retry",
"id": "51",
"path": "/root/abcd-dag/-/jobs/1490/retry",
"title": "Retry",
},
......@@ -317,6 +358,7 @@ Array [
"group": "success",
"hasDetails": true,
"icon": "status_success",
"id": "50",
"tooltip": "passed",
},
},
......@@ -328,14 +370,17 @@ Array [
"__typename": "DetailedStatus",
"group": "success",
"icon": "status_success",
"id": "41",
"label": "passed",
},
},
Object {
"__typename": "CiGroup",
"id": "61",
"jobs": Array [
Object {
"__typename": "CiJob",
"id": "53",
"name": "test_d",
"needs": Array [
"build_b",
......@@ -348,6 +393,7 @@ Array [
"group": "success",
"hasDetails": true,
"icon": "status_success",
"id": "64",
"tooltip": null,
},
},
......@@ -359,6 +405,7 @@ Array [
"__typename": "DetailedStatus",
"group": "success",
"icon": "status_success",
"id": "62",
"label": null,
},
},
......
......@@ -4,6 +4,7 @@ export const mockPipelineResponse = {
data: {
project: {
__typename: 'Project',
id: '1',
pipeline: {
__typename: 'Pipeline',
id: 163,
......@@ -21,9 +22,11 @@ export const mockPipelineResponse = {
nodes: [
{
__typename: 'CiStage',
id: '2',
name: 'build',
status: {
__typename: 'DetailedStatus',
id: '3',
action: null,
},
groups: {
......@@ -31,10 +34,12 @@ export const mockPipelineResponse = {
nodes: [
{
__typename: 'CiGroup',
id: '4',
name: 'build_a_nlfjkdnlvskfnksvjknlfdjvlvnjdkjdf_nvjkenjkrlngjeknjkl',
size: 1,
status: {
__typename: 'DetailedStatus',
id: '5',
label: 'passed',
group: 'success',
icon: 'status_success',
......@@ -44,10 +49,12 @@ export const mockPipelineResponse = {
nodes: [
{
__typename: 'CiJob',
id: '6',
name: 'build_a_nlfjkdnlvskfnksvjknlfdjvlvnjdkjdf_nvjkenjkrlngjeknjkl',
scheduledAt: null,
status: {
__typename: 'DetailedStatus',
id: '7',
icon: 'status_success',
tooltip: 'passed',
hasDetails: true,
......@@ -55,6 +62,7 @@ export const mockPipelineResponse = {
group: 'success',
action: {
__typename: 'StatusAction',
id: '8',
buttonTitle: 'Retry this job',
icon: 'retry',
path: '/root/abcd-dag/-/jobs/1482/retry',
......@@ -72,9 +80,11 @@ export const mockPipelineResponse = {
{
__typename: 'CiGroup',
name: 'build_b',
id: '9',
size: 1,
status: {
__typename: 'DetailedStatus',
id: '10',
label: 'passed',
group: 'success',
icon: 'status_success',
......@@ -84,10 +94,12 @@ export const mockPipelineResponse = {
nodes: [
{
__typename: 'CiJob',
id: '11',
name: 'build_b',
scheduledAt: null,
status: {
__typename: 'DetailedStatus',
id: '12',
icon: 'status_success',
tooltip: 'passed',
hasDetails: true,
......@@ -95,6 +107,7 @@ export const mockPipelineResponse = {
group: 'success',
action: {
__typename: 'StatusAction',
id: '13',
buttonTitle: 'Retry this job',
icon: 'retry',
path: '/root/abcd-dag/-/jobs/1515/retry',
......@@ -111,10 +124,12 @@ export const mockPipelineResponse = {
},
{
__typename: 'CiGroup',
id: '14',
name: 'build_c',
size: 1,
status: {
__typename: 'DetailedStatus',
id: '15',
label: 'passed',
group: 'success',
icon: 'status_success',
......@@ -124,10 +139,12 @@ export const mockPipelineResponse = {
nodes: [
{
__typename: 'CiJob',
id: '16',
name: 'build_c',
scheduledAt: null,
status: {
__typename: 'DetailedStatus',
id: '17',
icon: 'status_success',
tooltip: 'passed',
hasDetails: true,
......@@ -135,6 +152,7 @@ export const mockPipelineResponse = {
group: 'success',
action: {
__typename: 'StatusAction',
id: '18',
buttonTitle: 'Retry this job',
icon: 'retry',
path: '/root/abcd-dag/-/jobs/1484/retry',
......@@ -151,10 +169,12 @@ export const mockPipelineResponse = {
},
{
__typename: 'CiGroup',
id: '19',
name: 'build_d',
size: 3,
status: {
__typename: 'DetailedStatus',
id: '20',
label: 'passed',
group: 'success',
icon: 'status_success',
......@@ -164,10 +184,12 @@ export const mockPipelineResponse = {
nodes: [
{
__typename: 'CiJob',
id: '21',
name: 'build_d 1/3',
scheduledAt: null,
status: {
__typename: 'DetailedStatus',
id: '22',
icon: 'status_success',
tooltip: 'passed',
hasDetails: true,
......@@ -175,6 +197,7 @@ export const mockPipelineResponse = {
group: 'success',
action: {
__typename: 'StatusAction',
id: '23',
buttonTitle: 'Retry this job',
icon: 'retry',
path: '/root/abcd-dag/-/jobs/1485/retry',
......@@ -188,10 +211,12 @@ export const mockPipelineResponse = {
},
{
__typename: 'CiJob',
id: '24',
name: 'build_d 2/3',
scheduledAt: null,
status: {
__typename: 'DetailedStatus',
id: '25',
icon: 'status_success',
tooltip: 'passed',
hasDetails: true,
......@@ -199,6 +224,7 @@ export const mockPipelineResponse = {
group: 'success',
action: {
__typename: 'StatusAction',
id: '26',
buttonTitle: 'Retry this job',
icon: 'retry',
path: '/root/abcd-dag/-/jobs/1486/retry',
......@@ -212,10 +238,12 @@ export const mockPipelineResponse = {
},
{
__typename: 'CiJob',
id: '27',
name: 'build_d 3/3',
scheduledAt: null,
status: {
__typename: 'DetailedStatus',
id: '28',
icon: 'status_success',
tooltip: 'passed',
hasDetails: true,
......@@ -223,6 +251,7 @@ export const mockPipelineResponse = {
group: 'success',
action: {
__typename: 'StatusAction',
id: '29',
buttonTitle: 'Retry this job',
icon: 'retry',
path: '/root/abcd-dag/-/jobs/1487/retry',
......@@ -242,9 +271,11 @@ export const mockPipelineResponse = {
},
{
__typename: 'CiStage',
id: '30',
name: 'test',
status: {
__typename: 'DetailedStatus',
id: '31',
action: null,
},
groups: {
......@@ -252,10 +283,12 @@ export const mockPipelineResponse = {
nodes: [
{
__typename: 'CiGroup',
id: '32',
name: 'test_a',
size: 1,
status: {
__typename: 'DetailedStatus',
id: '33',
label: 'passed',
group: 'success',
icon: 'status_success',
......@@ -265,10 +298,12 @@ export const mockPipelineResponse = {
nodes: [
{
__typename: 'CiJob',
id: '34',
name: 'test_a',
scheduledAt: null,
status: {
__typename: 'DetailedStatus',
id: '35',
icon: 'status_success',
tooltip: 'passed',
hasDetails: true,
......@@ -276,6 +311,7 @@ export const mockPipelineResponse = {
group: 'success',
action: {
__typename: 'StatusAction',
id: '36',
buttonTitle: 'Retry this job',
icon: 'retry',
path: '/root/abcd-dag/-/jobs/1514/retry',
......@@ -287,14 +323,17 @@ export const mockPipelineResponse = {
nodes: [
{
__typename: 'CiBuildNeed',
id: '37',
name: 'build_c',
},
{
__typename: 'CiBuildNeed',
id: '38',
name: 'build_b',
},
{
__typename: 'CiBuildNeed',
id: '39',
name:
'build_a_nlfjkdnlvskfnksvjknlfdjvlvnjdkjdf_nvjkenjkrlngjeknjkl',
},
......@@ -306,10 +345,12 @@ export const mockPipelineResponse = {
},
{
__typename: 'CiGroup',
id: '40',
name: 'test_b',
size: 2,
status: {
__typename: 'DetailedStatus',
id: '41',
label: 'passed',
group: 'success',
icon: 'status_success',
......@@ -319,10 +360,12 @@ export const mockPipelineResponse = {
nodes: [
{
__typename: 'CiJob',
id: '42',
name: 'test_b 1/2',
scheduledAt: null,
status: {
__typename: 'DetailedStatus',
id: '43',
icon: 'status_success',
tooltip: 'passed',
hasDetails: true,
......@@ -330,6 +373,7 @@ export const mockPipelineResponse = {
group: 'success',
action: {
__typename: 'StatusAction',
id: '44',
buttonTitle: 'Retry this job',
icon: 'retry',
path: '/root/abcd-dag/-/jobs/1489/retry',
......@@ -341,22 +385,27 @@ export const mockPipelineResponse = {
nodes: [
{
__typename: 'CiBuildNeed',
id: '45',
name: 'build_d 3/3',
},
{
__typename: 'CiBuildNeed',
id: '46',
name: 'build_d 2/3',
},
{
__typename: 'CiBuildNeed',
id: '47',
name: 'build_d 1/3',
},
{
__typename: 'CiBuildNeed',
id: '48',
name: 'build_b',
},
{
__typename: 'CiBuildNeed',
id: '49',
name:
'build_a_nlfjkdnlvskfnksvjknlfdjvlvnjdkjdf_nvjkenjkrlngjeknjkl',
},
......@@ -365,10 +414,12 @@ export const mockPipelineResponse = {
},
{
__typename: 'CiJob',
id: '67',
name: 'test_b 2/2',
scheduledAt: null,
status: {
__typename: 'DetailedStatus',
id: '50',
icon: 'status_success',
tooltip: 'passed',
hasDetails: true,
......@@ -376,6 +427,7 @@ export const mockPipelineResponse = {
group: 'success',
action: {
__typename: 'StatusAction',
id: '51',
buttonTitle: 'Retry this job',
icon: 'retry',
path: '/root/abcd-dag/-/jobs/1490/retry',
......@@ -387,22 +439,27 @@ export const mockPipelineResponse = {
nodes: [
{
__typename: 'CiBuildNeed',
id: '52',
name: 'build_d 3/3',
},
{
__typename: 'CiBuildNeed',
id: '53',
name: 'build_d 2/3',
},
{
__typename: 'CiBuildNeed',
id: '54',
name: 'build_d 1/3',
},
{
__typename: 'CiBuildNeed',
id: '55',
name: 'build_b',
},
{
__typename: 'CiBuildNeed',
id: '56',
name:
'build_a_nlfjkdnlvskfnksvjknlfdjvlvnjdkjdf_nvjkenjkrlngjeknjkl',
},
......@@ -415,9 +472,11 @@ export const mockPipelineResponse = {
{
__typename: 'CiGroup',
name: 'test_c',
id: '57',
size: 1,
status: {
__typename: 'DetailedStatus',
id: '58',
label: null,
group: 'success',
icon: 'status_success',
......@@ -427,10 +486,12 @@ export const mockPipelineResponse = {
nodes: [
{
__typename: 'CiJob',
id: '59',
name: 'test_c',
scheduledAt: null,
status: {
__typename: 'DetailedStatus',
id: '60',
icon: 'status_success',
tooltip: null,
hasDetails: true,
......@@ -448,9 +509,11 @@ export const mockPipelineResponse = {
},
{
__typename: 'CiGroup',
id: '61',
name: 'test_d',
size: 1,
status: {
id: '62',
__typename: 'DetailedStatus',
label: null,
group: 'success',
......@@ -461,10 +524,12 @@ export const mockPipelineResponse = {
nodes: [
{
__typename: 'CiJob',
id: '53',
name: 'test_d',
scheduledAt: null,
status: {
__typename: 'DetailedStatus',
id: '64',
icon: 'status_success',
tooltip: null,
hasDetails: true,
......@@ -477,6 +542,7 @@ export const mockPipelineResponse = {
nodes: [
{
__typename: 'CiBuildNeed',
id: '65',
name: 'build_b',
},
],
......@@ -502,6 +568,7 @@ export const downstream = {
iid: '31',
path: '/root/elemenohpee/-/pipelines/175',
status: {
id: '70',
group: 'success',
label: 'passed',
icon: 'status_success',
......@@ -509,6 +576,7 @@ export const downstream = {
},
sourceJob: {
name: 'test_c',
id: '71',
__typename: 'CiJob',
},
project: {
......@@ -525,12 +593,14 @@ export const downstream = {
iid: '27',
path: '/root/abcd-dag/-/pipelines/181',
status: {
id: '72',
group: 'success',
label: 'passed',
icon: 'status_success',
__typename: 'DetailedStatus',
},
sourceJob: {
id: '73',
name: 'test_d',
__typename: 'CiJob',
},
......@@ -551,6 +621,7 @@ export const upstream = {
iid: '24',
path: '/root/abcd-dag/-/pipelines/161',
status: {
id: '74',
group: 'success',
label: 'passed',
icon: 'status_success',
......@@ -571,6 +642,7 @@ export const wrappedPipelineReturn = {
data: {
project: {
__typename: 'Project',
id: '75',
pipeline: {
__typename: 'Pipeline',
id: 'gid://gitlab/Ci::Pipeline/175',
......@@ -592,12 +664,14 @@ export const wrappedPipelineReturn = {
__typename: 'Pipeline',
status: {
__typename: 'DetailedStatus',
id: '77',
group: 'success',
label: 'passed',
icon: 'status_success',
},
sourceJob: {
name: 'test_c',
id: '78',
__typename: 'CiJob',
},
project: {
......@@ -613,8 +687,10 @@ export const wrappedPipelineReturn = {
{
name: 'build',
__typename: 'CiStage',
id: '79',
status: {
action: null,
id: '80',
__typename: 'DetailedStatus',
},
groups: {
......@@ -622,8 +698,10 @@ export const wrappedPipelineReturn = {
nodes: [
{
__typename: 'CiGroup',
id: '81',
status: {
__typename: 'DetailedStatus',
id: '82',
label: 'passed',
group: 'success',
icon: 'status_success',
......@@ -635,6 +713,7 @@ export const wrappedPipelineReturn = {
nodes: [
{
__typename: 'CiJob',
id: '83',
name: 'build_n',
scheduledAt: null,
needs: {
......@@ -643,6 +722,7 @@ export const wrappedPipelineReturn = {
},
status: {
__typename: 'DetailedStatus',
id: '84',
icon: 'status_success',
tooltip: 'passed',
hasDetails: true,
......@@ -650,6 +730,7 @@ export const wrappedPipelineReturn = {
group: 'success',
action: {
__typename: 'StatusAction',
id: '85',
buttonTitle: 'Retry this job',
icon: 'retry',
path: '/root/elemenohpee/-/jobs/1662/retry',
......
......@@ -14,6 +14,7 @@ export const mockPipelineHeader = {
},
createdAt: threeWeeksAgo.toISOString(),
user: {
id: 'user-1',
name: 'Foo',
username: 'foobar',
email: 'foo@bar.com',
......@@ -27,6 +28,7 @@ export const mockFailedPipelineHeader = {
retryable: true,
cancelable: false,
detailedStatus: {
id: 'status-1',
group: 'failed',
icon: 'status_failed',
label: 'failed',
......@@ -43,6 +45,7 @@ export const mockFailedPipelineNoPermissions = {
},
createdAt: threeWeeksAgo.toISOString(),
user: {
id: 'user-1',
name: 'Foo',
username: 'foobar',
email: 'foo@bar.com',
......@@ -52,6 +55,7 @@ export const mockFailedPipelineNoPermissions = {
retryable: true,
cancelable: false,
detailedStatus: {
id: 'status-1',
group: 'running',
icon: 'status_running',
label: 'running',
......@@ -66,6 +70,7 @@ export const mockRunningPipelineHeader = {
retryable: false,
cancelable: true,
detailedStatus: {
id: 'status-1',
group: 'running',
icon: 'status_running',
label: 'running',
......@@ -82,6 +87,7 @@ export const mockRunningPipelineNoPermissions = {
},
createdAt: threeWeeksAgo.toISOString(),
user: {
id: 'user-1',
name: 'Foo',
username: 'foobar',
email: 'foo@bar.com',
......@@ -91,6 +97,7 @@ export const mockRunningPipelineNoPermissions = {
retryable: false,
cancelable: true,
detailedStatus: {
id: 'status-1',
group: 'running',
icon: 'status_running',
label: 'running',
......@@ -105,6 +112,7 @@ export const mockCancelledPipelineHeader = {
retryable: true,
cancelable: false,
detailedStatus: {
id: 'status-1',
group: 'cancelled',
icon: 'status_cancelled',
label: 'cancelled',
......@@ -119,6 +127,7 @@ export const mockSuccessfulPipelineHeader = {
retryable: false,
cancelable: false,
detailedStatus: {
id: 'status-1',
group: 'success',
icon: 'status_success',
label: 'success',
......@@ -130,13 +139,16 @@ export const mockSuccessfulPipelineHeader = {
export const mockRunningPipelineHeaderData = {
data: {
project: {
id: '1',
pipeline: {
...mockRunningPipelineHeader,
iid: '28',
user: {
id: 'user-1',
name: 'Foo',
username: 'foobar',
webPath: '/foo',
webUrl: '/foo',
email: 'foo@bar.com',
avatarUrl: 'link',
status: null,
......
......@@ -19,6 +19,7 @@ describe('NewProjectUrlSelect component', () => {
const data = {
currentUser: {
id: 'user-1',
groups: {
nodes: [
{
......@@ -194,6 +195,7 @@ describe('NewProjectUrlSelect component', () => {
it('renders `No matches found` when there are no matching dropdown items', async () => {
const queryResponse = {
currentUser: {
id: 'user-1',
groups: {
nodes: [],
},
......
......@@ -48,6 +48,7 @@ export const transformedAreaChartData = [
export const mockPipelineCount = {
data: {
project: {
id: '1',
totalPipelines: { count: 34, __typename: 'PipelineConnection' },
successfulPipelines: { count: 23, __typename: 'PipelineConnection' },
failedPipelines: { count: 1, __typename: 'PipelineConnection' },
......@@ -70,6 +71,7 @@ export const chartOptions = {
export const mockPipelineStatistics = {
data: {
project: {
id: '1',
pipelineAnalytics: {
weekPipelinesTotals: [0, 0, 0, 0, 0, 0, 0, 0],
weekPipelinesLabels: [
......
......@@ -44,6 +44,7 @@ Object {
"author": Object {
"__typename": "UserCore",
"avatarUrl": "https://www.gravatar.com/avatar/16f8e2050ce10180ca571c2eb19cfce2?s=80&d=identicon",
"id": Any<String>,
"username": "administrator",
"webUrl": "http://localhost/administrator",
},
......@@ -139,6 +140,7 @@ Object {
"author": Object {
"__typename": "UserCore",
"avatarUrl": "https://www.gravatar.com/avatar/16f8e2050ce10180ca571c2eb19cfce2?s=80&d=identicon",
"id": Any<String>,
"username": "administrator",
"webUrl": "http://localhost/administrator",
},
......@@ -153,6 +155,7 @@ Object {
"__typename": "ReleaseEvidence",
"collectedAt": "2018-12-03T00:00:00Z",
"filepath": "http://localhost/releases-namespace/releases-project/-/releases/v1.1/evidences/1.json",
"id": "gid://gitlab/Releases::Evidence/1",
"sha": "760d6cdfb0879c3ffedec13af470e0f71cf52c6cde4d",
},
],
......@@ -247,6 +250,7 @@ Object {
"evidences": Array [],
"milestones": Array [
Object {
"id": "gid://gitlab/Milestone/123",
"issueStats": Object {},
"stats": undefined,
"title": "12.3",
......@@ -254,6 +258,7 @@ Object {
"webUrl": undefined,
},
Object {
"id": "gid://gitlab/Milestone/124",
"issueStats": Object {},
"stats": undefined,
"title": "12.4",
......@@ -347,6 +352,7 @@ Object {
"author": Object {
"__typename": "UserCore",
"avatarUrl": "https://www.gravatar.com/avatar/16f8e2050ce10180ca571c2eb19cfce2?s=80&d=identicon",
"id": Any<String>,
"username": "administrator",
"webUrl": "http://localhost/administrator",
},
......@@ -361,6 +367,7 @@ Object {
"__typename": "ReleaseEvidence",
"collectedAt": "2018-12-03T00:00:00Z",
"filepath": "http://localhost/releases-namespace/releases-project/-/releases/v1.1/evidences/1.json",
"id": "gid://gitlab/Releases::Evidence/1",
"sha": "760d6cdfb0879c3ffedec13af470e0f71cf52c6cde4d",
},
],
......
......@@ -58,7 +58,6 @@ describe('Release show component', () => {
const expectFlashWithMessage = (message) => {
it(`shows a flash message that reads "${message}"`, () => {
expect(createFlash).toHaveBeenCalledTimes(1);
expect(createFlash).toHaveBeenCalledWith({
message,
captureError: true,
......
......@@ -104,13 +104,32 @@ describe('releases/util.js', () => {
describe('convertAllReleasesGraphQLResponse', () => {
it('matches snapshot', () => {
expect(convertAllReleasesGraphQLResponse(originalAllReleasesQueryResponse)).toMatchSnapshot();
expect(convertAllReleasesGraphQLResponse(originalAllReleasesQueryResponse)).toMatchSnapshot({
data: [
{
author: {
id: expect.any(String),
},
},
{
author: {
id: expect.any(String),
},
},
],
});
});
});
describe('convertOneReleaseGraphQLResponse', () => {
it('matches snapshot', () => {
expect(convertOneReleaseGraphQLResponse(originalOneReleaseQueryResponse)).toMatchSnapshot();
expect(convertOneReleaseGraphQLResponse(originalOneReleaseQueryResponse)).toMatchSnapshot({
data: {
author: {
id: expect.any(String),
},
},
});
});
});
......
export const simpleViewerMock = {
id: '1',
name: 'some_file.js',
size: 123,
rawSize: 123,
......
......@@ -11,11 +11,13 @@ export const getIssueTimelogsQueryResponse = {
__typename: 'Timelog',
timeSpent: 14400,
user: {
id: 'user-1',
name: 'John Doe18',
__typename: 'UserCore',
},
spentAt: '2020-05-01T00:00:00Z',
note: {
id: 'note-1',
body: 'A note',
__typename: 'Note',
},
......@@ -25,6 +27,7 @@ export const getIssueTimelogsQueryResponse = {
__typename: 'Timelog',
timeSpent: 1800,
user: {
id: 'user-2',
name: 'Administrator',
__typename: 'UserCore',
},
......@@ -36,11 +39,13 @@ export const getIssueTimelogsQueryResponse = {
__typename: 'Timelog',
timeSpent: 14400,
user: {
id: 'user-2',
name: 'Administrator',
__typename: 'UserCore',
},
spentAt: '2021-05-01T00:00:00Z',
note: {
id: 'note-2',
body: 'A note',
__typename: 'Note',
},
......@@ -65,11 +70,13 @@ export const getMrTimelogsQueryResponse = {
__typename: 'Timelog',
timeSpent: 1800,
user: {
id: 'user-1',
name: 'Administrator',
__typename: 'UserCore',
},
spentAt: '2021-05-07T14:44:55Z',
note: {
id: 'note-1',
body: 'Thirty minutes!',
__typename: 'Note',
},
......@@ -79,6 +86,7 @@ export const getMrTimelogsQueryResponse = {
__typename: 'Timelog',
timeSpent: 3600,
user: {
id: 'user-1',
name: 'Administrator',
__typename: 'UserCore',
},
......@@ -90,11 +98,13 @@ export const getMrTimelogsQueryResponse = {
__typename: 'Timelog',
timeSpent: 300,
user: {
id: 'user-1',
name: 'Administrator',
__typename: 'UserCore',
},
spentAt: '2021-03-10T00:00:00Z',
note: {
id: 'note-2',
body: 'A note with some time',
__typename: 'Note',
},
......
......@@ -223,6 +223,7 @@ const mockData = {
export const issueConfidentialityResponse = (confidential = false) => ({
data: {
workspace: {
id: '1',
__typename: 'Project',
issuable: {
__typename: 'Issue',
......@@ -236,6 +237,7 @@ export const issueConfidentialityResponse = (confidential = false) => ({
export const issuableDueDateResponse = (dueDate = null) => ({
data: {
workspace: {
id: '1',
__typename: 'Project',
issuable: {
__typename: 'Issue',
......@@ -249,6 +251,7 @@ export const issuableDueDateResponse = (dueDate = null) => ({
export const issuableStartDateResponse = (startDate = null) => ({
data: {
workspace: {
id: '1',
__typename: 'Group',
issuable: {
__typename: 'Epic',
......@@ -265,6 +268,7 @@ export const issuableStartDateResponse = (startDate = null) => ({
export const epicParticipantsResponse = () => ({
data: {
workspace: {
id: '1',
__typename: 'Group',
issuable: {
__typename: 'Epic',
......@@ -290,6 +294,7 @@ export const epicParticipantsResponse = () => ({
export const issueReferenceResponse = (reference) => ({
data: {
workspace: {
id: '1',
__typename: 'Project',
issuable: {
__typename: 'Issue',
......@@ -303,6 +308,7 @@ export const issueReferenceResponse = (reference) => ({
export const issueSubscriptionsResponse = (subscribed = false, emailsDisabled = false) => ({
data: {
workspace: {
id: '1',
__typename: 'Project',
issuable: {
__typename: 'Issue',
......@@ -318,6 +324,7 @@ export const issuableQueryResponse = {
data: {
workspace: {
__typename: 'Project',
id: '1',
issuable: {
__typename: 'Issue',
id: 'gid://gitlab/Issue/1',
......@@ -344,6 +351,7 @@ export const searchQueryResponse = {
data: {
workspace: {
__typename: 'Project',
id: '1',
users: {
nodes: [
{
......@@ -428,12 +436,15 @@ export const searchResponse = {
data: {
workspace: {
__typename: 'Project',
id: '1',
users: {
nodes: [
{
id: 'gid://gitlab/User/1',
user: mockUser1,
},
{
id: 'gid://gitlab/User/4',
user: mockUser2,
},
],
......@@ -445,6 +456,7 @@ export const searchResponse = {
export const projectMembersResponse = {
data: {
workspace: {
id: '1',
__typename: 'Project',
users: {
nodes: [
......@@ -452,10 +464,11 @@ export const projectMembersResponse = {
null,
null,
// Remove duplicated entry https://gitlab.com/gitlab-org/gitlab/-/issues/327822
{ user: mockUser1 },
{ user: mockUser1 },
{ user: mockUser2 },
{ id: 'user-1', user: mockUser1 },
{ id: 'user-2', user: mockUser1 },
{ id: 'user-3', user: mockUser2 },
{
id: 'user-4',
user: {
id: 'gid://gitlab/User/2',
avatarUrl:
......@@ -477,16 +490,18 @@ export const projectMembersResponse = {
export const groupMembersResponse = {
data: {
workspace: {
__typename: 'roup',
id: '1',
__typename: 'Group',
users: {
nodes: [
// Remove nulls https://gitlab.com/gitlab-org/gitlab/-/issues/329750
null,
null,
// Remove duplicated entry https://gitlab.com/gitlab-org/gitlab/-/issues/327822
{ user: mockUser1 },
{ user: mockUser1 },
{ id: 'user-1', user: mockUser1 },
{ id: 'user-2', user: mockUser1 },
{
id: 'user-3',
user: {
id: 'gid://gitlab/User/2',
avatarUrl:
......@@ -509,6 +524,7 @@ export const participantsQueryResponse = {
data: {
workspace: {
__typename: 'Project',
id: '1',
issuable: {
__typename: 'Issue',
id: 'gid://gitlab/Issue/1',
......@@ -578,6 +594,7 @@ export const mockMilestone2 = {
export const mockProjectMilestonesResponse = {
data: {
workspace: {
id: 'gid://gitlab/Project/1',
attributes: {
nodes: [mockMilestone1, mockMilestone2],
},
......@@ -663,6 +680,7 @@ export const todosResponse = {
data: {
workspace: {
__typename: 'Group',
id: '1',
issuable: {
__typename: 'Epic',
id: 'gid://gitlab/Epic/4',
......@@ -681,6 +699,7 @@ export const todosResponse = {
export const noTodosResponse = {
data: {
workspace: {
id: '1',
__typename: 'Group',
issuable: {
__typename: 'Epic',
......
......@@ -53,6 +53,7 @@ const createMutationResponse = (key, obj = {}) => ({
errors: [],
snippet: {
__typename: 'Snippet',
id: 1,
webUrl: TEST_WEB_URL,
},
},
......
......@@ -27,6 +27,7 @@ export const createGQLSnippet = () => ({
},
project: {
__typename: 'Project',
id: 'project-1',
fullPath: 'group/project',
webUrl: `${TEST_HOST}/group/project`,
},
......
......@@ -23,6 +23,7 @@ describe('TerraformList', () => {
const apolloQueryResponse = {
data: {
project: {
id: '1',
terraformStates,
},
},
......
export const enabledJobTokenScope = {
data: {
project: {
id: '1',
ciCdSettings: {
jobTokenScopeEnabled: true,
__typename: 'ProjectCiCdSetting',
......@@ -13,6 +14,7 @@ export const enabledJobTokenScope = {
export const disabledJobTokenScope = {
data: {
project: {
id: '1',
ciCdSettings: {
jobTokenScopeEnabled: false,
__typename: 'ProjectCiCdSetting',
......@@ -39,12 +41,14 @@ export const projectsWithScope = {
data: {
project: {
__typename: 'Project',
id: '1',
ciJobTokenScope: {
__typename: 'CiJobTokenScopeType',
projects: {
__typename: 'ProjectConnection',
nodes: [
{
id: '2',
fullPath: 'root/332268-test',
name: 'root/332268-test',
},
......@@ -75,10 +79,17 @@ export const removeProjectSuccess = {
export const mockProjects = [
{
id: '1',
name: 'merge-train-stuff',
fullPath: 'root/merge-train-stuff',
isLocked: false,
__typename: 'Project',
},
{ name: 'ci-project', fullPath: 'root/ci-project', isLocked: true, __typename: 'Project' },
{
id: '2',
name: 'ci-project',
fullPath: 'root/ci-project',
isLocked: true,
__typename: 'Project',
},
];
......@@ -118,6 +118,7 @@ export const workspaceLabelsQueryResponse = {
export const issuableLabelsQueryResponse = {
data: {
workspace: {
id: 'workspace-1',
issuable: {
id: '1',
labels: {
......
......@@ -341,12 +341,15 @@ export const securityReportMergeRequestDownloadPathsQueryNoArtifactsResponse = {
export const securityReportMergeRequestDownloadPathsQueryResponse = {
project: {
id: '1',
mergeRequest: {
id: 'mr-1',
headPipeline: {
id: 'gid://gitlab/Ci::Pipeline/176',
jobs: {
nodes: [
{
id: 'job-1',
name: 'secret_detection',
artifacts: {
nodes: [
......@@ -368,6 +371,7 @@ export const securityReportMergeRequestDownloadPathsQueryResponse = {
__typename: 'CiJob',
},
{
id: 'job-2',
name: 'bandit-sast',
artifacts: {
nodes: [
......@@ -389,6 +393,7 @@ export const securityReportMergeRequestDownloadPathsQueryResponse = {
__typename: 'CiJob',
},
{
id: 'job-3',
name: 'eslint-sast',
artifacts: {
nodes: [
......@@ -410,6 +415,7 @@ export const securityReportMergeRequestDownloadPathsQueryResponse = {
__typename: 'CiJob',
},
{
id: 'job-4',
name: 'all_artifacts',
artifacts: {
nodes: [
......@@ -449,11 +455,13 @@ export const securityReportMergeRequestDownloadPathsQueryResponse = {
export const securityReportPipelineDownloadPathsQueryResponse = {
project: {
id: 'project-1',
pipeline: {
id: 'gid://gitlab/Ci::Pipeline/176',
jobs: {
nodes: [
{
id: 'job-1',
name: 'secret_detection',
artifacts: {
nodes: [
......@@ -475,6 +483,7 @@ export const securityReportPipelineDownloadPathsQueryResponse = {
__typename: 'CiJob',
},
{
id: 'job-2',
name: 'bandit-sast',
artifacts: {
nodes: [
......@@ -496,6 +505,7 @@ export const securityReportPipelineDownloadPathsQueryResponse = {
__typename: 'CiJob',
},
{
id: 'job-3',
name: 'eslint-sast',
artifacts: {
nodes: [
......@@ -517,6 +527,7 @@ export const securityReportPipelineDownloadPathsQueryResponse = {
__typename: 'CiJob',
},
{
id: 'job-4',
name: 'all_artifacts',
artifacts: {
nodes: [
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment