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
0be6a04d
Commit
0be6a04d
authored
Apr 19, 2019
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add bridged relation between Pipeline and Bridge
parent
f12c6663
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
13 additions
and
1 deletion
+13
-1
ee/app/models/ee/ci/bridge.rb
ee/app/models/ee/ci/bridge.rb
+2
-0
ee/app/models/ee/ci/pipeline.rb
ee/app/models/ee/ci/pipeline.rb
+2
-0
ee/spec/lib/gitlab/import_export/all_models.yml
ee/spec/lib/gitlab/import_export/all_models.yml
+1
-0
ee/spec/lib/gitlab/import_export/safe_model_attributes.yml
ee/spec/lib/gitlab/import_export/safe_model_attributes.yml
+2
-0
ee/spec/models/ci/bridge_spec.rb
ee/spec/models/ci/bridge_spec.rb
+4
-0
ee/spec/models/ci/pipeline_spec.rb
ee/spec/models/ci/pipeline_spec.rb
+1
-0
spec/services/ci/retry_build_service_spec.rb
spec/services/ci/retry_build_service_spec.rb
+1
-1
No files found.
ee/app/models/ee/ci/bridge.rb
View file @
0be6a04d
...
@@ -13,6 +13,8 @@ module EE
...
@@ -13,6 +13,8 @@ module EE
serialize
:yaml_variables
,
::
Gitlab
::
Serializer
::
Ci
::
Variables
serialize
:yaml_variables
,
::
Gitlab
::
Serializer
::
Ci
::
Variables
# rubocop:enable Cop/ActiveRecordSerialize
# rubocop:enable Cop/ActiveRecordSerialize
belongs_to
:source_pipeline
,
class_name:
"::Ci::Pipeline"
,
foreign_key: :bridged_pipeline_id
has_many
:sourced_pipelines
,
class_name:
"::Ci::Sources::Pipeline"
,
has_many
:sourced_pipelines
,
class_name:
"::Ci::Sources::Pipeline"
,
foreign_key: :source_job_id
foreign_key: :source_job_id
...
...
ee/app/models/ee/ci/pipeline.rb
View file @
0be6a04d
...
@@ -28,6 +28,8 @@ module EE
...
@@ -28,6 +28,8 @@ module EE
has_many
:auto_canceled_pipelines
,
class_name:
'Ci::Pipeline'
,
foreign_key:
'auto_canceled_by_id'
has_many
:auto_canceled_pipelines
,
class_name:
'Ci::Pipeline'
,
foreign_key:
'auto_canceled_by_id'
has_many
:auto_canceled_jobs
,
class_name:
'CommitStatus'
,
foreign_key:
'auto_canceled_by_id'
has_many
:auto_canceled_jobs
,
class_name:
'CommitStatus'
,
foreign_key:
'auto_canceled_by_id'
has_many
:bridged_jobs
,
class_name:
'::Ci::Bridge'
,
foreign_key: :bridged_pipeline_id
# Legacy way to fetch security reports based on job name. This has been replaced by the reports feature.
# Legacy way to fetch security reports based on job name. This has been replaced by the reports feature.
scope
:with_legacy_security_reports
,
->
do
scope
:with_legacy_security_reports
,
->
do
joins
(
:artifacts
).
where
(
ci_builds:
{
name:
%w[sast dependency_scanning sast:container container_scanning dast]
})
joins
(
:artifacts
).
where
(
ci_builds:
{
name:
%w[sast dependency_scanning sast:container container_scanning dast]
})
...
...
ee/spec/lib/gitlab/import_export/all_models.yml
View file @
0be6a04d
...
@@ -20,6 +20,7 @@ ci_pipelines:
...
@@ -20,6 +20,7 @@ ci_pipelines:
-
sourced_pipelines
-
sourced_pipelines
-
triggered_by_pipeline
-
triggered_by_pipeline
-
triggered_pipelines
-
triggered_pipelines
-
bridged_jobs
-
job_artifacts
-
job_artifacts
-
vulnerabilities_occurrence_pipelines
-
vulnerabilities_occurrence_pipelines
-
vulnerabilities
-
vulnerabilities
...
...
ee/spec/lib/gitlab/import_export/safe_model_attributes.yml
View file @
0be6a04d
...
@@ -6,3 +6,5 @@ ProjectTracingSetting:
...
@@ -6,3 +6,5 @@ ProjectTracingSetting:
-
external_url
-
external_url
Note
:
Note
:
-
review_id
-
review_id
CommitStatus
:
-
bridged_pipeline_id
ee/spec/models/ci/bridge_spec.rb
View file @
0be6a04d
...
@@ -14,6 +14,10 @@ describe Ci::Bridge do
...
@@ -14,6 +14,10 @@ describe Ci::Bridge do
{
trigger:
{
project:
'my/project'
,
branch:
'master'
}
}
{
trigger:
{
project:
'my/project'
,
branch:
'master'
}
}
end
end
it
'belongs to a source pipeline'
do
expect
(
bridge
).
to
belong_to
(
:source_pipeline
)
end
it
'has many sourced pipelines'
do
it
'has many sourced pipelines'
do
expect
(
bridge
).
to
have_many
(
:sourced_pipelines
)
expect
(
bridge
).
to
have_many
(
:sourced_pipelines
)
end
end
...
...
ee/spec/models/ci/pipeline_spec.rb
View file @
0be6a04d
...
@@ -14,6 +14,7 @@ describe Ci::Pipeline do
...
@@ -14,6 +14,7 @@ describe Ci::Pipeline do
it
{
is_expected
.
to
have_many
(
:sourced_pipelines
)
}
it
{
is_expected
.
to
have_many
(
:sourced_pipelines
)
}
it
{
is_expected
.
to
have_one
(
:triggered_by_pipeline
)
}
it
{
is_expected
.
to
have_one
(
:triggered_by_pipeline
)
}
it
{
is_expected
.
to
have_many
(
:triggered_pipelines
)
}
it
{
is_expected
.
to
have_many
(
:triggered_pipelines
)
}
it
{
is_expected
.
to
have_many
(
:bridged_jobs
)
}
it
{
is_expected
.
to
have_many
(
:job_artifacts
).
through
(
:builds
)
}
it
{
is_expected
.
to
have_many
(
:job_artifacts
).
through
(
:builds
)
}
it
{
is_expected
.
to
have_many
(
:vulnerabilities
).
through
(
:vulnerabilities_occurrence_pipelines
).
class_name
(
'Vulnerabilities::Occurrence'
)
}
it
{
is_expected
.
to
have_many
(
:vulnerabilities
).
through
(
:vulnerabilities_occurrence_pipelines
).
class_name
(
'Vulnerabilities::Occurrence'
)
}
it
{
is_expected
.
to
have_many
(
:vulnerabilities_occurrence_pipelines
).
class_name
(
'Vulnerabilities::OccurrencePipeline'
)
}
it
{
is_expected
.
to
have_many
(
:vulnerabilities_occurrence_pipelines
).
class_name
(
'Vulnerabilities::OccurrencePipeline'
)
}
...
...
spec/services/ci/retry_build_service_spec.rb
View file @
0be6a04d
...
@@ -38,7 +38,7 @@ describe Ci::RetryBuildService do
...
@@ -38,7 +38,7 @@ describe Ci::RetryBuildService do
runner_id tag_taggings taggings tags trigger_request_id
runner_id tag_taggings taggings tags trigger_request_id
user_id auto_canceled_by_id retried failure_reason
user_id auto_canceled_by_id retried failure_reason
sourced_pipelines artifacts_file_store artifacts_metadata_store
sourced_pipelines artifacts_file_store artifacts_metadata_store
metadata runner_session trace_chunks]
.
freeze
metadata runner_session trace_chunks
bridged_pipeline_id
]
.
freeze
shared_examples
'build duplication'
do
shared_examples
'build duplication'
do
let
(
:another_pipeline
)
{
create
(
:ci_empty_pipeline
,
project:
project
)
}
let
(
:another_pipeline
)
{
create
(
:ci_empty_pipeline
,
project:
project
)
}
...
...
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