Skip to content

Comments

Publish envoy-api Bazel module to toolshed registry#3709

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/publish-envoy-api-module
Draft

Publish envoy-api Bazel module to toolshed registry#3709
Copilot wants to merge 2 commits intomainfrom
copilot/publish-envoy-api-module

Conversation

Copy link
Contributor

Copilot AI commented Feb 8, 2026

Publishes the envoy-api Bazel module to the toolshed registry, enabling envoy's bzlmod migration without depending on BCR's Google-maintained envoy_api module. Prerequisite for envoyproxy/envoy#43329.

Module Configuration

  • Version: 1.38.0-dev
  • Source: envoy repo @ 5151379e36c8c9373de231b8ff07abda1d524ea9 with strip_prefix to api/ subdirectory
  • Integrity: sha256-4VVmTR1nJo0se/gnna0UabDtOw6KHVbpo7vcAaXtNSw=
  • Module name: envoy-api with repo_name = "envoy_api" for backward compatibility

Key Dependencies

Migrated to proper bazel_dep entries (previously non-module deps):

  • envoy_toolshed @ 0.3.26
  • prometheus-metrics-model @ 0.6.2.envoy with repo_name = "prometheus_metrics_model"

Retained in non_module_deps extension:

  • com_github_chrusty_protoc_gen_jsonschema (abandonware, will be removed eventually)

Files Added

bazel-registry/modules/envoy-api/
├── metadata.json
└── 1.38.0-dev/
    ├── MODULE.bazel
    └── source.json
Original prompt

Summary

