Define a new type of field, STORED_ONLY, for storing arbitrary raw bytes that cannot be searched. Add two fields of this type storing the Change object and the list of SubmitRecord.Labels, which is exactly the set of data needed to render a ChangeTable2. This avoids hitting the database in the common case of rendering dashboards and search results in the web UI, which may be costly on non-SQL implementations Similarly we can avoid running and re-running the submit rule evaluator. This implementation has a minor bug in that changes to submit rules may invalidate previously indexed labels, as can changing the set of plugins with PredicateProviders. There is substantial collateral damage to Reindex stemming from the fact that indexing now depends on the submit rule evaluator, which in turn requires pulling in plugins and hence a lot more Guice glue. Change-Id: I3c10ed936eb9258e453c46f947abf35f5b8fb308
118 lines
2.6 KiB
Python
118 lines
2.6 KiB
Python
SRCS = glob(['src/main/java/**/*.java'])
|
|
RESOURCES = glob(['src/main/resources/**/*'])
|
|
|
|
# TODO(sop) break up gerrit-server java_library(), its too big
|
|
java_library2(
|
|
name = 'server',
|
|
srcs = SRCS,
|
|
resources = RESOURCES,
|
|
deps = [
|
|
'//gerrit-antlr:query_exception',
|
|
'//gerrit-antlr:query_parser',
|
|
'//gerrit-common:server',
|
|
'//gerrit-extension-api:api',
|
|
'//gerrit-patch-commonsnet:commons-net',
|
|
'//gerrit-patch-jgit:server',
|
|
'//gerrit-prettify:server',
|
|
'//gerrit-reviewdb:server',
|
|
'//gerrit-util-cli:cli',
|
|
'//gerrit-util-ssl:ssl',
|
|
'//lib:args4j',
|
|
'//lib:automaton',
|
|
'//lib:gson',
|
|
'//lib:guava',
|
|
'//lib:gwtjsonrpc',
|
|
'//lib:gwtorm',
|
|
'//lib:jsch',
|
|
'//lib:jsr305',
|
|
'//lib:juniversalchardet',
|
|
'//lib:mime-util',
|
|
'//lib:ow2-asm',
|
|
'//lib:ow2-asm-tree',
|
|
'//lib:ow2-asm-util',
|
|
'//lib:parboiled-core',
|
|
'//lib:pegdown',
|
|
'//lib:protobuf',
|
|
'//lib:velocity',
|
|
'//lib/antlr:java_runtime',
|
|
'//lib/commons:codec',
|
|
'//lib/commons:dbcp',
|
|
'//lib/commons:lang',
|
|
'//lib/commons:net',
|
|
'//lib/guice:guice',
|
|
'//lib/guice:guice-assistedinject',
|
|
'//lib/guice:guice-servlet',
|
|
'//lib/jgit:jgit',
|
|
'//lib/log:api',
|
|
'//lib/prolog:prolog-cafe',
|
|
],
|
|
compile_deps = [
|
|
'//lib/bouncycastle:bcprov',
|
|
'//lib/bouncycastle:bcpg',
|
|
],
|
|
visibility = ['PUBLIC'],
|
|
)
|
|
|
|
java_sources(
|
|
name = 'server-src',
|
|
srcs = SRCS + RESOURCES,
|
|
visibility = ['PUBLIC'],
|
|
)
|
|
|
|
PROLOG_TEST_CASE = [
|
|
'src/test/java/com/google/gerrit/rules/PrologTestCase.java',
|
|
]
|
|
PROLOG_TESTS = glob(
|
|
['src/test/java/com/google/gerrit/rules/**/*.java'],
|
|
excludes = PROLOG_TEST_CASE,
|
|
)
|
|
|
|
java_library(
|
|
name = 'prolog_test_case',
|
|
srcs = PROLOG_TEST_CASE,
|
|
deps = [
|
|
':server',
|
|
'//lib:junit',
|
|
'//lib/guice:guice',
|
|
'//lib/prolog:prolog-cafe',
|
|
],
|
|
export_deps = True,
|
|
)
|
|
|
|
java_test(
|
|
name = 'prolog_tests',
|
|
srcs = PROLOG_TESTS,
|
|
resources = glob(['src/test/resources/com/google/gerrit/rules/**/*']),
|
|
deps = [
|
|
':prolog_test_case',
|
|
'//gerrit-server/src/main/prolog:common',
|
|
],
|
|
)
|
|
|
|
java_test(
|
|
name = 'server_tests',
|
|
srcs = glob(
|
|
['src/test/java/**/*.java'],
|
|
excludes = PROLOG_TESTS + PROLOG_TEST_CASE
|
|
),
|
|
deps = [
|
|
':server',
|
|
'//gerrit-antlr:query_exception',
|
|
'//gerrit-antlr:query_parser',
|
|
'//gerrit-common:server',
|
|
'//gerrit-extension-api:api',
|
|
'//gerrit-reviewdb:server',
|
|
'//lib:easymock',
|
|
'//lib:guava',
|
|
'//lib:gwtorm',
|
|
'//lib:h2',
|
|
'//lib:junit',
|
|
'//lib/antlr:java_runtime',
|
|
'//lib/guice:guice',
|
|
'//lib/jgit:jgit',
|
|
'//lib/jgit:junit',
|
|
'//lib/prolog:prolog-cafe',
|
|
],
|
|
source_under_test = [':server'],
|
|
)
|