Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
8a31782a
Commit
8a31782a
authored
Mar 30, 2021
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab master
parents
5918b018
dfad880d
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
270 additions
and
31 deletions
+270
-31
GITALY_SERVER_VERSION
GITALY_SERVER_VERSION
+1
-1
app/views/admin/runners/show.html.haml
app/views/admin/runners/show.html.haml
+5
-13
changelogs/unreleased/mrincon-runner-detail-breadcrumb-fix.yml
...elogs/unreleased/mrincon-runner-detail-breadcrumb-fix.yml
+5
-0
config/feature_flags/development/cluster_agent_list.yml
config/feature_flags/development/cluster_agent_list.yml
+0
-8
ee/app/assets/javascripts/vue_shared/purchase_flow/graphql/mutations/activate_next_step.mutation.graphql
...low/graphql/mutations/activate_next_step.mutation.graphql
+3
-0
ee/app/assets/javascripts/vue_shared/purchase_flow/graphql/mutations/update_active_step.mutation.graphql
...low/graphql/mutations/update_active_step.mutation.graphql
+3
-0
ee/app/assets/javascripts/vue_shared/purchase_flow/graphql/queries/active_step.query.graphql
...d/purchase_flow/graphql/queries/active_step.query.graphql
+5
-0
ee/app/assets/javascripts/vue_shared/purchase_flow/graphql/queries/step_list.query.graphql
...red/purchase_flow/graphql/queries/step_list.query.graphql
+5
-0
ee/app/assets/javascripts/vue_shared/purchase_flow/graphql/resolvers.js
...javascripts/vue_shared/purchase_flow/graphql/resolvers.js
+43
-0
ee/app/assets/javascripts/vue_shared/purchase_flow/graphql/typedefs.graphql
...scripts/vue_shared/purchase_flow/graphql/typedefs.graphql
+15
-0
ee/app/helpers/ee/clusters_helper.rb
ee/app/helpers/ee/clusters_helper.rb
+6
-2
ee/changelogs/unreleased/show_project_kubernetes_agent_on_gitlab_com_state.yml
...sed/show_project_kubernetes_agent_on_gitlab_com_state.yml
+5
-0
ee/spec/frontend/vue_shared/purchase_flow/graphql/resolvers_spec.js
...ontend/vue_shared/purchase_flow/graphql/resolvers_spec.js
+134
-0
ee/spec/frontend/vue_shared/purchase_flow/mock_data.js
ee/spec/frontend/vue_shared/purchase_flow/mock_data.js
+4
-0
ee/spec/helpers/ee/clusters_helper_spec.rb
ee/spec/helpers/ee/clusters_helper_spec.rb
+22
-4
lib/gitlab/kas.rb
lib/gitlab/kas.rb
+1
-1
locale/gitlab.pot
locale/gitlab.pot
+3
-0
spec/features/admin/admin_runners_spec.rb
spec/features/admin/admin_runners_spec.rb
+10
-2
No files found.
GITALY_SERVER_VERSION
View file @
8a31782a
24415e4973647f1b9be3b2cff0ebde4439917484
79003389aa5098a6ef37e73298cafbad4d9e6b79
app/views/admin/runners/show.html.haml
View file @
8a31782a
-
add_page_specific_style
'page_bundles/ci_status'
-
add_page_specific_style
'page_bundles/ci_status'
=
content_for
:title
do
%h3
.project-title
Runner ##{@runner.id}
.float-right
-
if
@runner
.
instance_type?
%span
.runner-state.runner-state-shared
Shared
-
else
%span
.runner-state.runner-state-specific
Specific
-
page_title
@runner
.
short_sha
-
page_title
@runner
.
short_sha
-
add_to_breadcrumbs
_
(
"Runners"
),
admin_runners_path
-
add_to_breadcrumbs
_
(
'Runners'
),
admin_runners_path
-
breadcrumb_title
"#
#{
@runner
.
id
}
"
-
breadcrumb_title
page_title
%h2
.page-title
=
sprintf
(
s_
(
'Runners|Runner #%{runner_id}'
),
{
runner_id:
@runner
.
id
})
-
if
@runner
.
instance_type?
-
if
@runner
.
instance_type?
.bs-callout.bs-callout-success
.bs-callout.bs-callout-success
...
...
changelogs/unreleased/mrincon-runner-detail-breadcrumb-fix.yml
0 → 100644
View file @
8a31782a
---
title
:
Add Runner ID as title in Runner details page
merge_request
:
57247
author
:
type
:
changed
config/feature_flags/development/cluster_agent_list.yml
deleted
100644 → 0
View file @
5918b018
---
name
:
cluster_agent_list
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/42115
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/249596
milestone
:
'
13.5'
type
:
development
group
:
group::configure
default_enabled
:
true
ee/app/assets/javascripts/vue_shared/purchase_flow/graphql/mutations/activate_next_step.mutation.graphql
0 → 100644
View file @
8a31782a
mutation
activateNextStep
{
activateNextStep
@client
}
ee/app/assets/javascripts/vue_shared/purchase_flow/graphql/mutations/update_active_step.mutation.graphql
0 → 100644
View file @
8a31782a
mutation
updateActiveStep
(
$id
:
String
)
{
updateActiveStep
(
id
:
$id
)
@client
}
ee/app/assets/javascripts/vue_shared/purchase_flow/graphql/queries/active_step.query.graphql
0 → 100644
View file @
8a31782a
query
activeStep
{
activeStep
@client
{
id
}
}
ee/app/assets/javascripts/vue_shared/purchase_flow/graphql/queries/step_list.query.graphql
0 → 100644
View file @
8a31782a
query
stepList
{
stepList
@client
{
id
}
}
ee/app/assets/javascripts/vue_shared/purchase_flow/graphql/resolvers.js
0 → 100644
View file @
8a31782a
import
produce
from
'
immer
'
;
import
activeStepQuery
from
'
./queries/active_step.query.graphql
'
;
import
stepListQuery
from
'
./queries/step_list.query.graphql
'
;
function
updateActiveStep
(
_
,
{
id
},
{
cache
})
{
const
sourceData
=
cache
.
readQuery
({
query
:
activeStepQuery
});
const
{
stepList
}
=
cache
.
readQuery
({
query
:
stepListQuery
});
const
activeStep
=
stepList
.
find
((
step
)
=>
step
.
id
===
id
);
const
data
=
produce
(
sourceData
,
(
draftData
)
=>
{
draftData
.
activeStep
=
{
// eslint-disable-next-line @gitlab/require-i18n-strings
__typename
:
'
Step
'
,
id
:
activeStep
.
id
,
};
});
return
cache
.
writeQuery
({
query
:
activeStepQuery
,
data
});
}
function
activateNextStep
(
parent
,
_
,
{
cache
})
{
const
sourceData
=
cache
.
readQuery
({
query
:
activeStepQuery
});
const
{
stepList
}
=
cache
.
readQuery
({
query
:
stepListQuery
});
const
index
=
stepList
.
findIndex
((
step
)
=>
step
.
id
===
sourceData
.
activeStep
.
id
);
const
activeStep
=
stepList
[
index
+
1
];
const
data
=
produce
(
sourceData
,
(
draftData
)
=>
{
draftData
.
activeStep
=
{
// eslint-disable-next-line @gitlab/require-i18n-strings
__typename
:
'
Step
'
,
id
:
activeStep
.
id
,
};
});
return
cache
.
writeQuery
({
query
:
activeStepQuery
,
data
});
}
export
default
{
Mutation
:
{
updateActiveStep
,
activateNextStep
,
},
};
ee/app/assets/javascripts/vue_shared/purchase_flow/graphql/typedefs.graphql
0 → 100644
View file @
8a31782a
type
Step
{
id
:
ID
}
extend
type
Query
{
activeStep
:
Step
}
extend
type
Query
{
stepList
:
[
Step
]
}
extend
type
Mutation
{
updateActiveStep
(
id
:
ID
!):
Boolean
}
ee/app/helpers/ee/clusters_helper.rb
View file @
8a31782a
...
@@ -6,9 +6,13 @@ module EE
...
@@ -6,9 +6,13 @@ module EE
override
:display_cluster_agents?
override
:display_cluster_agents?
def
display_cluster_agents?
(
clusterable
)
def
display_cluster_agents?
(
clusterable
)
return
unless
::
Feature
.
enabled?
(
:cluster_agent_list
,
default_enabled:
true
)
clusterable
.
is_a?
(
Project
)
&&
clusterable
.
feature_available?
(
:cluster_agents
)
&&
included_in_gitlab_com_rollout?
(
clusterable
)
end
private
clusterable
.
is_a?
(
Project
)
&&
clusterable
.
feature_available?
(
:cluster_agents
)
def
included_in_gitlab_com_rollout?
(
project
)
::
Gitlab
::
Kas
.
included_in_gitlab_com_rollout?
(
project
)
end
end
end
end
end
end
ee/changelogs/unreleased/show_project_kubernetes_agent_on_gitlab_com_state.yml
0 → 100644
View file @
8a31782a
---
title
:
Hide cluster agent UI if not enabled on GitLab.com
merge_request
:
57668
author
:
type
:
changed
ee/spec/frontend/vue_shared/purchase_flow/graphql/resolvers_spec.js
0 → 100644
View file @
8a31782a
import
{
createMockClient
}
from
'
mock-apollo-client
'
;
import
activateNextStepMutation
from
'
ee/vue_shared/purchase_flow/graphql/mutations/activate_next_step.mutation.graphql
'
;
import
updateStepMutation
from
'
ee/vue_shared/purchase_flow/graphql/mutations/update_active_step.mutation.graphql
'
;
import
activeStepQuery
from
'
ee/vue_shared/purchase_flow/graphql/queries/active_step.query.graphql
'
;
import
stepListQuery
from
'
ee/vue_shared/purchase_flow/graphql/queries/step_list.query.graphql
'
;
import
resolvers
from
'
ee/vue_shared/purchase_flow/graphql/resolvers
'
;
import
typeDefs
from
'
ee/vue_shared/purchase_flow/graphql/typedefs.graphql
'
;
import
{
STEPS
}
from
'
../mock_data
'
;
describe
(
'
ee/vue_shared/purchase_flow/graphql/resolvers
'
,
()
=>
{
let
mockClient
;
beforeEach
(
async
()
=>
{
mockClient
=
createMockClient
({
resolvers
,
typeDefs
});
mockClient
.
cache
.
writeQuery
({
query
:
stepListQuery
,
data
:
{
stepList
:
STEPS
,
},
});
mockClient
.
cache
.
writeQuery
({
query
:
activeStepQuery
,
data
:
{
activeStep
:
STEPS
[
0
],
},
});
});
describe
(
'
Query
'
,
()
=>
{
describe
(
'
stepListQuery
'
,
()
=>
{
it
(
'
stores the stepList
'
,
async
()
=>
{
const
queryResult
=
await
mockClient
.
query
({
query
:
stepListQuery
});
expect
(
queryResult
.
data
.
stepList
).
toMatchObject
(
STEPS
.
map
(({
id
})
=>
{
return
{
id
};
}),
);
});
it
(
'
throws an error when cache is not initiated properly
'
,
async
()
=>
{
mockClient
.
clearStore
();
await
mockClient
.
query
({
query
:
stepListQuery
}).
catch
((
e
)
=>
{
expect
(
e
instanceof
Error
).
toBe
(
true
);
});
});
});
describe
(
'
activeStepQuery
'
,
()
=>
{
it
(
'
stores the activeStep
'
,
async
()
=>
{
const
queryResult
=
await
mockClient
.
query
({
query
:
activeStepQuery
});
expect
(
queryResult
.
data
.
activeStep
).
toMatchObject
({
id
:
STEPS
[
0
].
id
});
});
it
(
'
throws an error when cache is not initiated properly
'
,
async
()
=>
{
mockClient
.
clearStore
();
await
mockClient
.
query
({
query
:
activeStepQuery
}).
catch
((
e
)
=>
{
expect
(
e
instanceof
Error
).
toBe
(
true
);
});
});
});
});
describe
(
'
Mutation
'
,
()
=>
{
describe
(
'
updateActiveStep
'
,
()
=>
{
it
(
'
updates the active step
'
,
async
()
=>
{
await
mockClient
.
mutate
({
mutation
:
updateStepMutation
,
variables
:
{
id
:
STEPS
[
1
].
id
},
});
const
queryResult
=
await
mockClient
.
query
({
query
:
activeStepQuery
});
expect
(
queryResult
.
data
.
activeStep
).
toMatchObject
({
id
:
STEPS
[
1
].
id
});
});
it
(
'
throws an error when STEP is not present
'
,
async
()
=>
{
const
id
=
'
does not exist
'
;
await
mockClient
.
mutate
({
mutation
:
updateStepMutation
,
variables
:
{
id
},
})
.
catch
((
e
)
=>
{
expect
(
e
instanceof
Error
).
toBe
(
true
);
});
});
it
(
'
throws an error when cache is not initiated properly
'
,
async
()
=>
{
mockClient
.
clearStore
();
await
mockClient
.
mutate
({
mutation
:
updateStepMutation
,
variables
:
{
id
:
STEPS
[
1
].
id
},
})
.
catch
((
e
)
=>
{
expect
(
e
instanceof
Error
).
toBe
(
true
);
});
});
});
describe
(
'
activateNextStep
'
,
()
=>
{
it
(
'
updates the active step to the next
'
,
async
()
=>
{
await
mockClient
.
mutate
({
mutation
:
activateNextStepMutation
,
});
const
queryResult
=
await
mockClient
.
query
({
query
:
activeStepQuery
});
expect
(
queryResult
.
data
.
activeStep
).
toMatchObject
({
id
:
STEPS
[
1
].
id
});
});
it
(
'
throws an error when out of bounds
'
,
async
()
=>
{
await
mockClient
.
mutate
({
mutation
:
activateNextStepMutation
,
});
await
mockClient
.
mutate
({
mutation
:
activateNextStepMutation
,
})
.
catch
((
e
)
=>
{
expect
(
e
instanceof
Error
).
toBe
(
true
);
});
});
it
(
'
throws an error when cache is not initiated properly
'
,
async
()
=>
{
mockClient
.
clearStore
();
await
mockClient
.
mutate
({
mutation
:
activateNextStepMutation
,
})
.
catch
((
e
)
=>
{
expect
(
e
instanceof
Error
).
toBe
(
true
);
});
});
});
});
});
ee/spec/frontend/vue_shared/purchase_flow/mock_data.js
0 → 100644
View file @
8a31782a
export
const
STEPS
=
[
{
__typename
:
'
Step
'
,
id
:
'
firstStep
'
},
{
__typename
:
'
Step
'
,
id
:
'
secondStep
'
},
];
ee/spec/helpers/ee/clusters_helper_spec.rb
View file @
8a31782a
...
@@ -16,6 +16,8 @@ RSpec.describe ClustersHelper do
...
@@ -16,6 +16,8 @@ RSpec.describe ClustersHelper do
context
'with premium license'
do
context
'with premium license'
do
before
do
before
do
allow
(
Gitlab
).
to
receive
(
:com?
).
and_return
(
false
)
stub_licensed_features
(
cluster_agents:
true
)
stub_licensed_features
(
cluster_agents:
true
)
end
end
...
@@ -33,13 +35,29 @@ RSpec.describe ClustersHelper do
...
@@ -33,13 +35,29 @@ RSpec.describe ClustersHelper do
end
end
end
end
context
'
when cluster_agent_list feature flag is disabled
'
do
context
'
GitLab.com
'
do
before
do
before
do
stub_feature_flags
(
cluster_agent_list:
fals
e
)
allow
(
Gitlab
).
to
receive
(
:com?
).
and_return
(
tru
e
)
end
end
it
'does not allows agents to display'
do
context
'when kubernetes_agent_on_gitlab_com feature flag is disabled'
do
expect
(
subject
).
to
be_falsey
before
do
stub_feature_flags
(
kubernetes_agent_on_gitlab_com:
false
)
end
it
'does not allows agents to display'
do
expect
(
subject
).
to
be_falsey
end
end
context
'kubernetes_agent_on_gitlab_com feature flag enabled'
do
before
do
stub_feature_flags
(
kubernetes_agent_on_gitlab_com:
clusterable
)
end
it
'allows agents to display'
do
expect
(
subject
).
to
be_truthy
end
end
end
end
end
end
end
...
...
lib/gitlab/kas.rb
View file @
8a31782a
...
@@ -27,7 +27,7 @@ module Gitlab
...
@@ -27,7 +27,7 @@ module Gitlab
def
included_in_gitlab_com_rollout?
(
project
)
def
included_in_gitlab_com_rollout?
(
project
)
return
true
unless
::
Gitlab
.
com?
return
true
unless
::
Gitlab
.
com?
Feature
.
enabled?
(
:kubernetes_agent_on_gitlab_com
,
project
)
Feature
.
enabled?
(
:kubernetes_agent_on_gitlab_com
,
project
,
default_enabled: :yaml
)
end
end
end
end
end
end
...
...
locale/gitlab.pot
View file @
8a31782a
...
@@ -26554,6 +26554,9 @@ msgstr ""
...
@@ -26554,6 +26554,9 @@ msgstr ""
msgid "Runners|Revision"
msgid "Runners|Revision"
msgstr ""
msgstr ""
msgid "Runners|Runner #%{runner_id}"
msgstr ""
msgid "Runners|Shared"
msgid "Runners|Shared"
msgstr ""
msgstr ""
...
...
spec/features/admin/admin_runners_spec.rb
View file @
8a31782a
...
@@ -285,8 +285,16 @@ RSpec.describe "Admin Runners" do
...
@@ -285,8 +285,16 @@ RSpec.describe "Admin Runners" do
end
end
describe
'runner page breadcrumbs'
do
describe
'runner page breadcrumbs'
do
it
'contains the current runner’s short sha'
do
it
'contains the current runner token'
do
expect
(
page
.
find
(
'h2'
)).
to
have_content
(
runner
.
short_sha
)
page
.
within
'[data-testid="breadcrumb-links"]'
do
expect
(
page
.
find
(
'h2'
)).
to
have_content
(
runner
.
short_sha
)
end
end
end
describe
'runner page title'
do
it
'contains the runner id'
do
expect
(
find
(
'.page-title'
)).
to
have_content
(
"Runner #
#{
runner
.
id
}
"
)
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment