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
3506d82b
Commit
3506d82b
authored
Jul 15, 2020
by
Luke Duncalfe
Committed by
James Fargher
Jul 15, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove confluence_integration feature flag
https://gitlab.com/gitlab-org/gitlab/-/issues/228731
parent
30b40fc3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
57 deletions
+9
-57
app/models/project.rb
app/models/project.rb
+4
-11
app/models/project_services/confluence_service.rb
app/models/project_services/confluence_service.rb
+0
-6
changelogs/unreleased/220934-confluence-wiki-remove-flag.yml
changelogs/unreleased/220934-confluence-wiki-remove-flag.yml
+5
-0
spec/models/project_spec.rb
spec/models/project_spec.rb
+0
-40
No files found.
app/models/project.rb
View file @
3506d82b
...
...
@@ -384,7 +384,9 @@ class Project < ApplicationRecord
delegate
:default_git_depth
,
:default_git_depth
=
,
to: :ci_cd_settings
,
prefix: :ci
delegate
:forward_deployment_enabled
,
:forward_deployment_enabled
=
,
:forward_deployment_enabled?
,
to: :ci_cd_settings
delegate
:actual_limits
,
:actual_plan_name
,
to: :namespace
,
allow_nil:
true
delegate
:allow_merge_on_skipped_pipeline
,
:allow_merge_on_skipped_pipeline?
,
:allow_merge_on_skipped_pipeline
=
,
to: :project_setting
delegate
:allow_merge_on_skipped_pipeline
,
:allow_merge_on_skipped_pipeline?
,
:allow_merge_on_skipped_pipeline
=
,
:has_confluence?
,
to: :project_setting
delegate
:active?
,
to: :prometheus_service
,
allow_nil:
true
,
prefix:
true
# Validations
...
...
@@ -1287,11 +1289,6 @@ class Project < ApplicationRecord
update_column
(
:has_external_wiki
,
services
.
external_wikis
.
any?
)
if
Gitlab
::
Database
.
read_write?
end
def
has_confluence?
ConfluenceService
.
feature_enabled?
(
self
)
&&
# rubocop:disable CodeReuse/ServiceClass
project_setting
.
has_confluence?
end
def
find_or_initialize_services
available_services_names
=
Service
.
available_services_names
-
disabled_services
...
...
@@ -1301,11 +1298,7 @@ class Project < ApplicationRecord
end
def
disabled_services
strong_memoize
(
:disabled_services
)
do
[].
tap
do
|
disabled_services
|
disabled_services
.
push
(
ConfluenceService
.
to_param
)
unless
ConfluenceService
.
feature_enabled?
(
self
)
# rubocop:disable CodeReuse/ServiceClass
end
end
[]
end
def
find_or_initialize_service
(
name
)
...
...
app/models/project_services/confluence_service.rb
View file @
3506d82b
...
...
@@ -7,8 +7,6 @@ class ConfluenceService < Service
VALID_HOST_MATCH
=
%r{
\A
.+
\.
atlassian
\.
net
\Z
}
.
freeze
VALID_PATH_MATCH
=
%r{
\A
/wiki(/|
\Z
)}
.
freeze
FEATURE_FLAG
=
:confluence_integration
prop_accessor
:confluence_url
validates
:confluence_url
,
presence:
true
,
if: :activated?
...
...
@@ -16,10 +14,6 @@ class ConfluenceService < Service
after_commit
:cache_project_has_confluence
def
self
.
feature_enabled?
(
actor
)
::
Feature
.
enabled?
(
FEATURE_FLAG
,
actor
)
end
def
self
.
to_param
'confluence'
end
...
...
changelogs/unreleased/220934-confluence-wiki-remove-flag.yml
0 → 100644
View file @
3506d82b
---
title
:
Add new Confluence integration for projects
merge_request
:
36781
author
:
type
:
added
spec/models/project_spec.rb
View file @
3506d82b
...
...
@@ -1042,32 +1042,6 @@ RSpec.describe Project do
end
end
describe
'#has_confluence?'
do
let_it_be
(
:project
)
{
build_stubbed
(
:project
)
}
it
'returns false when project_setting.has_confluence property is false'
do
project
.
project_setting
.
has_confluence
=
false
expect
(
project
.
has_confluence?
).
to
be
(
false
)
end
context
'when project_setting.has_confluence property is true'
do
before
do
project
.
project_setting
.
has_confluence
=
true
end
it
'returns true'
do
expect
(
project
.
has_confluence?
).
to
be
(
true
)
end
it
'returns false when confluence integration feature flag is disabled'
do
stub_feature_flags
(
ConfluenceService
::
FEATURE_FLAG
=>
false
)
expect
(
project
.
has_confluence?
).
to
be
(
false
)
end
end
end
describe
'#external_wiki'
do
let
(
:project
)
{
create
(
:project
)
}
...
...
@@ -5412,20 +5386,6 @@ RSpec.describe Project do
expect
(
services
.
count
).
to
eq
(
2
)
expect
(
services
.
map
(
&
:title
)).
to
eq
([
'JetBrains TeamCity CI'
,
'Pushover'
])
end
describe
'interaction with the confluence integration feature flag'
do
it
'contains a ConfluenceService when feature flag is enabled'
do
stub_feature_flags
(
ConfluenceService
::
FEATURE_FLAG
=>
true
)
expect
(
subject
.
find_or_initialize_services
).
to
include
(
ConfluenceService
)
end
it
'does not contain a ConfluenceService when the confluence integration feature flag is disabled'
do
stub_feature_flags
(
ConfluenceService
::
FEATURE_FLAG
=>
false
)
expect
(
subject
.
find_or_initialize_services
).
not_to
include
(
ConfluenceService
)
end
end
end
describe
'#find_or_initialize_service'
do
...
...
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