Merge branch 'stable-2.16'

* stable-2.16:
  Consume JGit artifacts from Maven Central
  Consume JGit artifacts from Maven Central
  gr-related-changes: Don't show "Same topic" for only one change
  RelatedChanges: Don't show "Same Topic" for only one change
  ChangeEditApi: Allow to set options on change edit detail request
  JS API: Expose invalidateReposCache method
  restAPI.invalidateGroupsCache: Remove unused parameters
  restAPI.invalidateReposCache: Remove unused parameters
  Add Javadoc to clarify behavior of {Accounts|Changes|Groups}#withOptions
  Update highlight.js to master branch
  Docs: Add use-case for Private changes
  OnlineNoteDbMigrationIT: improve readability of some tests
  Update git submodules
  migrate-to-note-db: add --skip-project option
  OnlineNoteDbMigrationIT: Reuse existing constant
  Do not crash if permitted labels array is empty
  Fix '/' getting typed in search bar when pressed
  Encode project name in download commands
  ProjectResetter: Avoid Repository#getAllRefs
  AbstractDaemonTest: Avoid Repository#getAllRefs
  ChangeUtil: Remove javadoc references to deprecated JGit methods
  Set version to 2.16.4-SNAPSHOT
  AccountManagerIT: Fix failing authentication tests
  ChangeEditApiImpl: Access non-Singleton change edit classes via Provider
  ListChangesOption: Add missing word in Javadoc
  Update git submodules
  Update git submodules
  Fix broken links in gr-icons.html
  Add release notes for Gerrit v2.10.8
  AccountIT#updateDisplayName: Rewrite to work with updated account manager
  Add release notes for Gerrit v2.9.5
  AccountApiImpl: Fix message in exception
  RelatedChangeAndCommitInfo: Use default CommitInfo#toString
  Support Get Related in extension API
  CommitInfo: Use ToStringHelper
  CommitInfo: Handle root commits in toString()
  Implement equals/hashCode/toString in CommitInfo and friends
  Set version to 2.15.9-SNAPSHOT
  AccountIT: Disable failing updateDisplayName test
  Set version to 2.16.3
  Set version to 2.13.12
  Set version to 2.12.9
  Set version to 2.11.12
  Set version to 2.10.8
  Upgrade JGit to 5.1.5.201812261915-r
  Set version to 2.15.8
  Upgrade JGit to 4.9.8.201812241815-r
  Set version to 2.9.5
  Set version to 2.14.18
  Revert "Fix the missing DB entry in Gerrit DB"
  Upgrade JGit to 4.7.7.201812240805-r
  maven_jar: Add repo.eclipse.org to supported repositories
  Update git submodules
  ChangeApi: Add method to list change reviewers
  Bazel: Automatically fix lint errors with buildifier 0.20.0
  Revert "Temp fix for projects list ordering in PolyGerrit"
  Do not center the "By User" column in the Group Audit Log table
  Bazel: Fix more buildifier warnings
  Bazel: Automatically fix lint errors with buildifier 0.20.0
  Fix typo in documentation of edit preferences
  Add MIME type for favicons to list of allowed image types.
  Bazel: Automatically fix lint errors with buildifier
  Mail: Use correct patch set when reading line from file
  Upgrade JGit to 4.5.5.201812240535-r

Change-Id: I15dd15a2e3a1171ddfb792a3f17c43861d434421
This commit is contained in:
David Pursehouse
2019-01-21 13:14:11 +09:00
57 changed files with 420 additions and 245 deletions

View File

