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
85d2ac7d
Commit
85d2ac7d
authored
Dec 08, 2020
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix displaying blocking MRs with no metrics
Metrics may not exist for some older MRs, so we need to &.
parent
547ffaec
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
1 deletion
+12
-1
ee/app/serializers/blocking_merge_request_entity.rb
ee/app/serializers/blocking_merge_request_entity.rb
+1
-1
ee/changelogs/unreleased/209853-fix-blocking-mr-latest-closed-at.yml
...gs/unreleased/209853-fix-blocking-mr-latest-closed-at.yml
+5
-0
ee/spec/serializers/blocking_merge_request_entity_spec.rb
ee/spec/serializers/blocking_merge_request_entity_spec.rb
+6
-0
No files found.
ee/app/serializers/blocking_merge_request_entity.rb
View file @
85d2ac7d
...
...
@@ -29,7 +29,7 @@ class BlockingMergeRequestEntity < Grape::Entity
expose
:created_at
expose
:merged_at
expose
:closed_at
do
|
blocking_mr
|
blocking_mr
.
metrics
.
latest_closed_at
blocking_mr
.
metrics
&
.
latest_closed_at
end
private
...
...
ee/changelogs/unreleased/209853-fix-blocking-mr-latest-closed-at.yml
0 → 100644
View file @
85d2ac7d
---
title
:
Fix displaying merge request dependencies with no metrics
merge_request
:
49466
author
:
type
:
fixed
ee/spec/serializers/blocking_merge_request_entity_spec.rb
View file @
85d2ac7d
...
...
@@ -29,6 +29,12 @@ RSpec.describe BlockingMergeRequestEntity do
)
end
it
'serializes a blocking MR that lacks metrics'
do
expect
(
merge_request
).
to
receive
(
:metrics
).
and_return
(
nil
)
expect
(
entity
.
as_json
).
to
include
(
id:
merge_request
.
id
,
closed_at:
nil
)
end
describe
'#head_pipeline'
do
subject
{
entity
.
as_json
[
:head_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