Publish the envoy-api Bazel module in the toolshed registry so that envoy can use it via bzlmod without depending on the BCR envoy_api module (which is out of envoyproxy's control).

This is a prerequisite for envoyproxy/envoy#43329 which enables bzlmod in envoy.

Context

The envoy repo currently uses a local_path_override for the envoy-api module (pointing at api/). For external consumers building envoy as a dependency, the envoy-api module needs to be resolvable from a registry. Publishing it in the toolshed registry (which envoy already uses via --registry) gives envoyproxy full control over it.

The BCR has an envoy_api but it's published by Google and doesn't align with envoy's needs. The toolshed registry already hosts 60+ custom .envoy modules.

What to create

Create the following files under bazel-registry/modules/envoy-api/:

1. bazel-registry/modules/envoy-api/metadata.json

{
    "homepage": "https://github.com/envoyproxy/envoy/tree/main/api",
    "maintainers": [],
    "repository": [
        "github:envoyproxy/envoy"
    ],
    "versions": [
        "1.38.0-dev"
    ],
    "yanked_versions": {}
}

2. bazel-registry/modules/envoy-api/1.38.0-dev/source.json

{
    "url": "https://github.com/envoyproxy/envoy/archive/5151379e36c8c9373de231b8ff07abda1d524ea9.tar.gz",
    "integrity": "",
    "strip_prefix": "envoy-5151379e36c8c9373de231b8ff07abda1d524ea9/api"
}

IMPORTANT: The integrity field needs to be computed. Download the tarball from https://github.com/envoyproxy/envoy/archive/5151379e36c8c9373de231b8ff07abda1d524ea9.tar.gz, compute its SHA256 hash, and encode it as a base64 SRI hash in the format sha256-<base64hash>=. You can do this with:

curl -sL https://github.com/envoyproxy/envoy/archive/5151379e36c8c9373de231b8ff07abda1d524ea9.tar.gz | sha256sum
# Then convert hex to base64 SRI format

Or:

curl -sL https://github.com/envoyproxy/envoy/archive/5151379e36c8c9373de231b8ff07abda1d524ea9.tar.gz | openssl dgst -sha256 -binary | openssl base64 -A
# Prepend "sha256-" and append "="

3. bazel-registry/modules/envoy-api/1.38.0-dev/MODULE.bazel

This is based on the api/MODULE.bazel from the phlax:bzlmod-enable branch of envoy (https://github.com/phlax/envoy/blob/bzlmod-enable/api/MODULE.bazel), but with key changes:

  • envoy_toolshed must be a proper bazel_dep (NOT fetched via the non_module_deps extension). It's already in the toolshed registry. Use version 0.3.26 to match the version used in envoy's MODULE.bazel.
  • prometheus-metrics-model must be a proper bazel_dep (NOT fetched via the non_module_deps extension). It's already in the toolshed registry at version 0.6.2.envoy with repo_name = "prometheus_metrics_model".
  • com_github_chrusty_protoc_gen_jsonschema stays as a non-module dep via the non_module_deps extension (it's abandonware, will be ripped out eventually).
  • The non_module_deps extension should ONLY provide com_github_chrusty_protoc_gen_jsonschema (not envoy_toolshed or prometheus_metrics_model).

Here is the MODULE.bazel content:

module(
    name = "envoy-api",
    version = "1.38.0-dev",
    compatibility_level = 1,
    repo_name = "envoy_api",
)

####################################################################################
# deps: Module
####################################################################################

bazel_dep(name = "abseil-cpp", version = "20250814.1")
bazel_dep(name = "aspect_bazel_lib", version = "2.22.0")
bazel_dep(name = "bazel_skylib", version = "1.8.2")
bazel_dep(name = "boringssl", version = "0.20250514.0")
bazel_dep(name = "envoy_toolshed", version = "0.3.26")
bazel_dep(name = "gazelle", version = "0.47.0")
bazel_dep(name = "googleapis", version = "0.0.0-20251003-2193a2bf")
bazel_dep(name = "googleapis-cc", version = "1.0.0")
bazel_dep(name = "googleapis-go", version = "1.0.0")
bazel_dep(name = "googleapis-java", version = "1.0.0")
bazel_dep(name = "grpc", version = "1.76.0.bcr.1")
bazel_dep(name = "opentelemetry-proto", version = "1.8.0")
bazel_dep(name = "prometheus-metrics-model", version = "0.6.2.envoy", repo_name = "prometheus_metrics_model")
bazel_dep(name = "protobuf", version = "33.4", repo_name = "com_google_protobuf")
bazel_dep(name = "protoc-gen-validate", version = "1.3.0", repo_name = "com_envoyproxy_protoc_gen_validate")
bazel_dep(name = "re2", version = "2024-07-02.bcr.1")
bazel_dep(name = "rules_cc", version = "0.2.14")
bazel_dep(name = "rules_go", version = "0.59.0", repo_name = "io_bazel_rules_go")
bazel_dep(name = "rules_java", version = "9.0.3")
bazel_dep(name = "rules_jvm_external", version = "6.8")
bazel_dep(name = "rules_proto", version = "7.1.0")
bazel_dep(name = "rules_python", version = "1.7.0")
bazel_dep(name = "xds", version = "0.0.0-20240423-555b57e")
bazel_dep(name = "yq.bzl", version = "0.1.1.envoy")
bazel_dep(na...

</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

*This pull request was created from Copilot chat.*
>

<!-- START COPILOT CODING AGENT TIPS -->
---Let Copilot coding agent [set things up for you](https://github.com/envoyproxy/toolshed/issues/new?title=+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo.

@netlify
Copy link

netlify bot commented Feb 8, 2026

Deploy Preview for nifty-bassi-e26446 ready!

Name Link
🔨 Latest commit 0bd374f
🔍 Latest deploy log https://app.netlify.com/projects/nifty-bassi-e26446/deploys/698859ea116c34000827c15b
😎 Deploy Preview https://deploy-preview-3709--nifty-bassi-e26446.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

- Add metadata.json for envoy-api module
- Add source.json with computed integrity hash
- Add MODULE.bazel with envoy_toolshed and prometheus-metrics-model as proper bazel_dep entries
- Only com_github_chrusty_protoc_gen_jsonschema remains in non_module_deps extension

Co-authored-by: phlax <454682+phlax@users.noreply.github.com>
Copilot AI changed the title [WIP] Publish envoy-api Bazel module in toolshed registry Publish envoy-api Bazel module to toolshed registry Feb 8, 2026
Copilot AI requested a review from phlax February 8, 2026 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants