New issue
Advanced search Search tips

Issue 841603 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Feature



Sign in to add a comment

Remove Bulid.view_url field

Project Member Reported by no...@chromium.org, May 9 2018

Issue description

https://chromium.googlesource.com/infra/infra/+/b1d87bd5b5922353a874377b09382e0e262e865a/appengine/cr-buildbucket/proto/build.proto
defines view_url

a simpler solution is to use something like

  cr-buildbucket.appspot.com/<build_id>

which would redirect to the actual URL. This will use cookies for authorization and requires a frontpage with login/logout button.
 
1. What's wrong with 'view_url'? 
2. Why have additional redirect if we already have view_url?

Comment 2 by st...@chromium.org, May 9 2018

Cc: -wylieb@chromium.org liaoyuke@chromium.org
We are in big favor of this change! With a build id, we should be able to get info we want including the build page!

Comment 3 by st...@chromium.org, May 9 2018

Re #1: I believe using build id is more cleaner and simpler. For example, in flake detection, we don't have to store the view_url besides build id.

Comment 4 by no...@chromium.org, May 9 2018

Status: Available (was: Untriaged)
an HTTP redirect seems to be simpler than a proto field. Note that the proto field is surfaced in RPC, BigQuery and PubSub. Also cr-buildbucket.appspot.com/<id> can be typed manually
I see why not having such .proto field might be simpler for buildbucket implementation.

However, for users that's 1 extra redirect when they click on links provided at least by CQ and/or Gerrit UI plugin. Worse, for internal projects this means logging in twice to buildbucket and Milo. Additionally, while Milo's ci.chromium.org domain makes sense, "cr-buildbucket.appspot.com" leads to reasonable "wtf is this and wtf do I have to login here?".

If the a goal is typing manually, ci.chromium.org/b/<id> is even easier to type and can be implemented (but admittedly, not all buildbucket builds have view_url which leads to prod Milo).

To sum up, I'm not opposed to cr-buildbucket.appspot.com/<id> url, I think it can be handy. But I disagree removes the need for build.view_url in buildbucket API. Finally, FindIt use case can be served by new easy to implement route on milo.

Comment 6 by hinoka@chromium.org, May 10 2018

Reiterating #5, a canonical URL for a buildbucket build ID sounds good if there are many different backends 

But if Milo is the only view_url destination, then from a user perspective, this smells like unnecessary indirection.  Imagine this flow for an internal build:

1. User clicks cr-buildbucket.appspot.com/<build_id>
2. (Assuming unauthorized is an automatic redirect) User presented with log in page.  Clicks to log in.
3. User redirected back to cr-buildbucket.appspot.com/<build_id>
4. cr-buildbucket.appspot.com/<build_id> redirects to ci.chromium.org/blah.  Presented with a 401 page.  Clicks log in
5. User is in the log in flow.  Clicks log in.
6. User is presented with build page.

Currently this is:
1. User clicks ci.chromium.org/blah
2. Milo presents 401, user clicks log in
3. User is in the log in flow.  Clicks log in.
4. User is presented with build page.

Comment 7 by no...@chromium.org, May 11 2018

> I see why not having such .proto field might be simpler for buildbucket implementation.

it is the opposite. For buildbucket impl, having the field is very easy.
it is the API clients that suffer.

> but admittedly, not all buildbucket builds have view_url which leads to prod Milo
the context is API v2. We can limit it to builds that are rendered only by Milo.

-----

Why do we need view_url if we establish a protocol that any LUCI build on prod buildbucket can be accessed by a human at ci.chromiium.org//b/b<id> ?
> We can limit it to builds that are rendered only by Milo.

Give this, short URL in Milo is very SGTM.

Nit for ULR though: I think it can be as simple as
  https://ci.chromium.org/b/<numeric_id>

Comment 9 by st...@chromium.org, May 11 2018

I like https://ci.chromium.org/b/<numeric_id> better

Comment 10 by no...@chromium.org, May 12 2018

Today we have ci.chromium.org/p/<any project, actually>/b/b<id>

The second “b” is there to indicate that the id is a buildbucket id. It is intended to be generic and support other kinds of builds. Maybe it is an overgeneralization.

I’m fine with /<id>. Let’s move the handler.

It sounds like you agree that we don’t need view_url if we have the handler. 

Comment 11 by st...@chromium.org, May 19 2018

I just found that the following URLs works magically!

https://ci.chromium.org/p/chromium/builds/b8946143958977039584
https://ci.chromium.org/p/chromium/builds/b8946141414025680272
https://ci.chromium.org/p/v8/builds/b8946162619295537264

From Findit perspective, no need to change buildbucket anymore :)
But I have a question, what info from the BQ tables of CQ and buildbucket to figure whether it is "chromium", "v8", or other project to be used in the url?
URL project is set in Milo's config and doesn't have to be equal to project in buildbucket v2. 

So, I still think Milo should support /b/<id> and redirect to the correct project.

Comment 13 by st...@chromium.org, May 19 2018

If we don't have to infer which project it is, that's simpler and better!

Comment 14 by no...@chromium.org, May 19 2018

