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
b25c85a1
Commit
b25c85a1
authored
Jun 18, 2021
by
Alex Kalderimis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename github project integration
Renames project association from github_service to github_integration.
parent
6700c65b
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
27 additions
and
16 deletions
+27
-16
ee/app/models/ee/integration.rb
ee/app/models/ee/integration.rb
+9
-0
ee/app/models/ee/project.rb
ee/app/models/ee/project.rb
+2
-2
ee/app/services/ci_cd/github_integration_setup_service.rb
ee/app/services/ci_cd/github_integration_setup_service.rb
+1
-1
ee/lib/ee/gitlab/usage_data.rb
ee/lib/ee/gitlab/usage_data.rb
+1
-1
ee/spec/factories/integrations.rb
ee/spec/factories/integrations.rb
+1
-1
ee/spec/lib/ee/gitlab/usage_data_spec.rb
ee/spec/lib/ee/gitlab/usage_data_spec.rb
+1
-1
ee/spec/models/project_spec.rb
ee/spec/models/project_spec.rb
+8
-6
ee/spec/services/ci_cd/github_integration_setup_service_spec.rb
...c/services/ci_cd/github_integration_setup_service_spec.rb
+1
-1
ee/spec/services/ci_cd/github_setup_service_spec.rb
ee/spec/services/ci_cd/github_setup_service_spec.rb
+1
-1
ee/spec/services/ee/integrations/test/project_service_spec.rb
...pec/services/ee/integrations/test/project_service_spec.rb
+1
-1
spec/lib/gitlab/import_export/all_models.yml
spec/lib/gitlab/import_export/all_models.yml
+1
-1
No files found.
ee/app/models/ee/integration.rb
View file @
b25c85a1
...
...
@@ -12,6 +12,10 @@ module EE
github
]
.
freeze
EE_RENAMED_TO_INTEGRATION
=
%w[
github
]
.
to_set
.
freeze
class_methods
do
extend
::
Gitlab
::
Utils
::
Override
...
...
@@ -21,6 +25,11 @@ module EE
integrations
+=
EE_COM_PROJECT_SPECIFIC_INTEGRATION_NAMES
if
::
Gitlab
.
com?
integrations
end
override
:renamed?
def
renamed?
(
name
)
EE_RENAMED_TO_INTEGRATION
.
include?
(
name
)
||
super
end
end
end
end
ee/app/models/ee/project.rb
View file @
b25c85a1
...
...
@@ -41,7 +41,7 @@ module EE
has_one
:push_rule
,
->
(
project
)
{
project
&
.
feature_available?
(
:push_rules
)
?
all
:
none
},
inverse_of: :project
has_one
:index_status
has_one
:github_
service
,
class_name:
'Integrations::Github'
has_one
:github_
integration
,
class_name:
'Integrations::Github'
has_one
:gitlab_slack_application_service
,
class_name:
'Integrations::GitlabSlackApplication'
has_one
:status_page_setting
,
inverse_of: :project
,
class_name:
'StatusPage::ProjectSetting'
...
...
@@ -151,7 +151,7 @@ module EE
scope
:with_security_reports_stored
,
->
{
where
(
'EXISTS (?)'
,
::
Vulnerabilities
::
Finding
.
scoped_project
.
select
(
1
))
}
scope
:with_security_reports
,
->
{
where
(
'EXISTS (?)'
,
::
Ci
::
JobArtifact
.
security_reports
.
scoped_project
.
select
(
1
))
}
scope
:with_github_
service_pipeline_events
,
->
{
joins
(
:github_service
).
merge
(
::
Integrations
::
Github
.
pipeline_hooks
)
}
scope
:with_github_
integration_pipeline_events
,
->
{
joins
(
:github_integration
).
merge
(
::
Integrations
::
Github
.
pipeline_hooks
)
}
scope
:with_active_prometheus_integration
,
->
{
joins
(
:prometheus_integration
).
merge
(
::
Integrations
::
Prometheus
.
active
)
}
scope
:with_enabled_incident_sla
,
->
{
joins
(
:incident_management_setting
).
where
(
project_incident_management_settings:
{
sla_timer:
true
})
}
scope
:mirrored_with_enabled_pipelines
,
->
do
...
...
ee/app/services/ci_cd/github_integration_setup_service.rb
View file @
b25c85a1
...
...
@@ -15,7 +15,7 @@ module CiCd
private
def
github_integration
@github_integration
||=
project
.
build_github_
service
(
github_params
)
@github_integration
||=
project
.
build_github_
integration
(
github_params
)
end
def
github_params
...
...
ee/lib/ee/gitlab/usage_data.rb
View file @
b25c85a1
...
...
@@ -348,7 +348,7 @@ module EE
override
:usage_activity_by_stage_verify
def
usage_activity_by_stage_verify
(
time_period
)
super
.
merge
({
projects_reporting_ci_cd_back_to_github:
distinct_count
(
::
Project
.
with_github_
service
_pipeline_events
.
where
(
time_period
),
:creator_id
)
projects_reporting_ci_cd_back_to_github:
distinct_count
(
::
Project
.
with_github_
integration
_pipeline_events
.
where
(
time_period
),
:creator_id
)
})
end
...
...
ee/spec/factories/integrations.rb
View file @
b25c85a1
...
...
@@ -7,7 +7,7 @@ FactoryBot.define do
type
{
'GitlabSlackApplicationService'
}
end
factory
:github_
service
,
class:
'Integrations::Github'
do
factory
:github_
integration
,
class:
'Integrations::Github'
do
project
type
{
'GithubService'
}
active
{
true
}
...
...
ee/spec/lib/ee/gitlab/usage_data_spec.rb
View file @
b25c85a1
...
...
@@ -777,7 +777,7 @@ RSpec.describe Gitlab::UsageData do
describe
'usage_activity_by_stage_verify'
do
it
'includes accurate usage_activity_by_stage data'
do
for_defined_days_back
do
create
(
:github_
service
)
create
(
:github_
integration
)
end
expect
(
described_class
.
usage_activity_by_stage_verify
({})).
to
include
(
...
...
ee/spec/models/project_spec.rb
View file @
b25c85a1
...
...
@@ -54,7 +54,7 @@ RSpec.describe Project do
it
{
is_expected
.
to
have_many
(
:vulnerability_historical_statistics
).
class_name
(
'Vulnerabilities::HistoricalStatistic'
)
}
it
{
is_expected
.
to
have_many
(
:vulnerability_remediations
).
class_name
(
'Vulnerabilities::Remediation'
)
}
it
{
is_expected
.
to
have_one
(
:github_
service
)
}
it
{
is_expected
.
to
have_one
(
:github_
integration
)
}
it
{
is_expected
.
to
have_many
(
:project_aliases
)
}
it
{
is_expected
.
to
have_many
(
:approval_rules
)
}
...
...
@@ -295,13 +295,15 @@ RSpec.describe Project do
end
end
describe
'.with_github_
service
_pipeline_events'
do
describe
'.with_github_
integration
_pipeline_events'
do
it
'returns the correct project'
do
project_with_github_
service_pipeline_events
=
create
(
:project
,
github_service:
create
(
:github_service
))
project_without_github_
service
_pipeline_events
=
create
(
:project
)
project_with_github_
integration_pipeline_events
=
create
(
:project
,
github_integration:
create
(
:github_integration
))
project_without_github_
integration
_pipeline_events
=
create
(
:project
)
expect
(
described_class
.
with_github_service_pipeline_events
).
to
include
(
project_with_github_service_pipeline_events
)
expect
(
described_class
.
with_github_service_pipeline_events
).
not_to
include
(
project_without_github_service_pipeline_events
)
expect
(
described_class
.
with_github_integration_pipeline_events
)
.
to
include
(
project_with_github_integration_pipeline_events
)
expect
(
described_class
.
with_github_integration_pipeline_events
)
.
not_to
include
(
project_without_github_integration_pipeline_events
)
end
end
...
...
ee/spec/services/ci_cd/github_integration_setup_service_spec.rb
View file @
b25c85a1
...
...
@@ -20,7 +20,7 @@ RSpec.describe CiCd::GithubIntegrationSetupService do
end
describe
'sets up GitHub service integration'
do
let
(
:integration
)
{
project
.
github_
service
}
let
(
:integration
)
{
project
.
github_
integration
}
specify
'with API token'
do
expect
(
integration
.
token
).
to
eq
api_token
...
...
ee/spec/services/ci_cd/github_setup_service_spec.rb
View file @
b25c85a1
...
...
@@ -29,7 +29,7 @@ RSpec.describe CiCd::GithubSetupService do
subject
.
execute
expect
(
project
.
github_
service
).
to
be_active
expect
(
project
.
github_
integration
).
to
be_active
end
end
end
ee/spec/services/ee/integrations/test/project_service_spec.rb
View file @
b25c85a1
...
...
@@ -14,7 +14,7 @@ RSpec.describe ::Integrations::Test::ProjectService do
context
'without event specified'
do
context
'GitHubService'
do
let
(
:integration
)
{
create
(
:github_
service
,
project:
project
)
}
let
(
:integration
)
{
create
(
:github_
integration
,
project:
project
)
}
it_behaves_like
'tests for integration with pipeline data'
end
...
...
spec/lib/gitlab/import_export/all_models.yml
View file @
b25c85a1
...
...
@@ -481,7 +481,7 @@ project:
-
error_tracking_setting
-
metrics_setting
-
gitlab_slack_application_service
-
github_
service
-
github_
integration
-
protected_environments
-
mirror_user
-
push_rule
...
...
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