Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/scripts/api-changes.sh
Original file line number Diff line number Diff line change
@@ -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
10 changes: 4 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: "Release"

# Publishes every Envoy release (as labelled in the Buf registry) that has no v<version> tag here yet.
# Publishes every Envoy release (as labelled in the Buf registry) that has no v<version> tag here yet, skipping releases
# 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:
Expand All @@ -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 }}
Expand Down Expand Up @@ -55,7 +56,7 @@ jobs:
if [ -n "${ENVOY_VERSION}" ]; then
versions="${ENVOY_VERSION}"
else
versions=$(.github/scripts/envoy-releases.sh)
versions=$(.github/scripts/api-changes.sh "${MIN_ENVOY_VERSION}")
fi

published=0
Expand All @@ -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
Expand Down
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 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)).

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
Expand All @@ -34,8 +38,10 @@ 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<version>`
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<version>` 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`.
10 changes: 4 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 5 additions & 0 deletions javadoc/README.md
Original file line number Diff line number Diff line change
@@ -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.
Loading