Yeah. Milo shouldn’t ask for project because ids are unique.

But the project in BQ is .buulder.project

Comment 15 by no...@chromium.org, May 19 2018

Labels: -Pri-2 buildbucket-v2 Pri-1
Owner: no...@chromium.org
Status: Started (was: Available)
Project Member

Comment 18 by bugdroid1@chromium.org, Jun 12 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/infra/luci/luci-go.git/+/d8a954cec2f9a5edcd8e703b6b535e494e65406e

commit d8a954cec2f9a5edcd8e703b6b535e494e65406e
Author: Nodir Turakulov <nodir@google.com>
Date: Tue Jun 12 20:59:32 2018

[milo] Add buildbot.BuildID struct

Add convenient buildbot.BuildID struct, a tuple of master, builder and build
number. Use it in other places.

Its methods use non-pointer receives to avoid unnecessary heap allocation.

Bug:  841603 
Change-Id: Id2dd8cca9c6e3644494988664a402061d9a97537
Reviewed-on: https://chromium-review.googlesource.com/1097470
Reviewed-by: Ryan Tseng <hinoka@chromium.org>
Commit-Queue: Nodir Turakulov <nodir@chromium.org>

[add] https://crrev.com/d8a954cec2f9a5edcd8e703b6b535e494e65406e/milo/api/buildbot/buildid.go
[modify] https://crrev.com/d8a954cec2f9a5edcd8e703b6b535e494e65406e/milo/api/buildbot/structs.go
[modify] https://crrev.com/d8a954cec2f9a5edcd8e703b6b535e494e65406e/milo/buildsource/buildbot/build.go
[modify] https://crrev.com/d8a954cec2f9a5edcd8e703b6b535e494e65406e/milo/buildsource/buildbot/build_test.go
[modify] https://crrev.com/d8a954cec2f9a5edcd8e703b6b535e494e65406e/milo/buildsource/buildbot/buildinfo.go
[modify] https://crrev.com/d8a954cec2f9a5edcd8e703b6b535e494e65406e/milo/buildsource/buildbot/buildstore/blame.go
[modify] https://crrev.com/d8a954cec2f9a5edcd8e703b6b535e494e65406e/milo/buildsource/buildbot/buildstore/build.go
[modify] https://crrev.com/d8a954cec2f9a5edcd8e703b6b535e494e65406e/milo/buildsource/buildbot/grpc.go
[modify] https://crrev.com/d8a954cec2f9a5edcd8e703b6b535e494e65406e/milo/buildsource/buildbot/pubsub_test.go
[modify] https://crrev.com/d8a954cec2f9a5edcd8e703b6b535e494e65406e/milo/frontend/routes.go

Project Member

Comment 19 by bugdroid1@chromium.org, Jun 12 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/infra/luci/luci-go.git/+/ad2451d6ce1f9055c1b8f69f382c55eb2c941b13

commit ad2451d6ce1f9055c1b8f69f382c55eb2c941b13
Author: Nodir Turakulov <nodir@google.com>
Date: Tue Jun 12 23:17:33 2018

[milo] Refactor build/log handlers

HandleBuild and buildsource.BuildID.GetBuild abstractions try to capture
the common logic among build handlers. Also they cause a certain level of complexity
(one has to implement BuildID) and limits what handlers can do (cannot do
buildsource-specific HTTP-speciifc logic).

HandleLog and buildsource.BuildID.GetLog are similar to HandleBuild, except this
is actually used implemented only in one BuildID implementation, so it has even
less value.

Overall, there is less code without these abstractions, which is a sign that
their (value/cost) or (provides/requires) ratios are too low to justify their
existence.
Extract the common code in helper functions and inline HandleBuild/HandleLog.

Also
- delete unused rawpresentation.getUIBuild
- rename buildbot.Build to GetBuild, to be consistent with other build sources.
- handle "server" parameter in swarming log handler. It was ignored.

Bug:  841603 
Change-Id: I6dc7c2be9bdae04a5099c7b011a40dda8a770282
Reviewed-on: https://chromium-review.googlesource.com/1097499
Reviewed-by: Ryan Tseng <hinoka@chromium.org>
Commit-Queue: Nodir Turakulov <nodir@chromium.org>

[modify] https://crrev.com/ad2451d6ce1f9055c1b8f69f382c55eb2c941b13/milo/buildsource/buildbot/build.go
[modify] https://crrev.com/ad2451d6ce1f9055c1b8f69f382c55eb2c941b13/milo/buildsource/buildbot/build_test.go
[modify] https://crrev.com/ad2451d6ce1f9055c1b8f69f382c55eb2c941b13/milo/buildsource/buildbucket/build.go
[modify] https://crrev.com/ad2451d6ce1f9055c1b8f69f382c55eb2c941b13/milo/buildsource/rawpresentation/build.go
[modify] https://crrev.com/ad2451d6ce1f9055c1b8f69f382c55eb2c941b13/milo/buildsource/swarming/build.go
[modify] https://crrev.com/ad2451d6ce1f9055c1b8f69f382c55eb2c941b13/milo/frontend/routes.go
[modify] https://crrev.com/ad2451d6ce1f9055c1b8f69f382c55eb2c941b13/milo/frontend/view_build.go
[modify] https://crrev.com/ad2451d6ce1f9055c1b8f69f382c55eb2c941b13/milo/frontend/view_logs.go
[modify] https://crrev.com/ad2451d6ce1f9055c1b8f69f382c55eb2c941b13/milo/rpc/buildinfo.go

