gerrit/gerrit-gwtui/BUILD
Patrick Hiesel 272a803f38 Rewrite GWT UI to use project name in addition to numeric change ID
This change adapts the GWT UI to recognize a project name in the URL
alongside the numeric change ID and integrate it into all REST API calls
made on /changes.

This is an effort towards having the project in all REST API calls to
/changes which will make routing Gerrit requests easier. On top, it
doesn't require secondary index lookups for trivial calls like /detail.

In contrast to the original proposal, changes will be served at
/c/project-name/+/123 instead of /p/project-name/+c/1234.
This is to stay more consistent with the REST API which serves all
changes at /changes instead of /projects.
The only difference between the UI and the API is now that the UI uses
'/+/' as a delimiter while the API uses '~'. In addition project names
in the API need to be URL encoded. This enables us to use the new change
id that includes the project also in a later part of the URL.
In the UI, this isn't needed and at the same time we want to maximize
the readability of URLs which is done by the two differences noted
above.

If a user uses a URL without the project (/c/123), we retrieve the
project upon the first API call and rewrite the URL.

All instances of Project.NameKey and String project are marked
@Nullable where they can actually be null. In the API layer they are
consistently marked @Nullable to reflect the current status of the
backend. That is, a project can optionally be provided. This
might be changed to a more strict policy at a later stage.

Change-Id: Ie3feee2e3b3e3b91b8d646d0326b7ada6134a0f9
2017-07-11 17:18:10 +02:00

42 lines
786 B
Python

load(
"//tools/bzl:gwt.bzl",
"gwt_genrule",
"gen_ui_module",
"gwt_user_agent_permutations",
)
load("//tools/bzl:license.bzl", "license_test")
load("//tools/bzl:junit.bzl", "junit_tests")
gwt_genrule()
gwt_genrule("_r")
gen_ui_module(name = "ui_module")
gen_ui_module(
name = "ui_module",
suffix = "_r",
)
gwt_user_agent_permutations()
license_test(
name = "ui_module_license_test",
target = ":ui_module",
)
junit_tests(
name = "ui_tests",
srcs = glob(["src/test/java/**/*.java"]),
visibility = ["//visibility:public"],
deps = [
":ui_module",
"//gerrit-common:client",
"//gerrit-extension-api:client",
"//lib:junit",
"//lib:truth",
"//lib/gwt:dev",
"//lib/gwt:user",
],
)