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
30801344
Commit
30801344
authored
Feb 08, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
a4c84456
3142d8fc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
6 deletions
+16
-6
app/models/clusters/cluster.rb
app/models/clusters/cluster.rb
+2
-1
app/models/project_auto_devops.rb
app/models/project_auto_devops.rb
+2
-1
spec/migrations/migrate_auto_dev_ops_domain_to_cluster_domain_spec.rb
...ons/migrate_auto_dev_ops_domain_to_cluster_domain_spec.rb
+12
-4
No files found.
app/models/clusters/cluster.rb
View file @
30801344
...
...
@@ -221,7 +221,8 @@ module Clusters
# ProjectAutoDevops#Domain, project variables or group variables,
# as the AUTO_DEVOPS_DOMAIN is needed for CI_ENVIRONMENT_URL
#
# This method should be removed on 12.0
# This method should is scheduled to be removed on
# https://gitlab.com/gitlab-org/gitlab-ce/issues/56959
def
legacy_auto_devops_domain
if
project_type?
project
&
.
auto_devops
&
.
domain
.
presence
||
...
...
app/models/project_auto_devops.rb
View file @
30801344
...
...
@@ -27,7 +27,8 @@ class ProjectAutoDevops < ActiveRecord::Base
# From 11.8, AUTO_DEVOPS_DOMAIN has been replaced by KUBE_INGRESS_BASE_DOMAIN.
# See Clusters::Cluster#predefined_variables and https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/24580
# for more info.
# Support for AUTO_DEVOPS_DOMAIN support will be dropped on 12.0 on
#
# Suppport AUTO_DEVOPS_DOMAIN is scheduled to be removed on
# https://gitlab.com/gitlab-org/gitlab-ce/issues/52363
def
predefined_variables
Gitlab
::
Ci
::
Variables
::
Collection
.
new
.
tap
do
|
variables
|
...
...
spec/migrations/migrate_auto_dev_ops_domain_to_cluster_domain_spec.rb
View file @
30801344
...
...
@@ -55,8 +55,8 @@ describe MigrateAutoDevOpsDomainToClusterDomain, :migration do
expect
(
clusters_with_domain
.
count
).
to
eq
(
20
)
project_auto_devops_with_domain
.
each
do
|
project_auto_devops
|
cluster_project
=
Clusters
::
Project
.
find_by
(
project_id:
project_auto_devops
.
project_id
)
cluster
=
Clusters
::
Cluster
.
find
(
cluster_project
.
cluster_id
)
cluster_project
=
find_cluster_project
(
project_auto_devops
.
project_id
)
cluster
=
find_cluster
(
cluster_project
.
cluster_id
)
expect
(
cluster
.
domain
).
to
be_present
end
...
...
@@ -64,8 +64,8 @@ describe MigrateAutoDevOpsDomainToClusterDomain, :migration do
expect
(
clusters_without_domain
.
count
).
to
eq
(
25
)
project_auto_devops_without_domain
.
each
do
|
project_auto_devops
|
cluster_project
=
Clusters
::
Project
.
find_by
(
project_id:
project_auto_devops
.
project_id
)
cluster
=
Clusters
::
Cluster
.
find
(
cluster_project
.
cluster_id
)
cluster_project
=
find_cluster_project
(
project_auto_devops
.
project_id
)
cluster
=
find_cluster
(
cluster_project
.
cluster_id
)
expect
(
cluster
.
domain
).
not_to
be_present
end
...
...
@@ -88,6 +88,14 @@ describe MigrateAutoDevOpsDomainToClusterDomain, :migration do
end
end
def
find_cluster_project
(
project_id
)
cluster_projects_table
.
where
(
project_id:
project_id
).
first
end
def
find_cluster
(
cluster_id
)
clusters_table
.
where
(
id:
cluster_id
).
first
end
def
project_auto_devops_with_domain
project_auto_devops_table
.
where
.
not
(
"domain IS NULL OR domain = ''"
)
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