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
c9fdf739
Commit
c9fdf739
authored
Dec 21, 2016
by
Yorick Peterse
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '25908-fix-grape-after-update' into 'master'
Use Grape's new Route methods See merge request !8223
parents
845e2d36
90c6a1a3
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 @
c9fdf739
---
title
:
Use Grape's new Route methods
merge_request
:
author
:
lib/gitlab/metrics/rack_middleware.rb
View file @
c9fdf739
...
...
@@ -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 @
c9fdf739
...
...
@@ -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