Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
104 changes: 104 additions & 0 deletions static/compatibilities/envoy-gateway.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
icon: https://raw.githubusercontent.com/envoyproxy/gateway/main/site/static/icons/logo.svg
git_url: https://github.com/envoyproxy/gateway
release_url: https://github.com/envoyproxy/gateway/releases/tag/v{vsn}
readme_url: https://gateway.envoyproxy.io/news/releases/matrix/
helm_repository_url: oci://docker.io/envoyproxy/gateway-helm
chart_name: gateway-helm
versions:
- version: 1.8.0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should be able to get image versions from the chart at the very least here, and i'm pretty sure the helpers also can work with oci to infer chart versions.

kube: ['1.35', '1.34', '1.33', '1.32']
requirements:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't the right format for the requirements array, but we can just drop/leave empty for now.

- Envoy Proxy distroless-v1.38.0
- Rate Limit fe26676d
- Gateway API v1.5.1
incompatibilities: []
- version: 1.7.0
kube: ['1.35', '1.34', '1.33', '1.32']
requirements:
- Envoy Proxy distroless-v1.37.0
- Rate Limit 3fb70258
- Gateway API v1.4.1
incompatibilities: []
- version: 1.6.0
kube: ['1.33', '1.32', '1.31', '1.30']
requirements:
- Envoy Proxy distroless-v1.36.4
- Rate Limit 3fb70258
- Gateway API v1.4.0
incompatibilities: []
- version: 1.5.0
kube: ['1.33', '1.32', '1.31', '1.30']
requirements:
- Envoy Proxy distroless-v1.35.0
- Rate Limit a90e0e5d
- Gateway API v1.3.0
incompatibilities: []
- version: 1.4.0
kube: ['1.33', '1.32', '1.31', '1.30']
requirements:
- Envoy Proxy distroless-v1.34.1
- Rate Limit 3e085e5b
- Gateway API v1.3.0
incompatibilities: []
- version: 1.3.0
kube: ['1.32', '1.31', '1.30', '1.29']
requirements:
- Envoy Proxy distroless-v1.33.0
- Rate Limit 60d8e81b
- Gateway API v1.2.1
incompatibilities: []
- version: 1.2.0
kube: ['1.31', '1.30', '1.29', '1.28']
requirements:
- Envoy Proxy distroless-v1.32.1
- Rate Limit 28b1629a
- Gateway API v1.2.0
incompatibilities: []
- version: 1.1.0
kube: ['1.30', '1.29', '1.28', '1.27']
requirements:
- Envoy Proxy distroless-v1.31.0
- Rate Limit 91484c59
- Gateway API v1.1.0
incompatibilities: []
- version: 1.0.0
kube: ['1.29', '1.28', '1.27', '1.26']
requirements:
- Envoy Proxy distroless-v1.29.2
- Rate Limit 19f2079f
- Gateway API v1.0.0
incompatibilities: []
- version: 0.6.0
kube: ['1.28', '1.27', '1.26']
requirements:
- Envoy Proxy distroless-v1.28-latest
- Rate Limit b9796237
- Gateway API v1.0.0
incompatibilities: []
- version: 0.5.0
kube: ['1.27', '1.26', '1.25']
requirements:
- Envoy Proxy v1.27-latest
- Rate Limit e059638d
- Gateway API v0.7.1
incompatibilities: []
- version: 0.4.0
kube: ['1.27', '1.26', '1.25']
requirements:
- Envoy Proxy v1.26-latest
- Rate Limit 542a6047
- Gateway API v0.6.2
incompatibilities: []
- version: 0.3.0
kube: ['1.26', '1.25', '1.24']
requirements:
- Envoy Proxy v1.25-latest
- Rate Limit f28024e3
- Gateway API v0.6.1
incompatibilities: []
- version: 0.2.0
kube: ['1.24']
requirements:
- Envoy Proxy v1.23-latest
- Gateway API v0.5.1
incompatibilities: []
1 change: 1 addition & 0 deletions static/compatibilities/manifest.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
names:
- envoy-gateway
- argo-rollouts
- aws-ebs-csi-driver
- aws-efs-csi-driver
Expand Down
121 changes: 121 additions & 0 deletions utils/compatibility/scrapers/envoy-gateway.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
from __future__ import annotations

from collections import OrderedDict

from bs4 import BeautifulSoup

from utils import fetch_page, print_error, update_compatibility_info


APP_NAME = "envoy-gateway"
COMPATIBILITY_URL = "https://gateway.envoyproxy.io/news/releases/matrix/"
TARGET_FILE = f"../../static/compatibilities/{APP_NAME}.yaml"


def _decode(content):
return content.decode("utf-8", errors="replace") if isinstance(content, bytes) else content


def _clean_version(value: str) -> str:
version = value.strip().lstrip("v")
if version == "latest":
return version
if version and version.count(".") == 1:
return f"{version}.0"
return version


def _clean_kube_version(value: str) -> str:
return value.strip().lstrip("v")


def _parse_kube_versions(value: str) -> list[str]:
versions = []
for raw_version in value.split(","):
version = _clean_kube_version(raw_version)
if version:
versions.append(version)
return versions


def _find_compatibility_table(soup: BeautifulSoup):
required_headers = [
"Envoy Gateway version",
"Envoy Proxy version",
"Rate Limit version",
"Gateway API version",
"Kubernetes version",
]

for table in soup.find_all("table"):
headers = [th.get_text(" ", strip=True) for th in table.find_all("th")]
if all(header in headers for header in required_headers):
return table, headers
return None, []


def _requirement(label: str, value: str) -> str | None:
cleaned = value.strip()
if not cleaned:
return None
return f"{label} {cleaned}"


def scrape():
content = fetch_page(COMPATIBILITY_URL)
if not content:
print_error("Failed to fetch Envoy Gateway compatibility matrix.")
return

soup = BeautifulSoup(_decode(content), "html.parser")
table, headers = _find_compatibility_table(soup)
if not table:
print_error("Envoy Gateway compatibility table not found.")
return

gateway_idx = headers.index("Envoy Gateway version")
proxy_idx = headers.index("Envoy Proxy version")
rate_limit_idx = headers.index("Rate Limit version")
gateway_api_idx = headers.index("Gateway API version")
kube_idx = headers.index("Kubernetes version")
Comment on lines +70 to +73

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Unguarded index() calls for three column headers

_find_compatibility_table only verifies that "Envoy Gateway version" and "Kubernetes version" are present before returning. The three subsequent .index() calls for "Envoy Proxy version", "Rate Limit version", and "Gateway API version" are unguarded — if the Envoy Gateway site renames any of those columns the scraper raises an unhandled ValueError instead of printing a clean error and returning. Consider validating all five required headers inside _find_compatibility_table (or with an explicit check before the index lookups) and calling print_error + returning on failure.


versions = []
for row in table.find_all("tr")[1:]:
cells = [td.get_text(" ", strip=True) for td in row.find_all("td")]
if len(cells) <= max(gateway_idx, proxy_idx, rate_limit_idx, gateway_api_idx, kube_idx):
continue

version = _clean_version(cells[gateway_idx])
if not version or version == "latest":
continue

kube_versions = _parse_kube_versions(cells[kube_idx])
if not kube_versions:
continue

requirements = [
requirement
for requirement in [
_requirement("Envoy Proxy", cells[proxy_idx]),
_requirement("Rate Limit", cells[rate_limit_idx]),
_requirement("Gateway API", cells[gateway_api_idx]),
]
if requirement
]

versions.append(
OrderedDict(
[
("version", version),
("kube", kube_versions),
("requirements", requirements),
("incompatibilities", []),
]
)
)

if not versions:
print_error("No Envoy Gateway compatibility rows parsed.")
return

update_compatibility_info(TARGET_FILE, versions)