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
Boxiang Sun
gitlab-ce
Commits
c2786c97
Commit
c2786c97
authored
Dec 21, 2016
by
Yorick Peterse
Committed by
Douglas Barbosa Alexandre
Dec 21, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch '25908-fix-grape-after-update' into 'master'
Use Grape's new Route methods See merge request !8223
parent
fac8ce63
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
4 deletions
+8
-4
changelogs/unreleased/25908-fix-grape-after-update.yml
changelogs/unreleased/25908-fix-grape-after-update.yml
+4
-0
lib/gitlab/metrics/rack_middleware.rb
lib/gitlab/metrics/rack_middleware.rb
+2
-2
spec/lib/gitlab/metrics/rack_middleware_spec.rb
spec/lib/gitlab/metrics/rack_middleware_spec.rb
+2
-2
No files found.
changelogs/unreleased/25908-fix-grape-after-update.yml
0 → 100644
View file @
c2786c97
---
title
:
Use Grape's new Route methods
merge_request
:
author
:
lib/gitlab/metrics/rack_middleware.rb
View file @
c2786c97
...
...
@@ -70,8 +70,8 @@ module Gitlab
def
tag_endpoint
(
trans
,
env
)
endpoint
=
env
[
ENDPOINT_KEY
]
path
=
endpoint_paths_cache
[
endpoint
.
route
.
r
oute_method
][
endpoint
.
route
.
route_
path
]
trans
.
action
=
"Grape#
#{
endpoint
.
route
.
r
oute
_method
}
#{
path
}
"
path
=
endpoint_paths_cache
[
endpoint
.
route
.
r
equest_method
][
endpoint
.
route
.
path
]
trans
.
action
=
"Grape#
#{
endpoint
.
route
.
r
equest
_method
}
#{
path
}
"
end
private
...
...
spec/lib/gitlab/metrics/rack_middleware_spec.rb
View file @
c2786c97
...
...
@@ -33,7 +33,7 @@ describe Gitlab::Metrics::RackMiddleware do
end
it
'tags a transaction with the method and path of the route in the grape endpoint'
do
route
=
double
(
:route
,
r
oute_method:
"GET"
,
route_
path:
"/:version/projects/:id/archive(.:format)"
)
route
=
double
(
:route
,
r
equest_method:
"GET"
,
path:
"/:version/projects/:id/archive(.:format)"
)
endpoint
=
double
(
:endpoint
,
route:
route
)
env
[
'api.endpoint'
]
=
endpoint
...
...
@@ -117,7 +117,7 @@ describe Gitlab::Metrics::RackMiddleware do
let
(
:transaction
)
{
middleware
.
transaction_from_env
(
env
)
}
it
'tags a transaction with the method and path of the route in the grape endpount'
do
route
=
double
(
:route
,
r
oute_method:
"GET"
,
route_
path:
"/:version/projects/:id/archive(.:format)"
)
route
=
double
(
:route
,
r
equest_method:
"GET"
,
path:
"/:version/projects/:id/archive(.:format)"
)
endpoint
=
double
(
:endpoint
,
route:
route
)
env
[
'api.endpoint'
]
=
endpoint
...
...
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