Skip to content

Commit

Permalink
docs: external dependency dashboard. (#12639)
Browse files Browse the repository at this point in the history
This patch introduces a set of automatically generated tables (based on repository_locations.bzl)
that enumerate the external dependencies that feature on Envoy's data/control planes, test, build, etc.

Version and CPE information is currently included. In the future, we will also have last updated,
distinguish core vs. extensions and populate with external dependency process maturity information.

Part of #10471. This is essentially providing a programmatic variant of #10471 (comment). Future enhancements are
tracked at #12673.

Signed-off-by: Harvey Tuch <htuch@google.com>
  • Loading branch information
htuch authored Aug 18, 2020
1 parent a6f5d4b commit b0e391f
Show file tree
Hide file tree
Showing 6 changed files with 509 additions and 150 deletions.
38 changes: 31 additions & 7 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,48 @@ WINDOWS_SKIP_TARGETS = [
# archives, e.g. cares.
BUILD_ALL_CONTENT = """filegroup(name = "all", srcs = glob(["**"]), visibility = ["//visibility:public"])"""

def _fail_missing_attribute(attr, key):
fail("The '%s' attribute must be defined for external dependecy " % attr + key)

# Method for verifying content of the DEPENDENCY_REPOSITORIES defined in bazel/repository_locations.bzl
# Verification is here so that bazel/repository_locations.bzl can be loaded into other tools written in Python,
# and as such needs to be free of bazel specific constructs.
#
# We also remove the attributes for further consumption in this file, since rules such as http_archive
# don't recognize them.
def _repository_locations():
locations = dict(DEPENDENCY_REPOSITORIES)
for key, location in locations.items():
locations = {}
for key, location in DEPENDENCY_REPOSITORIES.items():
mutable_location = dict(location)
locations[key] = mutable_location

if "sha256" not in location or len(location["sha256"]) == 0:
fail("SHA256 missing for external dependency " + str(location["urls"]))
_fail_missing_attribute("sha256", key)

if "project_name" not in location:
_fail_missing_attribute("project_name", key)
mutable_location.pop("project_name")

if "project_url" not in location:
_fail_missing_attribute("project_url", key)
mutable_location.pop("project_url")

if "version" not in location:
_fail_missing_attribute("version", key)
mutable_location.pop("version")

if "use_category" not in location:
fail("The 'use_category' attribute must be defined for external dependecy " + str(location["urls"]))
_fail_missing_attribute("use_category", key)
mutable_location.pop("use_category")

if "cpe" not in location and not [category for category in USE_CATEGORIES_WITH_CPE_OPTIONAL if category in location["use_category"]]:
fail("The 'cpe' attribute must be defined for external dependecy " + str(location["urls"]))
if "cpe" in location:
mutable_location.pop("cpe")
elif not [category for category in USE_CATEGORIES_WITH_CPE_OPTIONAL if category in location["use_category"]]:
_fail_missing_attribute("cpe", key)

for category in location["use_category"]:
if category not in USE_CATEGORIES:
fail("Unknown use_category value '" + category + "' for dependecy " + str(location["urls"]))
fail("Unknown use_category value '" + category + "' for dependecy " + key)

return locations

Expand Down
Loading

0 comments on commit b0e391f

Please sign in to comment.