Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(394)

Issue 2043423004: Make HTTP middleware easier to use (Closed)

Created:
4 years, 6 months ago by nishanths
Modified:
4 years, 6 months ago
CC:
chromium-reviews, infra-reviews+luci-go_chromium.org, andrew.wang, todd, tandrii+luci-go_chromium.org, M-A Ruel
Base URL:
https://github.com/luci/luci-go@master
Target Ref:
refs/heads/master
Project:
luci-go
Visibility:
Public.

Description

This adds a new router package that wraps around the previously used router (julienschmidt/httprouter). The new package adds support to register HTTP middleware linearly via the Use function or when registering handlers. The new package also allows creating subrouters that carry middleware over from the router they are derived from. The source code and tests are updated to use the new router package. Noteworthy points from the refactoring process: * InstallHandlers accept router.MiddlewareChain as argument instead of the previous middleware.Base. * auth.Autologin middleware is no longer coupled with admin.adminOnly. * gaetesting.BaseTest has been removed. Use gaetesting.TestingContext directly instead. BUG=617774 Committed: https://github.com/luci/luci-go/commit/d1ceacb1d00aa31b8fbd37a13c24c28f3650bd95

Patch Set 1 #

Total comments: 1

Patch Set 2 : Add GET, POST, Handler methods to router #

Patch Set 3 : Fixes to middleware append related functions, docs #

Total comments: 6

Patch Set 4 : Make router and handlers Context-based #

Patch Set 5 : Router: API changes: remove InitialContext function #

Patch Set 6 : Begin using new router API in source files #

Patch Set 7 : Update tests #

Total comments: 36

Patch Set 8 : Checkout origin/master to restore source code #

Patch Set 9 : router: Update router package after comments #

Patch Set 10 : router: Fix doc comment #

Patch Set 11 : router: Fix run function; fix registered path #

Patch Set 12 : router: Update middleware merge and Run functions #

Patch Set 13 : router: Add package tests #

Patch Set 14 : router: Do not allocate merged array in Handle #

Total comments: 40

Patch Set 15 : router: Update documentation and improve code style #

Total comments: 23

Patch Set 16 : router: Remove unused functions #

Patch Set 17 : router: Improve documentation style #

Total comments: 34

Patch Set 18 : router: Remove unused vars in example test #

Patch Set 19 : router: Improve tests #

Total comments: 2

Patch Set 20 : router: Move client to top in test file #

Patch Set 21 : router: remove unecessary type assertion in tests #

Total comments: 11

Patch Set 22 : address Vadim's comments #

Total comments: 5

Patch Set 23 : router: Embed ResponseWriter, remove StatusCode and Written #

Patch Set 24 : router: Update Middleware comment #

Total comments: 7

Patch Set 25 : router: Remove unused status field in Context #

Patch Set 26 : router: Remove unused Run method #

Patch Set 27 : router: do not embed context.Context and http.ResponseWriter in Context #

