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
692b130e
Commit
692b130e
authored
Jul 21, 2020
by
Igor Drozdov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Inverse pipeline for its build associations
parent
2bbc4d78
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
app/models/ci/pipeline.rb
app/models/ci/pipeline.rb
+4
-4
changelogs/unreleased/id-inverse-pipeline-build.yml
changelogs/unreleased/id-inverse-pipeline-build.yml
+5
-0
No files found.
app/models/ci/pipeline.rb
View file @
692b130e
...
@@ -57,12 +57,12 @@ module Ci
...
@@ -57,12 +57,12 @@ module Ci
# the merge request's latest commit.
# the merge request's latest commit.
has_many
:merge_requests_as_head_pipeline
,
foreign_key:
"head_pipeline_id"
,
class_name:
'MergeRequest'
has_many
:merge_requests_as_head_pipeline
,
foreign_key:
"head_pipeline_id"
,
class_name:
'MergeRequest'
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'
,
inverse_of: :pipeline
has_many
:failed_builds
,
->
{
latest
.
failed
},
foreign_key: :commit_id
,
class_name:
'Ci::Build'
,
inverse_of: :pipeline
has_many
:failed_builds
,
->
{
latest
.
failed
},
foreign_key: :commit_id
,
class_name:
'Ci::Build'
,
inverse_of: :pipeline
has_many
:retryable_builds
,
->
{
latest
.
failed_or_canceled
.
includes
(
:project
)
},
foreign_key: :commit_id
,
class_name:
'Ci::Build'
has_many
:retryable_builds
,
->
{
latest
.
failed_or_canceled
.
includes
(
:project
)
},
foreign_key: :commit_id
,
class_name:
'Ci::Build'
,
inverse_of: :pipeline
has_many
:cancelable_statuses
,
->
{
cancelable
},
foreign_key: :commit_id
,
class_name:
'CommitStatus'
has_many
:cancelable_statuses
,
->
{
cancelable
},
foreign_key: :commit_id
,
class_name:
'CommitStatus'
has_many
:manual_actions
,
->
{
latest
.
manual_actions
.
includes
(
:project
)
},
foreign_key: :commit_id
,
class_name:
'Ci::Build'
has_many
:manual_actions
,
->
{
latest
.
manual_actions
.
includes
(
:project
)
},
foreign_key: :commit_id
,
class_name:
'Ci::Build'
,
inverse_of: :pipeline
has_many
:scheduled_actions
,
->
{
latest
.
scheduled_actions
.
includes
(
:project
)
},
foreign_key: :commit_id
,
class_name:
'Ci::Build'
has_many
:scheduled_actions
,
->
{
latest
.
scheduled_actions
.
includes
(
:project
)
},
foreign_key: :commit_id
,
class_name:
'Ci::Build'
,
inverse_of: :pipeline
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'
...
...
changelogs/unreleased/id-inverse-pipeline-build.yml
0 → 100644
View file @
692b130e
---
title
:
Inverse pipeline for its build associations
merge_request
:
37478
author
:
type
:
performance
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