@@ -41,17 +41,17 @@ def _replace_macros_impl(ctx):
_replace_macros = rule(
attrs = {
"_exe": attr.label(
default = Label("//Documentation:replace_macros.py"),
allow_single_file = True,
),
"src": attr.label(
mandatory = True,
allow_single_file = [".txt"],
),
"suffix": attr.string(mandatory = True),
"searchbox": attr.bool(default = True),
"out": attr.output(mandatory = True),
"searchbox": attr.bool(default = True),
"suffix": attr.string(mandatory = True),
"_exe": attr.label(
default = Label("//Documentation:replace_macros.py"),
allow_single_file = True,
),
},
implementation = _replace_macros_impl,
)
@@ -108,23 +108,23 @@ def _asciidoc_impl(ctx):
)
_asciidoc_attrs = {
"srcs": attr.label_list(
mandatory = True,
allow_files = True,
),
"attributes": attr.string_list(),
"backend": attr.string(),
"suffix": attr.string(mandatory = True),
"version": attr.label(
default = Label("//:version.txt"),
allow_single_file = True,
),
"_exe": attr.label(
default = Label("//java/com/google/gerrit/asciidoctor:asciidoc"),
cfg = "host",
allow_files = True,
executable = True,
),
"srcs": attr.label_list(
mandatory = True,
allow_files = True,
),
"version": attr.label(
default = Label("//:version.txt"),
allow_single_file = True,
),
"suffix": attr.string(mandatory = True),
"backend": attr.string(),
"attributes": attr.string_list(),
}
_asciidoc = rule(
@@ -279,11 +279,11 @@ _asciidoc_zip = rule(
mandatory = True,
allow_single_file = [".zip"],
),
"directory": attr.string(mandatory = True),
"resources": attr.label_list(
mandatory = True,
allow_files = True,
),
"directory": attr.string(mandatory = True),
},
outputs = {
"out": "%{name}.zip",

View File

@@ -8,8 +8,8 @@ def _classpath_collector(ctx):
elif hasattr(d, "files"):
all += d.files
as_strs = [c.path for c in all]
ctx.file_action(
as_strs = [c.path for c in all.to_list()]
ctx.actions.write(
output = ctx.outputs.runtime,
content = "\n".join(sorted(as_strs)),
)

View File

@@ -23,7 +23,7 @@ def _impl(ctx):
source_jars += l.java.source_jars
transitive_jar_set += l.java.transitive_deps
transitive_jar_paths = [j.path for j in transitive_jar_set]
transitive_jar_paths = [j.path for j in transitive_jar_set.to_list()]
dir = ctx.outputs.zip.path + ".dir"
source = ctx.outputs.zip.path + ".source"
external_docs = ["http://docs.oracle.com/javase/8/docs/api"] + ctx.attr.external_docs
@@ -32,7 +32,7 @@ def _impl(ctx):
"export TZ",
"rm -rf %s" % source,
"mkdir %s" % source,
" && ".join(["unzip -qud %s %s" % (source, j.path) for j in source_jars]),
" && ".join(["unzip -qud %s %s" % (source, j.path) for j in source_jars.to_list()]),
"rm -rf %s" % dir,
"mkdir %s" % dir,
" ".join([
@@ -56,17 +56,17 @@ def _impl(ctx):
"(cd %s && zip -Xqr ../%s *)" % (dir, ctx.outputs.zip.basename),
]
ctx.actions.run_shell(
inputs = list(transitive_jar_set) + list(source_jars) + ctx.files._jdk,
inputs = transitive_jar_set.to_list() + source_jars.to_list() + ctx.files._jdk,
outputs = [zip_output],
command = " && ".join(cmd),
)
java_doc = rule(
attrs = {
"external_docs": attr.string_list(),
"libs": attr.label_list(allow_files = False),
"pkgs": attr.string_list(),
"title": attr.string(),
"external_docs": attr.string_list(),
"_jdk": attr.label(
default = Label("@bazel_tools//tools/jdk:current_java_runtime"),
allow_files = True,

View File

@@ -1,10 +1,10 @@
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_binary", "closure_js_library")
load("//lib/js:npm.bzl", "NPM_SHA1S", "NPM_VERSIONS")
NPMJS = "NPMJS"
GERRIT = "GERRIT:"
load("//lib/js:npm.bzl", "NPM_SHA1S", "NPM_VERSIONS")
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_binary", "closure_js_library")
def _npm_tarball(name):
return "%s@%s.npm_binary.tgz" % (name, NPM_VERSIONS[name])
@@ -37,9 +37,9 @@ def _npm_binary_impl(ctx):
npm_binary = repository_rule(
attrs = {
"repository": attr.string(default = NPMJS),
# Label resolves within repo of the .bzl file.
"_download_script": attr.label(default = Label("//tools:download_file.py")),
"repository": attr.string(default = NPMJS),
},
local = True,
implementation = _npm_binary_impl,
@@ -120,13 +120,13 @@ def _bash(ctx, cmd):
bower_archive = repository_rule(
_bower_archive,
attrs = {
"_bower_archive": attr.label(default = Label("@bower//:%s" % _npm_tarball("bower"))),
"_run_npm": attr.label(default = Label("//tools/js:run_npm_binary.py")),
"_download_bower": attr.label(default = Label("//tools/js:download_bower.py")),
"sha1": attr.string(mandatory = True),
"version": attr.string(mandatory = True),
"package": attr.string(mandatory = True),
"semver": attr.string(),
"sha1": attr.string(mandatory = True),
"version": attr.string(mandatory = True),
"_bower_archive": attr.label(default = Label("@bower//:%s" % _npm_tarball("bower"))),
"_download_bower": attr.label(default = Label("//tools/js:download_bower.py")),
"_run_npm": attr.label(default = Label("//tools/js:run_npm_binary.py")),
},
)
@@ -207,12 +207,12 @@ js_component = rule(
_bower_component = rule(
_bower_component_impl,
attrs = dict(_common_attrs.items() + {
"zipfile": attr.label(allow_single_file = [".zip"]),
"license": attr.label(allow_single_file = True),
"version_json": attr.label(allow_files = [".json"]),
# If set, define by hand, and don't regenerate this entry in bower2bazel.
"seed": attr.bool(default = False),
"version_json": attr.label(allow_files = [".json"]),
"zipfile": attr.label(allow_single_file = [".zip"]),
}.items()),
)
@@ -247,7 +247,7 @@ def _bower_component_bundle_impl(ctx):
out_versions = ctx.outputs.version_json
ctx.actions.run_shell(
inputs = list(zips),
inputs = zips.to_list(),
outputs = [out_zip],
command = " && ".join([
"p=$PWD",
@@ -256,7 +256,7 @@ def _bower_component_bundle_impl(ctx):
"rm -rf %s.dir" % out_zip.path,
"mkdir -p %s.dir/bower_components" % out_zip.path,
"cd %s.dir/bower_components" % out_zip.path,
"for z in %s; do unzip -q $p/$z ; done" % " ".join(sorted([z.path for z in zips])),
"for z in %s; do unzip -q $p/$z ; done" % " ".join(sorted([z.path for z in zips.to_list()])),
"cd ..",
"find . -exec touch -t 198001010000 '{}' ';'",
"zip -Xqr $p/%s bower_components/*" % out_zip.path,
@@ -265,10 +265,10 @@ def _bower_component_bundle_impl(ctx):
)
ctx.actions.run_shell(
inputs = list(versions),
inputs = versions.to_list(),
outputs = [out_versions],
mnemonic = "BowerVersions",
command = "(echo '{' ; for j in %s ; do cat $j; echo ',' ; done ; echo \\\"\\\":\\\"\\\"; echo '}') > %s" % (" ".join([v.path for v in versions]), out_versions.path),
command = "(echo '{' ; for j in %s ; do cat $j; echo ',' ; done ; echo \\\"\\\":\\\"\\\"; echo '}') > %s" % (" ".join([v.path for v in versions.to_list()]), out_versions.path),
)
return struct(
@@ -281,8 +281,8 @@ bower_component_bundle = rule(
_bower_component_bundle_impl,
attrs = _common_attrs,
outputs = {
"zip": "%{name}.zip",
"version_json": "%{name}-versions.json",
"zip": "%{name}.zip",
},
)
@@ -394,11 +394,6 @@ def _bundle_output_func(name, split):
_bundle_rule = rule(
_bundle_impl,
attrs = {
"deps": attr.label_list(providers = ["transitive_zipfiles"]),
"app": attr.label(
mandatory = True,
allow_single_file = True,
),
"srcs": attr.label_list(allow_files = [
".js",
".html",
@@ -406,12 +401,13 @@ _bundle_rule = rule(
".css",
".ico",
]),
"pkg": attr.string(mandatory = True),
"split": attr.bool(default = True),
"_run_npm": attr.label(
default = Label("//tools/js:run_npm_binary.py"),
"app": attr.label(
mandatory = True,
allow_single_file = True,
),
"pkg": attr.string(mandatory = True),
"split": attr.bool(default = True),
"deps": attr.label_list(providers = ["transitive_zipfiles"]),
"_bundler_archive": attr.label(
default = Label("@polymer-bundler//:%s" % _npm_tarball("polymer-bundler")),
allow_single_file = True,
@@ -420,13 +416,17 @@ _bundle_rule = rule(
default = Label("@crisper//:%s" % _npm_tarball("crisper")),
allow_single_file = True,
),
"_run_npm": attr.label(
default = Label("//tools/js:run_npm_binary.py"),
allow_single_file = True,
),
},
outputs = _bundle_output_func,
)
def bundle_assets(*args, **kwargs):
"""Combine html, js, css files and optionally split into js and html bundles."""
_bundle_rule(*args, pkg = native.package_name(), **kwargs)
_bundle_rule(pkg = native.package_name(), *args, **kwargs)
def polygerrit_plugin(name, app, srcs = [], assets = None, plugin_name = None, **kwargs):
"""Bundles plugin dependencies for deployment.

View File

@@ -50,7 +50,7 @@ def _impl(ctx):
classes = ",".join(
[_AsClassName(x) for x in ctx.attr.srcs],
)
ctx.file_action(output = ctx.outputs.out, content = _OUTPUT % (
ctx.actions.write(output = ctx.outputs.out, content = _OUTPUT % (
classes,
ctx.attr.outname,
))

View File

@@ -166,15 +166,15 @@ def _maven_jar_impl(ctx):
maven_jar = repository_rule(
attrs = {
"artifact": attr.string(mandatory = True),
"attach_source": attr.bool(default = True),
"exclude": attr.string_list(),
"repository": attr.string(default = MAVEN_CENTRAL),
"sha1": attr.string(),
"src_sha1": attr.string(),
"_download_script": attr.label(default = Label("//tools:download_file.py")),
"repository": attr.string(default = MAVEN_CENTRAL),
"attach_source": attr.bool(default = True),
"unsign": attr.bool(default = False),
"deps": attr.string_list(),
"exports": attr.string_list(),
"exclude": attr.string_list(),
"deps": attr.string_list(),
"_download_script": attr.label(default = Label("//tools:download_file.py")),
},
local = True,
implementation = _maven_jar_impl,

View File

@@ -82,7 +82,7 @@ def _war_impl(ctx):
elif hasattr(l, "files"):
transitive_lib_deps += l.files
for dep in transitive_lib_deps:
for dep in transitive_lib_deps.to_list():
cmd += _add_file(dep, build_output + "/WEB-INF/lib/")
inputs.append(dep)
@@ -91,7 +91,7 @@ def _war_impl(ctx):
for l in ctx.attr.pgmlibs:
transitive_pgmlib_deps += l.java.transitive_runtime_deps
for dep in transitive_pgmlib_deps:
for dep in transitive_pgmlib_deps.to_list():
if dep not in inputs:
cmd += _add_file(dep, build_output + "/WEB-INF/pgm-lib/")
inputs.append(dep)
@@ -104,7 +104,7 @@ def _war_impl(ctx):
transitive_context_deps += jar.java.transitive_runtime_deps
elif hasattr(jar, "files"):
transitive_context_deps += jar.files
for dep in transitive_context_deps:
for dep in transitive_context_deps.to_list():
cmd += _add_context(dep, build_output)
inputs.append(dep)

View File

@@ -1,5 +1,5 @@
load("//tools/bzl:pkg_war.bzl", "LIBS", "PGMLIBS")
load("//tools/bzl:classpath.bzl", "classpath_collector")
load("//tools/bzl:pkg_war.bzl", "LIBS", "PGMLIBS")
load(
"//tools/bzl:plugins.bzl",
"CORE_PLUGINS",

View File

@@ -15,14 +15,12 @@
from os import path
REPO_ROOTS = {
'ECLIPSE': 'https://repo.eclipse.org/content/groups/releases',
'GERRIT': 'http://gerrit-maven.storage.googleapis.com',
'GERRIT_API':
'https://gerrit-api.commondatastorage.googleapis.com/release',
'MAVEN_CENTRAL': 'http://repo1.maven.org/maven2',
'MAVEN_LOCAL': 'file://' + path.expanduser('~/.m2/repository'),
'MAVEN_SNAPSHOT':
'https://oss.sonatype.org/content/repositories/snapshots',
'ECLIPSE': 'https://repo.eclipse.org/content/groups/releases',
'GERRIT': 'http://gerrit-maven.storage.googleapis.com',
'GERRIT_API': 'https://gerrit-api.commondatastorage.googleapis.com/release',
'MAVEN_CENTRAL': 'http://repo1.maven.org/maven2',
'MAVEN_LOCAL': 'file://' + path.expanduser('~/.m2/repository'),
'MAVEN_SNAPSHOT': 'https://oss.sonatype.org/content/repositories/snapshots',
}