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
a18ad6cf
Commit
a18ad6cf
authored
8 years ago
by
Kamil Trzciński
Committed by
Robert Speicher
8 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch 'fix-latest-pipeine-ordering-again' into 'master'
Order only for latest_successful_for See merge request !8301
parent
15aaa5a5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
2 deletions
+15
-2
app/models/ci/pipeline.rb
app/models/ci/pipeline.rb
+1
-1
changelogs/unreleased/fix-latest-pipeine-ordering.yml
changelogs/unreleased/fix-latest-pipeine-ordering.yml
+1
-1
spec/models/ci/pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+13
-0
No files found.
app/models/ci/pipeline.rb
View file @
a18ad6cf
...
...
@@ -102,7 +102,7 @@ module Ci
end
def
self
.
latest_successful_for
(
ref
)
success
.
latest
(
ref
).
first
success
.
latest
(
ref
).
order
(
id: :desc
).
first
end
def
self
.
truncate_sha
(
sha
)
...
...
This diff is collapsed.
Click to expand it.
changelogs/unreleased/fix-latest-pipeine-ordering.yml
View file @
a18ad6cf
---
title
:
Fix finding the latest pipeline
merge_request
:
8
286
merge_request
:
8
301
author
:
This diff is collapsed.
Click to expand it.
spec/models/ci/pipeline_spec.rb
View file @
a18ad6cf
...
...
@@ -462,6 +462,19 @@ describe Ci::Pipeline, models: true do
end
end
describe
'.latest_successful_for'
do
include_context
'with some outdated pipelines'
let!
(
:latest_successful_pipeline
)
do
create_pipeline
(
:success
,
'ref'
,
'D'
)
end
it
'returns the latest successful pipeline'
do
expect
(
described_class
.
latest_successful_for
(
'ref'
)).
to
eq
(
latest_successful_pipeline
)
end
end
describe
'#status'
do
let!
(
:build
)
{
create
(
:ci_build
,
:created
,
pipeline:
pipeline
,
name:
'test'
)
}
...
...
This diff is collapsed.
Click to expand it.
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