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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
85f0b3a9
Commit
85f0b3a9
authored
Mar 22, 2017
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add merge requests association to pipeline
parent
4ae411ff
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
app/models/ci/pipeline.rb
app/models/ci/pipeline.rb
+1
-0
spec/workers/pipeline_metrics_worker_spec.rb
spec/workers/pipeline_metrics_worker_spec.rb
+1
-1
No files found.
app/models/ci/pipeline.rb
View file @
85f0b3a9
...
@@ -17,6 +17,7 @@ module Ci
...
@@ -17,6 +17,7 @@ module Ci
has_many
:statuses
,
class_name:
'CommitStatus'
,
foreign_key: :commit_id
has_many
:statuses
,
class_name:
'CommitStatus'
,
foreign_key: :commit_id
has_many
:builds
,
foreign_key: :commit_id
has_many
:builds
,
foreign_key: :commit_id
has_many
:trigger_requests
,
dependent: :destroy
,
foreign_key: :commit_id
has_many
:trigger_requests
,
dependent: :destroy
,
foreign_key: :commit_id
has_many
:merge_requests
,
foreign_key:
"head_pipeline_id"
has_many
:pending_builds
,
->
{
pending
},
foreign_key: :commit_id
,
class_name:
'Ci::Build'
has_many
:pending_builds
,
->
{
pending
},
foreign_key: :commit_id
,
class_name:
'Ci::Build'
has_many
:retryable_builds
,
->
{
latest
.
failed_or_canceled
},
foreign_key: :commit_id
,
class_name:
'Ci::Build'
has_many
:retryable_builds
,
->
{
latest
.
failed_or_canceled
},
foreign_key: :commit_id
,
class_name:
'Ci::Build'
...
...
spec/workers/pipeline_metrics_worker_spec.rb
View file @
85f0b3a9
...
@@ -2,7 +2,7 @@ require 'spec_helper'
...
@@ -2,7 +2,7 @@ require 'spec_helper'
describe
PipelineMetricsWorker
do
describe
PipelineMetricsWorker
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let!
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
,
source_branch:
pipeline
.
ref
)
}
let!
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
,
source_branch:
pipeline
.
ref
,
head_pipeline_id:
pipeline
.
id
)
}
let
(
:pipeline
)
do
let
(
:pipeline
)
do
create
(
:ci_empty_pipeline
,
create
(
:ci_empty_pipeline
,
...
...
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