Project Member

Comment 20 by bugdroid1@chromium.org, Jun 12 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/infra/luci/luci-go.git/+/a2b7ea336050467d815c310a14641faa1a30a43f

commit a2b7ea336050467d815c310a14641faa1a30a43f
Author: Nodir Turakulov <nodir@google.com>
Date: Tue Jun 12 23:49:53 2018

[milo] Add /b/:id URL

Users need a simple way to translate a buildbucket ID into a human-consumable
build URL. Here "simple" implies without RPCs. Add /b/:id handler that redirects
to a canonical build URL.

Also move "/b/:project/b/b:id" to "/b/:project/builders/:bucket/:builder/b:id".

Bug:  841603 
Change-Id: Icab6914d17aca301c25fe653b3d355ad2de5d8c0
Reviewed-on: https://chromium-review.googlesource.com/1097566
Commit-Queue: Nodir Turakulov <nodir@chromium.org>
Reviewed-by: Ryan Tseng <hinoka@chromium.org>

[modify] https://crrev.com/a2b7ea336050467d815c310a14641faa1a30a43f/milo/buildsource/buildbucket/build.go
[modify] https://crrev.com/a2b7ea336050467d815c310a14641faa1a30a43f/milo/buildsource/buildbucket/builder.go
[modify] https://crrev.com/a2b7ea336050467d815c310a14641faa1a30a43f/milo/buildsource/buildbucket/expectations/luci.infra.try/InfraPresubmit.Swarming.json
[modify] https://crrev.com/a2b7ea336050467d815c310a14641faa1a30a43f/milo/common/model/build_summary.go
[modify] https://crrev.com/a2b7ea336050467d815c310a14641faa1a30a43f/milo/common/model/builder_summary_test.go
[modify] https://crrev.com/a2b7ea336050467d815c310a14641faa1a30a43f/milo/frontend/routes.go
[modify] https://crrev.com/a2b7ea336050467d815c310a14641faa1a30a43f/milo/frontend/view_build.go

Comment 23 by no...@chromium.org, Jun 13 2018

short URLs were deployed, e.g. http://ci.chromium.org/b/8943809679751142640
hopefully it will stick
🎉🎉🎉
Project Member

Comment 25 by bugdroid1@chromium.org, Jun 13 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/infra/luci/luci-go.git/+/1eab9bb491286bc6c80a68b8420888ebf21e5b80

commit 1eab9bb491286bc6c80a68b8420888ebf21e5b80
Author: Nodir Turakulov <nodir@google.com>
Date: Wed Jun 13 21:15:19 2018

[milo] use htmlMW for /b/:id route

/b/:id uses project middlware. It is incorrect because there is no project
parameter. Use its base.

Bug:  841603 
Change-Id: Ide8ee3284cb99427711b0df8ada55df555b82edd
Reviewed-on: https://chromium-review.googlesource.com/1099842
Reviewed-by: Ryan Tseng <hinoka@chromium.org>
Commit-Queue: Nodir Turakulov <nodir@chromium.org>

[modify] https://crrev.com/1eab9bb491286bc6c80a68b8420888ebf21e5b80/milo/frontend/routes.go

Project Member

Comment 26 by bugdroid1@chromium.org, Jun 13 2018

Labels: merge-merged-config
The following revision refers to this bug:
  https://chrome-internal.googlesource.com/chromeos/manifest-internal/+/7b4fdf1d6903b4dd8cd833d7c5e23086c01ad16d

commit 7b4fdf1d6903b4dd8cd833d7c5e23086c01ad16d
Author: Nodir Turakulov <nodir@google.com>
Date: Wed Jun 13 22:17:50 2018

Comment 27 by st...@chromium.org, Jun 14 2018

Awesome!

Comment 28 by no...@chromium.org, Jun 14 2018

Status: Fixed (was: Started)
Project Member

Comment 29 by bugdroid1@chromium.org, Jun 15 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/infra/luci/luci-go.git/+/b17df14d9320e9c4819d1e7de2d83b190cd03baf

commit b17df14d9320e9c4819d1e7de2d83b190cd03baf
Author: Nodir Turakulov <nodir@google.com>
Date: Fri Jun 15 23:15:09 2018

[luci-notify] Do not ask for view_url

TBR=tandrii@google.com

Bug:  841603 
Change-Id: Ib7f8623c1ff6ecdcc88881765a1f5cb9bec72108
Reviewed-on: https://chromium-review.googlesource.com/1103438
Reviewed-by: Nodir Turakulov <nodir@chromium.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Commit-Queue: Nodir Turakulov <nodir@chromium.org>

[modify] https://crrev.com/b17df14d9320e9c4819d1e7de2d83b190cd03baf/luci_notify/notify/pubsub.go

Sign in to add a comment