Patch Set 28 : Convert generic code in server/* and appengine/* #

Patch Set 29 : Rebase origin/master #

Total comments: 16

Patch Set 30 : Fixes for comments #

Patch Set 31 : router: tests for nil middleware in run #

Patch Set 32 : Convert remaining source files #

Total comments: 1

Patch Set 33 : Fixes to makeBasePath and path registration #

Patch Set 34 : Update tests #

Total comments: 2

Patch Set 35 : Rename InstallWebHandlers -> InstallHandlers #

Patch Set 36 : gaemiddleware: add middleware func for WithProd #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1464 lines, -864 lines) Patch
M appengine/cmd/cron/frontend/handler.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 4 chunks +67 lines, -84 lines 0 comments Download
M appengine/cmd/cron/ui/common.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 1 chunk +15 lines, -17 lines 0 comments Download
M appengine/cmd/cron/ui/index.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 1 chunk +5 lines, -9 lines 0 comments Download
M appengine/cmd/cron/ui/invocation.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 1 chunk +22 lines, -24 lines 0 comments Download
M appengine/cmd/cron/ui/job.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 3 chunks +21 lines, -19 lines 0 comments Download
M appengine/cmd/cron/ui/project.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 1 chunk +6 lines, -10 lines 0 comments Download
M appengine/cmd/dm/distributor/handlers.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 1 chunk +10 lines, -14 lines 0 comments Download
M appengine/cmd/dm/distributor/pubsub.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 1 chunk +4 lines, -3 lines 0 comments Download
M appengine/cmd/dm/distributor/tq_handler.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 1 chunk +5 lines, -5 lines 0 comments Download
M appengine/cmd/dm/frontend/init.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 1 chunk +25 lines, -19 lines 0 comments Download
M appengine/cmd/helloworld/frontend/handler.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 3 chunks +18 lines, -17 lines 0 comments Download
M appengine/cmd/helloworld_mvm/backend/main.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 1 chunk +9 lines, -14 lines 0 comments Download
M appengine/cmd/helloworld_mvm/frontend/main.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 2 chunks +15 lines, -13 lines 0 comments Download
M appengine/cmd/logdog_coordinator/backend/main.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 1 chunk +4 lines, -4 lines 0 comments Download
M appengine/cmd/logdog_coordinator/services/main.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 1 chunk +11 lines, -10 lines 0 comments Download
M appengine/cmd/logdog_coordinator/vmuser/main.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 1 chunk +13 lines, -16 lines 0 comments Download
M appengine/cmd/milo/buildbot/pubsub.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 2 chunks +4 lines, -4 lines 0 comments Download
M appengine/cmd/milo/buildbot/pubsub_test.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 3 chunks +31 lines, -5 lines 0 comments Download
M appengine/cmd/milo/frontend/milo.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 1 chunk +12 lines, -17 lines 0 comments Download
M appengine/cmd/milo/settings/settings.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 2 chunks +4 lines, -2 lines 0 comments Download
M appengine/cmd/milo/settings/themes.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 2 chunks +21 lines, -20 lines 0 comments Download
M appengine/cmd/tokenserver/frontend/main.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 2 chunks +25 lines, -25 lines 0 comments Download
M appengine/gaeauth/server/default.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 1 chunk +3 lines, -7 lines 0 comments Download
M appengine/gaeauth/server/internal/authdb/handlers.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 2 chunks +11 lines, -12 lines 0 comments Download
M appengine/gaeauth/server/internal/authdb/handlers_test.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 1 chunk +21 lines, -4 lines 0 comments Download
M appengine/gaemiddleware/appengine.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 1 chunk +19 lines, -22 lines 0 comments Download
M appengine/gaemiddleware/appengine_test.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 1 chunk +59 lines, -24 lines 0 comments Download
M appengine/gaemiddleware/context.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 2 chunks +16 lines, -13 lines 0 comments Download
M appengine/gaemiddleware/routes.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 1 chunk +3 lines, -4 lines 0 comments Download
M appengine/gaetesting/middleware.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 1 chunk +1 line, -13 lines 0 comments Download
M appengine/logdog/coordinator/config/middleware.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 1 chunk +8 lines, -13 lines 0 comments Download
M appengine/logdog/coordinator/service.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 2 chunks +5 lines, -9 lines 0 comments Download
M appengine/tsmon/global_callback_test.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 2 chunks +11 lines, -3 lines 0 comments Download
M appengine/tsmon/handler.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 1 chunk +10 lines, -11 lines 0 comments Download
M appengine/tsmon/handler_test.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 3 chunks +16 lines, -3 lines 0 comments Download
M appengine/tsmon/middleware.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 2 chunks +24 lines, -24 lines 0 comments Download
M appengine/tsmon/middleware_test.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 3 chunks +41 lines, -24 lines 0 comments Download
M appengine/tumble/service.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 3 chunks +17 lines, -19 lines 0 comments Download
M appengine/tumble/tumbletest.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 2 chunks +18 lines, -8 lines 0 comments Download
M common/prpc/talk/buildbot/frontend/handler.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 1 chunk +6 lines, -7 lines 0 comments Download
M common/prpc/talk/buildbot/frontend/prpc.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 1 chunk +3 lines, -5 lines 0 comments Download
M common/prpc/talk/helloworld/frontend/handler.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 1 chunk +6 lines, -7 lines 0 comments Download
M common/prpc/talk/helloworld/frontend/prpc.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 1 chunk +3 lines, -5 lines 0 comments Download
M common/testing/prpctest/server.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 1 chunk +18 lines, -10 lines 0 comments Download
M server/auth/context.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 2 chunks +57 lines, -59 lines 0 comments Download
M server/auth/context_test.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 2 chunks +30 lines, -23 lines 0 comments Download
M server/auth/db.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 2 chunks +6 lines, -7 lines 0 comments Download
M server/auth/handlers.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 1 chunk +11 lines, -13 lines 0 comments Download
M server/auth/info/info.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 2 chunks +9 lines, -10 lines 0 comments Download
M server/auth/info/info_test.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 2 chunks +10 lines, -6 lines 0 comments Download
M server/auth/openid/method.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 5 chunks +14 lines, -9 lines 0 comments Download
M server/auth/openid/method_test.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 5 chunks +21 lines, -4 lines 0 comments Download
M server/auth/signing/context.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 2 chunks +9 lines, -11 lines 0 comments Download
M server/auth/signing/context_test.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 1 chunk +7 lines, -10 lines 0 comments Download
M server/auth/xsrf/xsrf.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 2 chunks +14 lines, -17 lines 0 comments Download
M server/auth/xsrf/xsrf_test.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 2 chunks +20 lines, -7 lines 0 comments Download
M server/middleware/paniccatcher.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 1 chunk +14 lines, -15 lines 0 comments Download
M server/prpc/server.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 2 chunks +31 lines, -32 lines 0 comments Download
M server/prpc/server_test.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 2 chunks +8 lines, -4 lines 0 comments Download
A server/router/example_test.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 1 chunk +92 lines, -0 lines 0 comments Download
A server/router/handler.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 1 chunk +51 lines, -0 lines 0 comments Download
A server/router/router.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 1 chunk +137 lines, -0 lines 0 comments Download
A server/router/router_test.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 1 chunk +217 lines, -0 lines 0 comments Download
M server/settings/admin/handlers.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 3 chunks +23 lines, -24 lines 0 comments Download
M server/settings/admin/index.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 1 chunk +4 lines, -4 lines 0 comments Download
M server/settings/admin/settings.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 3 chunks +7 lines, -2 lines 0 comments Download
M server/templates/middleware.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 1 chunk +6 lines, -9 lines 0 comments Download

Messages

Total messages: 98 (32 generated)
nishanths
On 2016/06/09 04:17:54, nishanths1 wrote: > mailto:nishanths@google.com changed reviewers: > + mailto:estaab@chromium.org, mailto:iannucci@chromium.org, mailto:vadim@chromium.org Thoughts ...
4 years, 6 months ago (2016-06-09 04:21:22 UTC) #3
nishanths
https://codereview.chromium.org/2043423004/diff/1/server/middleware/middleware.go File server/middleware/middleware.go (right): https://codereview.chromium.org/2043423004/diff/1/server/middleware/middleware.go#newcode22 server/middleware/middleware.go:22: type ChainedHandler func(context.Context, http.ResponseWriter, *http.Request, httprouter.Params, Handler) ChainedHandler can ...
4 years, 6 months ago (2016-06-09 04:23:48 UTC) #4
iannucci
https://codereview.chromium.org/2043423004/diff/40001/server/middleware/middleware.go File server/middleware/middleware.go (right): https://codereview.chromium.org/2043423004/diff/40001/server/middleware/middleware.go#newcode22 server/middleware/middleware.go:22: type ChainedHandler func(context.Context, http.ResponseWriter, *http.Request, httprouter.Params, Handler) Since we ...
4 years, 6 months ago (2016-06-09 21:30:08 UTC) #5
Vadim Sh.
https://codereview.chromium.org/2043423004/diff/40001/server/middleware/middleware.go File server/middleware/middleware.go (right): https://codereview.chromium.org/2043423004/diff/40001/server/middleware/middleware.go#newcode22 server/middleware/middleware.go:22: type ChainedHandler func(context.Context, http.ResponseWriter, *http.Request, httprouter.Params, Handler) On 2016/06/09 ...
4 years, 6 months ago (2016-06-09 21:45:12 UTC) #7
nishanths
I've added new Patch Sets. Here's a description on the contents. Patch Set 1-5: New ...
4 years, 6 months ago (2016-06-13 17:30:29 UTC) #8
nishanths
https://codereview.chromium.org/2043423004/diff/40001/server/middleware/middleware.go File server/middleware/middleware.go (right): https://codereview.chromium.org/2043423004/diff/40001/server/middleware/middleware.go#newcode22 server/middleware/middleware.go:22: type ChainedHandler func(context.Context, http.ResponseWriter, *http.Request, httprouter.Params, Handler) On 2016/06/09 ...
4 years, 6 months ago (2016-06-13 17:30:44 UTC) #9
hinoka
https://codereview.chromium.org/2043423004/diff/120001/appengine/cmd/milo/settings/themes.go File appengine/cmd/milo/settings/themes.go (left): https://codereview.chromium.org/2043423004/diff/120001/appengine/cmd/milo/settings/themes.go#oldcode191 appengine/cmd/milo/settings/themes.go:191: return Base(hx) Don't we still need to install the ...
4 years, 6 months ago (2016-06-13 18:31:21 UTC) #11
dnj (Google)
https://codereview.chromium.org/2043423004/diff/120001/server/router/router.go File server/router/router.go (right): https://codereview.chromium.org/2043423004/diff/120001/server/router/router.go#newcode19 server/router/router.go:19: // the router, a list of handlers, and configuration. ...
4 years, 6 months ago (2016-06-13 18:50:42 UTC) #13
iannucci
generally lg, but I'm increasingly uneasy about Abort. It feels like the handler that calls ...
4 years, 6 months ago (2016-06-13 19:23:29 UTC) #14
nodir
https://codereview.chromium.org/2043423004/diff/120001/server/router/doc.go File server/router/doc.go (right): https://codereview.chromium.org/2043423004/diff/120001/server/router/doc.go#newcode5 server/router/doc.go:5: /* I think we use // everywhere https://codereview.chromium.org/2043423004/diff/120001/server/router/doc.go#newcode6 server/router/doc.go:6: ...
4 years, 6 months ago (2016-06-13 20:20:52 UTC) #16
nodir
https://codereview.chromium.org/2043423004/diff/120001/server/router/router.go File server/router/router.go (right): https://codereview.chromium.org/2043423004/diff/120001/server/router/router.go#newcode166 server/router/router.go:166: c.aborted = true On 2016/06/13 20:20:52, nodir wrote: > ...
4 years, 6 months ago (2016-06-13 20:26:48 UTC) #17
nodir
one more simplification idea, sorry for many messages https://codereview.chromium.org/2043423004/diff/120001/server/router/router.go File server/router/router.go (right): https://codereview.chromium.org/2043423004/diff/120001/server/router/router.go#newcode166 server/router/router.go:166: c.aborted ...
4 years, 6 months ago (2016-06-13 20:29:36 UTC) #18
nishanths
https://codereview.chromium.org/2043423004/diff/120001/appengine/cmd/milo/buildbot/pubsub_test.go File appengine/cmd/milo/buildbot/pubsub_test.go (right): https://codereview.chromium.org/2043423004/diff/120001/appengine/cmd/milo/buildbot/pubsub_test.go#newcode170 appengine/cmd/milo/buildbot/pubsub_test.go:170: PubSubHandler(&router.Context{Context: c, Writer: h, Request: r, Params: p}) On ...
4 years, 6 months ago (2016-06-15 18:25:08 UTC) #19
nishanths
Thanks for the feedback. Uploaded few patch sets based on the discussion at https://docs.google.com/document/d/1daiHkDisRor0tX0KZyhRAL4h7qgF0aYydIEixI-fT6I/edit Summary: ...
4 years, 6 months ago (2016-06-15 18:25:20 UTC) #20
nodir
https://codereview.chromium.org/2043423004/diff/120001/server/router/router.go File server/router/router.go (right): https://codereview.chromium.org/2043423004/diff/120001/server/router/router.go#newcode67 server/router/router.go:67: func (r *Router) Group(relativePath string) *Router { I think ...
4 years, 6 months ago (2016-06-15 20:14:44 UTC) #21
nishanths
If this looks alright, I can begin refactoring the source code to use this new ...
4 years, 6 months ago (2016-06-16 00:14:19 UTC) #22
nishanths
https://codereview.chromium.org/2043423004/diff/120001/server/router/router.go File server/router/router.go (right): https://codereview.chromium.org/2043423004/diff/120001/server/router/router.go#newcode67 server/router/router.go:67: func (r *Router) Group(relativePath string) *Router { On 2016/06/15 ...
4 years, 6 months ago (2016-06-16 00:18:09 UTC) #23
iannucci
neat :) https://codereview.chromium.org/2043423004/diff/280001/server/router/example_test.go File server/router/example_test.go (right): https://codereview.chromium.org/2043423004/diff/280001/server/router/example_test.go#newcode74 server/router/example_test.go:74: log.Fatal(http.ListenAndServe(":8080", nil)) I think you need // ...
4 years, 6 months ago (2016-06-16 00:54:25 UTC) #24
nishanths
https://codereview.chromium.org/2043423004/diff/280001/server/router/example_test.go File server/router/example_test.go (right): https://codereview.chromium.org/2043423004/diff/280001/server/router/example_test.go#newcode74 server/router/example_test.go:74: log.Fatal(http.ListenAndServe(":8080", nil)) On 2016/06/16 00:54:24, iannucci wrote: > I ...
4 years, 6 months ago (2016-06-16 03:43:29 UTC) #25
nodir
https://codereview.chromium.org/2043423004/diff/280001/server/router/handler.go File server/router/handler.go (right): https://codereview.chromium.org/2043423004/diff/280001/server/router/handler.go#newcode21 server/router/handler.go:21: // may modify the embedded context before calling next. ...
4 years, 6 months ago (2016-06-16 04:20:26 UTC) #26
nishanths
https://codereview.chromium.org/2043423004/diff/320001/server/router/example_test.go File server/router/example_test.go (right): https://codereview.chromium.org/2043423004/diff/320001/server/router/example_test.go#newcode23 server/router/example_test.go:23: durations []time.Duration On 2016/06/16 04:20:25, nodir wrote: > consider ...
4 years, 6 months ago (2016-06-16 22:11:27 UTC) #27
nodir
lgtm https://codereview.chromium.org/2043423004/diff/360001/server/router/router_test.go File server/router/router_test.go (right): https://codereview.chromium.org/2043423004/diff/360001/server/router/router_test.go#newcode106 server/router/router_test.go:106: So(ctx.Value(outputKey).([]string), ShouldResemble, []string{"handler"}) ctx.Value(outputKey).([]string) casts the value from ...
4 years, 6 months ago (2016-06-16 22:19:00 UTC) #28
nishanths
https://codereview.chromium.org/2043423004/diff/360001/server/router/router_test.go File server/router/router_test.go (right): https://codereview.chromium.org/2043423004/diff/360001/server/router/router_test.go#newcode106 server/router/router_test.go:106: So(ctx.Value(outputKey).([]string), ShouldResemble, []string{"handler"}) On 2016/06/16 22:19:00, nodir wrote: > ...
4 years, 6 months ago (2016-06-16 22:24:22 UTC) #29
Vadim Sh.
https://codereview.chromium.org/2043423004/diff/400001/server/router/handler.go File server/router/handler.go (right): https://codereview.chromium.org/2043423004/diff/400001/server/router/handler.go#newcode7 server/router/handler.go:7: type ( nit: it's the first chunk of code ...
4 years, 6 months ago (2016-06-16 22:47:14 UTC) #30
nodir
https://codereview.chromium.org/2043423004/diff/400001/server/router/router.go File server/router/router.go (right): https://codereview.chromium.org/2043423004/diff/400001/server/router/router.go#newcode29 server/router/router.go:29: writer http.ResponseWriter On 2016/06/16 22:47:14, Vadim Sh. wrote: > ...
4 years, 6 months ago (2016-06-16 23:04:47 UTC) #31
nishanths
https://codereview.chromium.org/2043423004/diff/400001/server/router/handler.go File server/router/handler.go (right): https://codereview.chromium.org/2043423004/diff/400001/server/router/handler.go#newcode7 server/router/handler.go:7: type ( On 2016/06/16 22:47:14, Vadim Sh. wrote: > ...
4 years, 6 months ago (2016-06-16 23:33:01 UTC) #32
Vadim Sh.
https://codereview.chromium.org/2043423004/diff/420001/server/router/router.go File server/router/router.go (right): https://codereview.chromium.org/2043423004/diff/420001/server/router/router.go#newcode27 server/router/router.go:27: context.Context nit: new line after context.Context to separate embedded ...
4 years, 6 months ago (2016-06-16 23:46:38 UTC) #33
Vadim Sh.
(Sorry this review is taking so long... The important lesson here: pick small set of ...
4 years, 6 months ago (2016-06-17 00:05:35 UTC) #34
nodir
https://codereview.chromium.org/2043423004/diff/420001/server/router/router.go File server/router/router.go (right): https://codereview.chromium.org/2043423004/diff/420001/server/router/router.go#newcode138 server/router/router.go:138: // Header is used to implement http.ResponseWriter interface. On ...
4 years, 6 months ago (2016-06-17 00:25:04 UTC) #35
nishanths
https://codereview.chromium.org/2043423004/diff/420001/server/router/router.go File server/router/router.go (right): https://codereview.chromium.org/2043423004/diff/420001/server/router/router.go#newcode27 server/router/router.go:27: context.Context On 2016/06/16 23:46:37, Vadim Sh. wrote: > nit: ...
4 years, 6 months ago (2016-06-17 00:48:24 UTC) #36
Vadim Sh.
this looks good, thanks next steps: 1) Convert common middlewares in server/* and appengine/*, but ...
4 years, 6 months ago (2016-06-17 00:57:31 UTC) #37
Vadim Sh.
https://codereview.chromium.org/2043423004/diff/460001/server/router/router.go File server/router/router.go (right): https://codereview.chromium.org/2043423004/diff/460001/server/router/router.go#newcode72 server/router/router.go:72: func (r *Router) GET(path string, mc MiddlewareChain, h Handler) ...
4 years, 6 months ago (2016-06-17 01:07:52 UTC) #38
nishanths
https://codereview.chromium.org/2043423004/diff/460001/server/router/handler.go File server/router/handler.go (right): https://codereview.chromium.org/2043423004/diff/460001/server/router/handler.go#newcode27 server/router/handler.go:27: func (mc MiddlewareChain) Run(c *Context, h Handler) { Removing ...
4 years, 6 months ago (2016-06-17 01:48:52 UTC) #39
Vadim Sh.
https://codereview.chromium.org/2043423004/diff/460001/server/router/router.go File server/router/router.go (right): https://codereview.chromium.org/2043423004/diff/460001/server/router/router.go#newcode72 server/router/router.go:72: func (r *Router) GET(path string, mc MiddlewareChain, h Handler) ...
4 years, 6 months ago (2016-06-17 01:58:15 UTC) #40
nodir
https://codereview.chromium.org/2043423004/diff/460001/server/router/router.go File server/router/router.go (right): https://codereview.chromium.org/2043423004/diff/460001/server/router/router.go#newcode72 server/router/router.go:72: func (r *Router) GET(path string, mc MiddlewareChain, h Handler) ...
4 years, 6 months ago (2016-06-17 02:00:09 UTC) #41
nishanths
I've un-embedded context.Context and http.ResponseWriter from Context because of https://docs.google.com/a/google.com/document/d/1QUK_-oF3wCOgim7_941C1yk8edIy7HlJQbmH7PjMXDo/edit?usp=sharing
4 years, 6 months ago (2016-06-17 21:44:27 UTC) #42
iannucci
On 2016/06/17 21:44:27, nishanths wrote: > I've un-embedded context.Context and http.ResponseWriter from Context because of ...
4 years, 6 months ago (2016-06-18 00:16:05 UTC) #43
Vadim Sh.
On 2016/06/18 00:16:05, iannucci wrote: > On 2016/06/17 21:44:27, nishanths wrote: > > I've un-embedded ...
4 years, 6 months ago (2016-06-18 00:21:40 UTC) #44
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2043423004/520001
4 years, 6 months ago (2016-06-18 01:13:40 UTC) #46
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Luci-go Mac Tester on master.tryserver.infra (JOB_FAILED, https://build.chromium.org/p/tryserver.infra/builders/Luci-go%20Mac%20Tester/builds/1237)
4 years, 6 months ago (2016-06-18 01:19:58 UTC) #48
nishanths
Added Patch Set 28 that addresses step 1 in Vadim's comment: "Convert common middlewares in ...
4 years, 6 months ago (2016-06-18 03:05:26 UTC) #49
Vadim Sh.
looks good two main comments (see inline comments for details): 1) We now should be ...
4 years, 6 months ago (2016-06-18 16:57:20 UTC) #50
nishanths
https://codereview.chromium.org/2043423004/diff/560001/appengine/gaemiddleware/context.go File appengine/gaemiddleware/context.go (right): https://codereview.chromium.org/2043423004/diff/560001/appengine/gaemiddleware/context.go#newcode82 appengine/gaemiddleware/context.go:82: On 2016/06/18 16:57:20, Vadim Sh. wrote: > nit: remove ...
4 years, 6 months ago (2016-06-19 02:47:03 UTC) #51
nishanths
Updated remaining source files and the tests! https://codereview.chromium.org/2043423004/diff/560001/appengine/tsmon/middleware.go File appengine/tsmon/middleware.go (right): https://codereview.chromium.org/2043423004/diff/560001/appengine/tsmon/middleware.go#newcode105 appengine/tsmon/middleware.go:105: s.flushIfNeeded(c.Context, state, ...
4 years, 6 months ago (2016-06-20 15:14:29 UTC) #52
nishanths
https://codereview.chromium.org/2043423004/diff/660001/appengine/gaeauth/server/default.go File appengine/gaeauth/server/default.go (left): https://codereview.chromium.org/2043423004/diff/660001/appengine/gaeauth/server/default.go#oldcode39 appengine/gaeauth/server/default.go:39: func InstallWebHandlers(r *httprouter.Router, base middleware.Base) { Rename to InstallHandlers?
4 years, 6 months ago (2016-06-20 17:52:57 UTC) #54
Vadim Sh.
https://codereview.chromium.org/2043423004/diff/660001/appengine/gaeauth/server/default.go File appengine/gaeauth/server/default.go (left): https://codereview.chromium.org/2043423004/diff/660001/appengine/gaeauth/server/default.go#oldcode39 appengine/gaeauth/server/default.go:39: func InstallWebHandlers(r *httprouter.Router, base middleware.Base) { On 2016/06/20 17:52:57, ...
4 years, 6 months ago (2016-06-20 19:06:04 UTC) #55
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2043423004/700001
4 years, 6 months ago (2016-06-20 19:52:14 UTC) #58
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Luci-go Presubmit on master.tryserver.infra (JOB_FAILED, https://build.chromium.org/p/tryserver.infra/builders/Luci-go%20Presubmit/builds/1297)
4 years, 6 months ago (2016-06-20 20:13:35 UTC) #60
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2043423004/700001
4 years, 6 months ago (2016-06-20 20:42:45 UTC) #62
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Luci-go Presubmit on master.tryserver.infra (JOB_FAILED, https://build.chromium.org/p/tryserver.infra/builders/Luci-go%20Presubmit/builds/1300)
4 years, 6 months ago (2016-06-20 21:03:50 UTC) #64
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2043423004/700001
4 years, 6 months ago (2016-06-21 00:02:19 UTC) #66
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Luci-go Presubmit on master.tryserver.infra (JOB_FAILED, https://build.chromium.org/p/tryserver.infra/builders/Luci-go%20Presubmit/builds/1306)
4 years, 6 months ago (2016-06-21 00:23:30 UTC) #68
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2043423004/720001
4 years, 6 months ago (2016-06-21 17:07:35 UTC) #70
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Luci-go Presubmit on master.tryserver.infra (JOB_FAILED, https://build.chromium.org/p/tryserver.infra/builders/Luci-go%20Presubmit/builds/1311)
4 years, 6 months ago (2016-06-21 17:28:52 UTC) #72
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2043423004/720001
4 years, 6 months ago (2016-06-21 18:31:03 UTC) #74
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Luci-go Presubmit on master.tryserver.infra (JOB_FAILED, https://build.chromium.org/p/tryserver.infra/builders/Luci-go%20Presubmit/builds/1316)
4 years, 6 months ago (2016-06-21 18:51:40 UTC) #76
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2043423004/720001
4 years, 6 months ago (2016-06-21 19:10:01 UTC) #78
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Luci-go Presubmit on master.tryserver.infra (JOB_FAILED, https://build.chromium.org/p/tryserver.infra/builders/Luci-go%20Presubmit/builds/1318)
4 years, 6 months ago (2016-06-21 19:30:53 UTC) #80
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2043423004/720001
4 years, 6 months ago (2016-06-21 19:59:06 UTC) #82
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Luci-go Presubmit on master.tryserver.infra (JOB_FAILED, https://build.chromium.org/p/tryserver.infra/builders/Luci-go%20Presubmit/builds/1320)
4 years, 6 months ago (2016-06-21 20:20:06 UTC) #84
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2043423004/720001
4 years, 6 months ago (2016-06-22 02:16:21 UTC) #90
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Luci-go Presubmit on master.tryserver.infra (JOB_FAILED, https://build.chromium.org/p/tryserver.infra/builders/Luci-go%20Presubmit/builds/1336)
4 years, 6 months ago (2016-06-22 02:53:16 UTC) #92
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2043423004/720001
4 years, 6 months ago (2016-06-22 04:24:08 UTC) #94
commit-bot: I haz the power
Committed patchset #36 (id:720001) as https://github.com/luci/luci-go/commit/d1ceacb1d00aa31b8fbd37a13c24c28f3650bd95
4 years, 6 months ago (2016-06-22 04:34:36 UTC) #96
chromium-reviews
http://67.media.tumblr.com/tumblr_m1powhRVdz1rqnp16o2_500.gif On Tue, Jun 21, 2016 at 9:34 PM, commit-bot@chromium.org via codereview.chromium.org <reply@chromiumcodereview-hr.appspotmail.com> wrote: > ...
4 years, 6 months ago (2016-06-22 16:28:10 UTC) #97
nodir
4 years, 6 months ago (2016-06-22 16:36:04 UTC) #98
Message was sent while issue was closed.
thanks for doing this and for bearing with us

Powered by Google App Engine
This is Rietveld 408576698