From 5e7132e36a995e772fc304c3543c6845a0d0b236 Mon Sep 17 00:00:00 2001 From: Jonathan Oddy Date: Sun, 25 Oct 2026 19:14:56 +0000 Subject: [PATCH 1/2] Publish less: from Envoy 1.36, only changed APIs, stub javadoc Maven Central now limits how much each organization publishes a month. - Start at Envoy 1.36.0, the oldest release upstream still supports. - Skip a release whose protos are the same as the release before: Envoy's Buf labels point at content-addressed commits, so those share a commit. In 1.36 to 1.40 that leaves 12 of 17 releases. - The javadoc jar only holds a README pointing to Envoy's API docs. Javadoc of the generated code was ~55 MB of each ~100 MB release, and the sources jar already serves IDEs. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01LjfJneYfZvPVJht93FjFQW --- .github/scripts/envoy-releases.sh | 14 ++++++++++++-- .github/workflows/release.yml | 10 ++++------ README.md | 13 +++++++++---- build.gradle | 10 ++++------ javadoc/README.md | 5 +++++ 5 files changed, 34 insertions(+), 18 deletions(-) create mode 100644 javadoc/README.md diff --git a/.github/scripts/envoy-releases.sh b/.github/scripts/envoy-releases.sh index 35e0a8e..29b928b 100755 --- a/.github/scripts/envoy-releases.sh +++ b/.github/scripts/envoy-releases.sh @@ -1,8 +1,18 @@ #!/usr/bin/env bash -# Prints Envoy's releases as labelled in the Buf registry, oldest first, without the leading "v". +# Prints Envoy's releases as labelled in the Buf registry, oldest first, without the leading "v", from the given minimum +# version (default: all). Skips a release whose protos are the same as the release before it: Buf labels point at +# content-addressed commits, so an unchanged release carries the previous one's commit. # shortcut: reads one page of 250 labels (40 in Oct 2026); follow nextPageToken once Envoy has more. set -euo pipefail +min="${1:-0.0.0}" curl -sSf -X POST https://buf.build/buf.registry.module.v1.LabelService/ListLabels \ -H 'Content-Type: application/json' \ -d '{"pageSize":250,"resourceRef":{"name":{"owner":"envoyproxy","module":"envoy"}}}' \ - | jq -r '.labels[].name' | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sed 's/^v//' | sort -V + | jq -r '.labels[] | "\(.name) \(.commitId)"' | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+ ' | sed 's/^v//' | sort -V \ + | awk -v min="${min}" ' + function atLeast(a, b, x, y, i) { + split(a, x, "."); split(b, y, ".") + for (i = 1; i <= 3; i++) if (x[i] + 0 != y[i] + 0) return x[i] + 0 > y[i] + 0 + return 1 + } + atLeast($1, min) { if ($2 != last) print $1; last = $2 }' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e98b560..dd3ddce 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,7 @@ name: "Release" -# Publishes every Envoy release (as labelled in the Buf registry) that has no v tag here yet. +# Publishes every Envoy release (as labelled in the Buf registry) that has no v tag here yet, skipping releases +# whose protos are the same as the release before. # Does nothing until the repository variable PUBLISH is set to "true" and the Maven Central secrets exist. on: @@ -25,7 +26,7 @@ jobs: permissions: contents: write # push release tags env: - MIN_ENVOY_VERSION: "1.31.0" # oldest release Envoy labels in the Buf registry + MIN_ENVOY_VERSION: "1.36.0" # oldest Envoy release upstream still supports MAX_RELEASES_PER_RUN: "5" # a build takes several minutes; later runs catch up on a backlog SONATYPE_USER: ${{ secrets.SONATYPE_USER }} SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} @@ -55,7 +56,7 @@ jobs: if [ -n "${ENVOY_VERSION}" ]; then versions="${ENVOY_VERSION}" else - versions=$(.github/scripts/envoy-releases.sh) + versions=$(.github/scripts/envoy-releases.sh "${MIN_ENVOY_VERSION}") fi published=0 @@ -64,9 +65,6 @@ jobs: echo "Published ${published}; leaving the rest for the next run" break fi - if [ "$(printf '%s\n%s\n' "${MIN_ENVOY_VERSION}" "${v}" | sort -V | head -1)" != "${MIN_ENVOY_VERSION}" ]; then - continue - fi release="${v}${BUILD_NUMBER:+-${BUILD_NUMBER}}" if git rev-parse -q --verify "refs/tags/v${release}" >/dev/null; then continue diff --git a/README.md b/README.md index 6b73543..2dafd84 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,14 @@ Java protobuf and gRPC classes for the [Envoy](https://www.envoyproxy.io/) xDS A ## Versioning Each release is built from one Envoy release and carries its version: `1.40.0` is Envoy 1.40.0's API. A rebuild of the -same Envoy release gets a suffix, e.g. `1.40.0-1`. Use the version matching the Envoy you run, or any later one: the v3 -API only grows, and older Envoys ignore fields they don't know (see Envoy's +same Envoy release gets a suffix, e.g. `1.40.0-1`. An Envoy release whose protos are the same as the release before +isn't published, e.g. there's no 1.36.1 because its API is 1.36.0's. So use the newest version that isn't newer than +the Envoy you run, or any later one: the v3 API only grows, and older Envoys ignore fields they don't know (see Envoy's [API versioning policy](https://github.com/envoyproxy/envoy/blob/main/api/API_VERSIONING.md)). +The javadoc jar only links to [Envoy's API docs](https://www.envoyproxy.io/docs/envoy/latest/api-v3/api); the sources +jar has the generated code. + The classes are generated with protoc 3.25, so they run on protobuf-java 3.25+ and 4.x. ## How it's built @@ -34,8 +38,9 @@ dependency to `api/buf.yaml`. ## Releasing -`.github/workflows/release.yml` runs daily. It publishes every Envoy release from 1.31.0 on that has no `v` -tag in this repository yet, then tags it. Run it by hand to publish one version, or a rebuild with a build number. +`.github/workflows/release.yml` runs daily. It publishes every Envoy release from 1.36.0 (the oldest upstream still +supports) that has no `v` tag in this repository yet, then tags it. It skips releases whose protos are the +same as the release before: Envoy's Buf labels point at content-addressed commits, so those share a commit. Run it by hand to publish one version, or a rebuild with a build number. It does nothing until the repository variable `PUBLISH` is `true`, and needs these secrets: `SONATYPE_USER`, `SONATYPE_PASSWORD` (a Maven Central Portal user token), `OSS_SIGNING_KEY` and `OSS_SIGNING_PASSWORD`. diff --git a/build.gradle b/build.gradle index 818951a..4358886 100644 --- a/build.gradle +++ b/build.gradle @@ -43,12 +43,10 @@ tasks.withType(Jar).configureEach { } } -tasks.withType(Javadoc).configureEach { - options.addStringOption('Xdoclint:none', '-quiet') - options.encoding = 'UTF-8' - options.charSet = 'UTF-8' - options.docEncoding = 'UTF-8' -} +// Central requires a javadoc jar, but javadoc of the generated code is over half of each release (~55 MB) and counts +// against Central's publishing limits. The sources jar serves IDEs, so the javadoc jar only points to Envoy's docs. +tasks.named("javadoc") { enabled = false } +tasks.named("javadocJar", Jar) { from("javadoc/README.md") } def grpcVersion = '1.79.0' // Generated code runs on this protobuf-java major and the next, so 3.x gencode suits both 3.x and 4.x users. diff --git a/javadoc/README.md b/javadoc/README.md new file mode 100644 index 0000000..4ce3de4 --- /dev/null +++ b/javadoc/README.md @@ -0,0 +1,5 @@ +# envoy-api + +Java classes generated from the Envoy xDS API protos. The protos are documented in +[Envoy's API reference](https://www.envoyproxy.io/docs/envoy/latest/api-v3/api), and the generated code is in the +sources jar. From e16fb9252ca1696341016f2e7a8916bcb2ca6624 Mon Sep 17 00:00:00 2001 From: Jonathan Oddy Date: Sun, 25 Oct 2026 19:38:43 +0000 Subject: [PATCH 2/2] Skip releases whose API didn't change, not just their Buf commit Buf's commit changes even when the protos don't (1.36.3 and 1.36.4 export identical files), and comment changes don't change the generated classes. api-changes.sh compares descriptors built without source info, minus the module commit Buf stamps into each. In 1.36 to 1.40 that leaves 7 of 18 releases instead of 12: most patch releases change no protos, or only comments. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01LjfJneYfZvPVJht93FjFQW --- .github/scripts/api-changes.sh | 19 +++++++++++++++++++ .github/scripts/envoy-releases.sh | 14 ++------------ .github/workflows/release.yml | 4 ++-- README.md | 9 +++++---- 4 files changed, 28 insertions(+), 18 deletions(-) create mode 100644 .github/scripts/api-changes.sh diff --git a/.github/scripts/api-changes.sh b/.github/scripts/api-changes.sh new file mode 100644 index 0000000..13776be --- /dev/null +++ b/.github/scripts/api-changes.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# Prints the Envoy releases from the given version on whose API differs from the release before, oldest first. +# Compares descriptors without source info, so changes to comments don't count: they don't change the generated +# classes. Buf stamps its module commit into each descriptor, which changes even when the protos don't, so that's +# dropped. Needs the buf CLI. +set -euo pipefail +min="$1" +last="" +for v in $("$(dirname "$0")/envoy-releases.sh"); do + if [ "$(printf '%s\n%s\n' "${min}" "${v}" | sort -V | head -1)" != "${min}" ]; then + continue + fi + api=$(buf build "buf.build/envoyproxy/envoy:v${v}" --exclude-source-info -o -#format=json \ + | jq -cS '.file | map(del(.bufExtension)) | sort_by(.name)' | sha256sum) + if [ "${api}" != "${last}" ]; then + echo "${v}" + fi + last="${api}" +done diff --git a/.github/scripts/envoy-releases.sh b/.github/scripts/envoy-releases.sh index 29b928b..35e0a8e 100755 --- a/.github/scripts/envoy-releases.sh +++ b/.github/scripts/envoy-releases.sh @@ -1,18 +1,8 @@ #!/usr/bin/env bash -# Prints Envoy's releases as labelled in the Buf registry, oldest first, without the leading "v", from the given minimum -# version (default: all). Skips a release whose protos are the same as the release before it: Buf labels point at -# content-addressed commits, so an unchanged release carries the previous one's commit. +# Prints Envoy's releases as labelled in the Buf registry, oldest first, without the leading "v". # shortcut: reads one page of 250 labels (40 in Oct 2026); follow nextPageToken once Envoy has more. set -euo pipefail -min="${1:-0.0.0}" curl -sSf -X POST https://buf.build/buf.registry.module.v1.LabelService/ListLabels \ -H 'Content-Type: application/json' \ -d '{"pageSize":250,"resourceRef":{"name":{"owner":"envoyproxy","module":"envoy"}}}' \ - | jq -r '.labels[] | "\(.name) \(.commitId)"' | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+ ' | sed 's/^v//' | sort -V \ - | awk -v min="${min}" ' - function atLeast(a, b, x, y, i) { - split(a, x, "."); split(b, y, ".") - for (i = 1; i <= 3; i++) if (x[i] + 0 != y[i] + 0) return x[i] + 0 > y[i] + 0 - return 1 - } - atLeast($1, min) { if ($2 != last) print $1; last = $2 }' + | jq -r '.labels[].name' | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sed 's/^v//' | sort -V diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dd3ddce..b74a70e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,7 @@ name: "Release" # Publishes every Envoy release (as labelled in the Buf registry) that has no v tag here yet, skipping releases -# whose protos are the same as the release before. +# whose API is the same as the release before (see .github/scripts/api-changes.sh). # Does nothing until the repository variable PUBLISH is set to "true" and the Maven Central secrets exist. on: @@ -56,7 +56,7 @@ jobs: if [ -n "${ENVOY_VERSION}" ]; then versions="${ENVOY_VERSION}" else - versions=$(.github/scripts/envoy-releases.sh "${MIN_ENVOY_VERSION}") + versions=$(.github/scripts/api-changes.sh "${MIN_ENVOY_VERSION}") fi published=0 diff --git a/README.md b/README.md index 2dafd84..89167fb 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ Java protobuf and gRPC classes for the [Envoy](https://www.envoyproxy.io/) xDS A ## Versioning Each release is built from one Envoy release and carries its version: `1.40.0` is Envoy 1.40.0's API. A rebuild of the -same Envoy release gets a suffix, e.g. `1.40.0-1`. An Envoy release whose protos are the same as the release before -isn't published, e.g. there's no 1.36.1 because its API is 1.36.0's. So use the newest version that isn't newer than +same Envoy release gets a suffix, e.g. `1.40.0-1`. An Envoy release whose API is the same as the release before isn't +published, e.g. there's no 1.36.1 because its API is 1.36.0's. Most patch releases change no protos, or only comments. So use the newest version that isn't newer than the Envoy you run, or any later one: the v3 API only grows, and older Envoys ignore fields they don't know (see Envoy's [API versioning policy](https://github.com/envoyproxy/envoy/blob/main/api/API_VERSIONING.md)). @@ -39,8 +39,9 @@ dependency to `api/buf.yaml`. ## Releasing `.github/workflows/release.yml` runs daily. It publishes every Envoy release from 1.36.0 (the oldest upstream still -supports) that has no `v` tag in this repository yet, then tags it. It skips releases whose protos are the -same as the release before: Envoy's Buf labels point at content-addressed commits, so those share a commit. Run it by hand to publish one version, or a rebuild with a build number. +supports) that has no `v` tag in this repository yet, then tags it. It skips releases whose API is the same +as the release before: `.github/scripts/api-changes.sh` compares their descriptors, leaving out comments, which don't +change the generated classes. Run it by hand to publish one version, or a rebuild with a build number. It does nothing until the repository variable `PUBLISH` is `true`, and needs these secrets: `SONATYPE_USER`, `SONATYPE_PASSWORD` (a Maven Central Portal user token), `OSS_SIGNING_KEY` and `OSS_SIGNING_PASSWORD`.