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
788a4d24
Commit
788a4d24
authored
Jul 06, 2020
by
Andy Soiron
Committed by
Arturo Herrero
Jul 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Merge branch 'revert-
d275ae45
' into 'master'"
This reverts merge request !35510
parent
1e4701d6
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
3 additions
and
120 deletions
+3
-120
app/models/project.rb
app/models/project.rb
+0
-1
app/models/project_services/gitlab_issue_tracker_service.rb
app/models/project_services/gitlab_issue_tracker_service.rb
+0
-45
app/models/service.rb
app/models/service.rb
+1
-3
ee/lib/ee/gitlab/usage_data.rb
ee/lib/ee/gitlab/usage_data.rb
+1
-1
lib/banzai/filter/issue_reference_filter.rb
lib/banzai/filter/issue_reference_filter.rb
+0
-4
locale/gitlab.pot
locale/gitlab.pot
+0
-3
spec/factories/services.rb
spec/factories/services.rb
+0
-6
spec/lib/gitlab/import_export/all_models.yml
spec/lib/gitlab/import_export/all_models.yml
+0
-1
spec/models/project_services/gitlab_issue_tracker_service_spec.rb
...els/project_services/gitlab_issue_tracker_service_spec.rb
+0
-54
spec/models/project_spec.rb
spec/models/project_spec.rb
+0
-1
spec/models/service_spec.rb
spec/models/service_spec.rb
+1
-1
No files found.
app/models/project.rb
View file @
788a4d24
...
@@ -168,7 +168,6 @@ class Project < ApplicationRecord
...
@@ -168,7 +168,6 @@ class Project < ApplicationRecord
has_one
:youtrack_service
has_one
:youtrack_service
has_one
:custom_issue_tracker_service
has_one
:custom_issue_tracker_service
has_one
:bugzilla_service
has_one
:bugzilla_service
has_one
:gitlab_issue_tracker_service
,
inverse_of: :project
has_one
:confluence_service
has_one
:confluence_service
has_one
:external_wiki_service
has_one
:external_wiki_service
has_one
:prometheus_service
,
inverse_of: :project
has_one
:prometheus_service
,
inverse_of: :project
...
...
app/models/project_services/gitlab_issue_tracker_service.rb
deleted
100644 → 0
View file @
1e4701d6
# frozen_string_literal: true
class
GitlabIssueTrackerService
<
IssueTrackerService
include
Gitlab
::
Routing
validates
:project_url
,
:issues_url
,
:new_issue_url
,
presence:
true
,
public_url:
true
,
if: :activated?
default_value_for
:default
,
true
def
title
'GitLab'
end
def
description
s_
(
'IssueTracker|GitLab issue tracker'
)
end
def
self
.
to_param
'gitlab'
end
def
project_url
project_issues_url
(
project
)
end
def
new_issue_url
new_project_issue_url
(
project
)
end
def
issue_url
(
iid
)
project_issue_url
(
project
,
id:
iid
)
end
def
issue_tracker_path
project_issues_path
(
project
)
end
def
new_issue_path
new_project_issue_path
(
project
)
end
def
issue_path
(
iid
)
project_issue_path
(
project
,
id:
iid
)
end
end
app/models/service.rb
View file @
788a4d24
...
@@ -55,11 +55,9 @@ class Service < ApplicationRecord
...
@@ -55,11 +55,9 @@ class Service < ApplicationRecord
validates
:instance
,
uniqueness:
{
scope: :type
},
if:
->
{
instance?
}
validates
:instance
,
uniqueness:
{
scope: :type
},
if:
->
{
instance?
}
validate
:validate_is_instance_or_template
validate
:validate_is_instance_or_template
scope
:visible
,
->
{
where
.
not
(
type:
'GitlabIssueTrackerService'
)
}
scope
:issue_trackers
,
->
{
where
(
category:
'issue_tracker'
)
}
scope
:issue_trackers
,
->
{
where
(
category:
'issue_tracker'
)
}
scope
:external_wikis
,
->
{
where
(
type:
'ExternalWikiService'
).
active
}
scope
:external_wikis
,
->
{
where
(
type:
'ExternalWikiService'
).
active
}
scope
:active
,
->
{
where
(
active:
true
)
}
scope
:active
,
->
{
where
(
active:
true
)
}
scope
:without_defaults
,
->
{
where
(
default:
false
)
}
scope
:by_type
,
->
(
type
)
{
where
(
type:
type
)
}
scope
:by_type
,
->
(
type
)
{
where
(
type:
type
)
}
scope
:by_active_flag
,
->
(
flag
)
{
where
(
active:
flag
)
}
scope
:by_active_flag
,
->
(
flag
)
{
where
(
active:
flag
)
}
scope
:templates
,
->
{
where
(
template:
true
,
type:
available_services_types
)
}
scope
:templates
,
->
{
where
(
template:
true
,
type:
available_services_types
)
}
...
@@ -77,7 +75,7 @@ class Service < ApplicationRecord
...
@@ -77,7 +75,7 @@ class Service < ApplicationRecord
scope
:wiki_page_hooks
,
->
{
where
(
wiki_page_events:
true
,
active:
true
)
}
scope
:wiki_page_hooks
,
->
{
where
(
wiki_page_events:
true
,
active:
true
)
}
scope
:deployment_hooks
,
->
{
where
(
deployment_events:
true
,
active:
true
)
}
scope
:deployment_hooks
,
->
{
where
(
deployment_events:
true
,
active:
true
)
}
scope
:alert_hooks
,
->
{
where
(
alert_events:
true
,
active:
true
)
}
scope
:alert_hooks
,
->
{
where
(
alert_events:
true
,
active:
true
)
}
scope
:external_issue_trackers
,
->
{
issue_trackers
.
active
.
without_defaults
}
scope
:external_issue_trackers
,
->
{
issue_trackers
.
active
}
scope
:deployment
,
->
{
where
(
category:
'deployment'
)
}
scope
:deployment
,
->
{
where
(
category:
'deployment'
)
}
default_value_for
:category
,
'common'
default_value_for
:category
,
'common'
...
...
ee/lib/ee/gitlab/usage_data.rb
View file @
788a4d24
...
@@ -168,7 +168,7 @@ module EE
...
@@ -168,7 +168,7 @@ module EE
merge_requests_with_optional_codeowners:
distinct_count
(
::
ApprovalMergeRequestRule
.
code_owner_approval_optional
,
:merge_request_id
),
merge_requests_with_optional_codeowners:
distinct_count
(
::
ApprovalMergeRequestRule
.
code_owner_approval_optional
,
:merge_request_id
),
merge_requests_with_required_codeowners:
distinct_count
(
::
ApprovalMergeRequestRule
.
code_owner_approval_required
,
:merge_request_id
),
merge_requests_with_required_codeowners:
distinct_count
(
::
ApprovalMergeRequestRule
.
code_owner_approval_required
,
:merge_request_id
),
projects_mirrored_with_pipelines_enabled:
count
(
::
Project
.
mirrored_with_enabled_pipelines
),
projects_mirrored_with_pipelines_enabled:
count
(
::
Project
.
mirrored_with_enabled_pipelines
),
projects_reporting_ci_cd_back_to_github:
count
(
::
GithubService
.
without_defaults
.
active
),
projects_reporting_ci_cd_back_to_github:
count
(
::
GithubService
.
active
),
projects_with_packages:
distinct_count
(
::
Packages
::
Package
,
:project_id
),
projects_with_packages:
distinct_count
(
::
Packages
::
Package
,
:project_id
),
projects_with_tracing_enabled:
count
(
ProjectTracingSetting
),
projects_with_tracing_enabled:
count
(
ProjectTracingSetting
),
status_page_projects:
count
(
::
StatusPage
::
ProjectSetting
.
enabled
),
status_page_projects:
count
(
::
StatusPage
::
ProjectSetting
.
enabled
),
...
...
lib/banzai/filter/issue_reference_filter.rb
View file @
788a4d24
...
@@ -23,10 +23,6 @@ module Banzai
...
@@ -23,10 +23,6 @@ module Banzai
issue_url
(
issue
,
project
)
issue_url
(
issue
,
project
)
end
end
def
projects_relation_for_paths
(
paths
)
super
(
paths
).
includes
(
:gitlab_issue_tracker_service
)
end
def
parent_records
(
parent
,
ids
)
def
parent_records
(
parent
,
ids
)
parent
.
issues
.
where
(
iid:
ids
.
to_a
)
parent
.
issues
.
where
(
iid:
ids
.
to_a
)
end
end
...
...
locale/gitlab.pot
View file @
788a4d24
...
@@ -13177,9 +13177,6 @@ msgstr ""
...
@@ -13177,9 +13177,6 @@ msgstr ""
msgid "IssueTracker|Custom issue tracker"
msgid "IssueTracker|Custom issue tracker"
msgstr ""
msgstr ""
msgid "IssueTracker|GitLab issue tracker"
msgstr ""
msgid "IssueTracker|Redmine issue tracker"
msgid "IssueTracker|Redmine issue tracker"
msgstr ""
msgstr ""
...
...
spec/factories/services.rb
View file @
788a4d24
...
@@ -116,12 +116,6 @@ FactoryBot.define do
...
@@ -116,12 +116,6 @@ FactoryBot.define do
issue_tracker
issue_tracker
end
end
factory
:gitlab_issue_tracker_service
do
project
active
{
true
}
issue_tracker
end
trait
:issue_tracker
do
trait
:issue_tracker
do
transient
do
transient
do
create_data
{
true
}
create_data
{
true
}
...
...
spec/lib/gitlab/import_export/all_models.yml
View file @
788a4d24
...
@@ -353,7 +353,6 @@ project:
...
@@ -353,7 +353,6 @@ project:
-
youtrack_service
-
youtrack_service
-
custom_issue_tracker_service
-
custom_issue_tracker_service
-
bugzilla_service
-
bugzilla_service
-
gitlab_issue_tracker_service
-
external_wiki_service
-
external_wiki_service
-
mock_ci_service
-
mock_ci_service
-
mock_deployment_service
-
mock_deployment_service
...
...
spec/models/project_services/gitlab_issue_tracker_service_spec.rb
deleted
100644 → 0
View file @
1e4701d6
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
GitlabIssueTrackerService
do
describe
"Associations"
do
it
{
is_expected
.
to
belong_to
:project
}
it
{
is_expected
.
to
have_one
:service_hook
}
end
describe
'Validations'
do
context
'when service is active'
do
subject
{
described_class
.
new
(
project:
create
(
:project
),
active:
true
)
}
it
{
is_expected
.
to
validate_presence_of
(
:issues_url
)
}
it_behaves_like
'issue tracker service URL attribute'
,
:issues_url
end
context
'when service is inactive'
do
subject
{
described_class
.
new
(
project:
create
(
:project
),
active:
false
)
}
it
{
is_expected
.
not_to
validate_presence_of
(
:issues_url
)
}
end
end
describe
'project and issue urls'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:service
)
{
project
.
create_gitlab_issue_tracker_service
(
active:
true
)
}
context
'with absolute urls'
do
before
do
allow
(
described_class
).
to
receive
(
:default_url_options
).
and_return
(
script_name:
"/gitlab/root"
)
end
it
'gives the correct path'
do
expect
(
service
.
project_url
).
to
eq
(
"http://
#{
Gitlab
.
config
.
gitlab
.
host
}
/gitlab/root/
#{
project
.
full_path
}
/-/issues"
)
expect
(
service
.
new_issue_url
).
to
eq
(
"http://
#{
Gitlab
.
config
.
gitlab
.
host
}
/gitlab/root/
#{
project
.
full_path
}
/-/issues/new"
)
expect
(
service
.
issue_url
(
432
)).
to
eq
(
"http://
#{
Gitlab
.
config
.
gitlab
.
host
}
/gitlab/root/
#{
project
.
full_path
}
/-/issues/432"
)
end
end
context
'with relative urls'
do
before
do
allow
(
described_class
).
to
receive
(
:default_url_options
).
and_return
(
script_name:
"/gitlab/root"
)
end
it
'gives the correct path'
do
expect
(
service
.
issue_tracker_path
).
to
eq
(
"/gitlab/root/
#{
project
.
full_path
}
/-/issues"
)
expect
(
service
.
new_issue_path
).
to
eq
(
"/gitlab/root/
#{
project
.
full_path
}
/-/issues/new"
)
expect
(
service
.
issue_path
(
432
)).
to
eq
(
"/gitlab/root/
#{
project
.
full_path
}
/-/issues/432"
)
end
end
end
end
spec/models/project_spec.rb
View file @
788a4d24
...
@@ -61,7 +61,6 @@ RSpec.describe Project do
...
@@ -61,7 +61,6 @@ RSpec.describe Project do
it
{
is_expected
.
to
have_one
(
:youtrack_service
)
}
it
{
is_expected
.
to
have_one
(
:youtrack_service
)
}
it
{
is_expected
.
to
have_one
(
:custom_issue_tracker_service
)
}
it
{
is_expected
.
to
have_one
(
:custom_issue_tracker_service
)
}
it
{
is_expected
.
to
have_one
(
:bugzilla_service
)
}
it
{
is_expected
.
to
have_one
(
:bugzilla_service
)
}
it
{
is_expected
.
to
have_one
(
:gitlab_issue_tracker_service
)
}
it
{
is_expected
.
to
have_one
(
:external_wiki_service
)
}
it
{
is_expected
.
to
have_one
(
:external_wiki_service
)
}
it
{
is_expected
.
to
have_one
(
:confluence_service
)
}
it
{
is_expected
.
to
have_one
(
:confluence_service
)
}
it
{
is_expected
.
to
have_one
(
:project_feature
)
}
it
{
is_expected
.
to
have_one
(
:project_feature
)
}
...
...
spec/models/service_spec.rb
View file @
788a4d24
...
@@ -535,7 +535,7 @@ RSpec.describe Service do
...
@@ -535,7 +535,7 @@ RSpec.describe Service do
describe
'initialize service with no properties'
do
describe
'initialize service with no properties'
do
let
(
:service
)
do
let
(
:service
)
do
GitlabIssueTracker
Service
.
create
(
Bugzilla
Service
.
create
(
project:
create
(
:project
),
project:
create
(
:project
),
project_url:
'http://gitlab.example.com'
project_url:
'http://gitlab.example.com'
)
)
...
...
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