From 0601378c0a68fef56ee26944f06cdce57bb5cb2a Mon Sep 17 00:00:00 2001 From: lemonlinger Date: Thu, 7 Dec 2023 19:43:37 +0800 Subject: [PATCH] Add a tool to generate release notes docs from yaml files of release notes. Signed-off-by: lemonlinger --- site/content/en/latest/releases/v0.1.0.md | 3 +- .../{v0.2.0-rc.1.md => v0.2.0-rc1.md} | 11 +-- .../{v0.2.0-rc.2.md => v0.2.0-rc2.md} | 11 +-- site/content/en/latest/releases/v0.2.0.md | 13 ++-- .../content/en/latest/releases/v0.3.0-rc.1.md | 3 +- site/content/en/latest/releases/v0.3.0.md | 3 +- .../content/en/latest/releases/v0.4.0-rc.1.md | 3 +- site/content/en/latest/releases/v0.4.0.md | 3 +- .../content/en/latest/releases/v0.5.0-rc.1.md | 6 +- site/content/en/latest/releases/v0.5.0.md | 6 +- .../content/en/latest/releases/v0.6.0-rc.1.md | 16 +++-- site/content/en/latest/releases/v0.6.0.md | 18 ++--- tools/make/docs.mk | 9 ++- tools/make/tools.mk | 9 ++- .../release-notes-docs/release-notes-docs.sh | 13 ++++ tools/src/release-notes-docs/requirements.txt | 1 + tools/src/release-notes-docs/yml2md.py | 67 +++++++++++++++++++ 17 files changed, 153 insertions(+), 42 deletions(-) rename site/content/en/latest/releases/{v0.2.0-rc.1.md => v0.2.0-rc1.md} (90%) rename site/content/en/latest/releases/{v0.2.0-rc.2.md => v0.2.0-rc2.md} (90%) create mode 100755 tools/src/release-notes-docs/release-notes-docs.sh create mode 100644 tools/src/release-notes-docs/requirements.txt create mode 100755 tools/src/release-notes-docs/yml2md.py diff --git a/site/content/en/latest/releases/v0.1.0.md b/site/content/en/latest/releases/v0.1.0.md index 3d55118a8468..e643d077d7f3 100644 --- a/site/content/en/latest/releases/v0.1.0.md +++ b/site/content/en/latest/releases/v0.1.0.md @@ -1,9 +1,10 @@ --- title: "v0.1.0" -publishdate: 2022-05-16 +publishdate: 2022-05-16 00:00:00 --- Date: May 16, 2022 ## Documentation - The initial open source release describing project goals and high-level design. + diff --git a/site/content/en/latest/releases/v0.2.0-rc.1.md b/site/content/en/latest/releases/v0.2.0-rc1.md similarity index 90% rename from site/content/en/latest/releases/v0.2.0-rc.1.md rename to site/content/en/latest/releases/v0.2.0-rc1.md index 59da2015f9d8..648a537ea35f 100644 --- a/site/content/en/latest/releases/v0.2.0-rc.1.md +++ b/site/content/en/latest/releases/v0.2.0-rc1.md @@ -1,6 +1,6 @@ --- -title: "v0.2.0-rc.1" -publishdate: 2022-08-31 +title: "v0.2.0-rc1" +publishdate: 2022-08-31 00:00:00 --- Date: August 31, 2022 @@ -12,7 +12,7 @@ Date: August 31, 2022 - Added the EnvoyGateway API type for configuring Envoy Gateway. - Added the EnvoyProxy API type for configuring managed Envoys. -## CI +## Ci - Added tooling to build, run, etc. Envoy Gateway. ## Providers @@ -29,9 +29,10 @@ Date: August 31, 2022 - Added the gatewayapi translator to translate Gateway API and associated resources to the IR and manage - Gateway API status. -## Message Service +## Message-service - Added infra and xds IR watchable map messages for inter-component communication. - Added a Runner to each component to support pub/sub between components. -## Infra Manager +## Infra-manager - Added Kubernetes Infra Manager to manage Envoy infrastructure running in a Kubernetes cluster. + diff --git a/site/content/en/latest/releases/v0.2.0-rc.2.md b/site/content/en/latest/releases/v0.2.0-rc2.md similarity index 90% rename from site/content/en/latest/releases/v0.2.0-rc.2.md rename to site/content/en/latest/releases/v0.2.0-rc2.md index 756ccfb18da7..6ae018bd0108 100644 --- a/site/content/en/latest/releases/v0.2.0-rc.2.md +++ b/site/content/en/latest/releases/v0.2.0-rc2.md @@ -1,6 +1,6 @@ --- -title: "v0.2.0-rc.2" -publishdate: 2022-09-29 +title: "v0.2.0-rc2" +publishdate: 2022-09-29 00:00:00 --- Date: September 29, 2022 @@ -10,7 +10,7 @@ Date: September 29, 2022 - Added `kube-demo` target to demonstrate Envoy Gateway functionality. - Added developer debugging documentation. -## CI +## Ci - Added Gateway API conformance tests. ## Providers @@ -27,8 +27,9 @@ Date: September 29, 2022 - Added support for request modifier and redirect filters. - Added support to return 500 responses for invalid backends. -## Message Service +## Message-service - Updated IRs to support managing multiple Envoy fleets. -## Infra Manager +## Infra-manager - Separate Envoy infrastructure is created per Gateway. + diff --git a/site/content/en/latest/releases/v0.2.0.md b/site/content/en/latest/releases/v0.2.0.md index 6ebad0cf8f2e..a1a282ed2e6a 100644 --- a/site/content/en/latest/releases/v0.2.0.md +++ b/site/content/en/latest/releases/v0.2.0.md @@ -1,6 +1,6 @@ --- title: "v0.2.0" -publishdate: 2022-10-19 +publishdate: 2022-10-19 00:00:00 --- Date: October 19, 2022 @@ -27,20 +27,22 @@ Date: October 19, 2022 - Added IR validation. ## Translator -- Added the gatewayapi translator to translate Gateway API and associated resources to the IR and manage the status of Gateway API resources. +- Added the gatewayapi translator to translate Gateway API and associated resources to the IR and manage the +- status of Gateway API resources. - Added the xDS translator to translate the xds IR to xDS resources. -## Message Service +## Message-service - Added infra and xds IR watchable map messages for inter-component communication. - Added a Runner to each Envoy Gateway component to support pub/sub between components. - Added support for managing multiple separate Envoy proxy fleets. -## Infra Manager +## Infra-manager - Added Kubernetes Infra Manager to manage Envoy infrastructure running in a Kubernetes cluster. - Added support for managing a separate Envoy infrastructure per Gateway. ## Providers -- Added the Kubernetes provider with support for managing GatewayClass, Gateway, HTTPRoute, ReferenceGrant, and TLSRoute resources. +- Added the Kubernetes provider with support for managing GatewayClass, Gateway, HTTPRoute, ReferenceGrant, and +- TLSRoute resources. - Due to Issue #539, a ReferenceGrant is not removed from the system when unreferenced. - Due to Issue #577, TLSRoute is not being tested for Gateway API conformance. - Added watchers for dependent resources of managed Envoy infrastructure to trigger reconciliation. @@ -51,3 +53,4 @@ Date: October 19, 2022 - Added xDS server support to configure managed Envoys using Delta xDS. - Added initial support for mTLS between the xDS server and managed Envoys. - Due to envoyproxy/go-control-plane Issue #599, Envoy Gateway logs the private key of HTTPS listeners. + diff --git a/site/content/en/latest/releases/v0.3.0-rc.1.md b/site/content/en/latest/releases/v0.3.0-rc.1.md index 4c50801e6f3e..76adf20cbc49 100644 --- a/site/content/en/latest/releases/v0.3.0-rc.1.md +++ b/site/content/en/latest/releases/v0.3.0-rc.1.md @@ -1,6 +1,6 @@ --- title: "v0.3.0-rc.1" -publishdate: 2023-02-02 +publishdate: 2023-02-02 00:00:00 --- Date: February 02, 2023 @@ -62,3 +62,4 @@ Date: February 02, 2023 ## xDS - Fixed Start xDS Server Watchable Map Panics - Enabled Access Logging for xDS Components + diff --git a/site/content/en/latest/releases/v0.3.0.md b/site/content/en/latest/releases/v0.3.0.md index 4eacf8c45c85..1d7eccbf0399 100644 --- a/site/content/en/latest/releases/v0.3.0.md +++ b/site/content/en/latest/releases/v0.3.0.md @@ -1,6 +1,6 @@ --- title: "v0.3.0" -publishdate: 2023-02-09 +publishdate: 2023-02-09 00:00:00 --- Date: February 09, 2023 @@ -75,3 +75,4 @@ Date: February 09, 2023 ## xDS - Fixed Start xDS Server Watchable Map Panics - Enabled Access Logging for xDS Components + diff --git a/site/content/en/latest/releases/v0.4.0-rc.1.md b/site/content/en/latest/releases/v0.4.0-rc.1.md index 927069f641f5..c27f42d2bbe2 100644 --- a/site/content/en/latest/releases/v0.4.0-rc.1.md +++ b/site/content/en/latest/releases/v0.4.0-rc.1.md @@ -1,6 +1,6 @@ --- title: "v0.4.0-rc.1" -publishdate: 2023-04-13 +publishdate: 2023-04-13 00:00:00 --- Date: April 13, 2023 @@ -54,3 +54,4 @@ Date: April 13, 2023 - Added egctl CLI Tool - Added egctl Support for Dry Runs of Gateway API Config - Added egctl Support for Dumping Envoy Proxy xDS Resources + diff --git a/site/content/en/latest/releases/v0.4.0.md b/site/content/en/latest/releases/v0.4.0.md index 12c409040888..42a917ebacf7 100644 --- a/site/content/en/latest/releases/v0.4.0.md +++ b/site/content/en/latest/releases/v0.4.0.md @@ -1,6 +1,6 @@ --- title: "v0.4.0" -publishdate: 2023-04-24 +publishdate: 2023-04-24 00:00:00 --- Date: April 24, 2023 @@ -57,3 +57,4 @@ Date: April 24, 2023 - Added egctl CLI Tool - Added egctl Support for Dry Runs of Gateway API Config - Added egctl Support for Dumping Envoy Proxy xDS Resources + diff --git a/site/content/en/latest/releases/v0.5.0-rc.1.md b/site/content/en/latest/releases/v0.5.0-rc.1.md index bda070995c8c..f55837a3a3c6 100644 --- a/site/content/en/latest/releases/v0.5.0-rc.1.md +++ b/site/content/en/latest/releases/v0.5.0-rc.1.md @@ -1,6 +1,6 @@ --- title: "v0.5.0-rc.1" -publishdate: 2023-07-26 +publishdate: 2023-07-26 00:00:00 --- Date: July 26, 2023 @@ -29,6 +29,7 @@ Date: July 26, 2023 - Added Admin Server for Envoy Gateway - Added Pprof Debug Support for Envoy Gateway - Added Support to Watch for Resources in Select Namespaces + ### Breaking Changes - Renamed field in EnvoyGateway API from Extension to ExtensionManager @@ -48,7 +49,7 @@ Date: July 26, 2023 - Skipped HTTPRouteRedirectPortAndScheme Test ## Translator -### Breaking changes +### Breaking Changes - Renamed IR resources from - to / - which also affects generated Xds Resources @@ -69,3 +70,4 @@ Date: July 26, 2023 ## Cli - Added egctl x translate Support to generate default missing Resources - Added egctl x translate Support for AuthenticationFilter and EnvoyPatchPolicy + diff --git a/site/content/en/latest/releases/v0.5.0.md b/site/content/en/latest/releases/v0.5.0.md index ce1bd6b91889..dfab32a39194 100644 --- a/site/content/en/latest/releases/v0.5.0.md +++ b/site/content/en/latest/releases/v0.5.0.md @@ -1,6 +1,6 @@ --- title: "v0.5.0" -publishdate: 2023-07-26 +publishdate: 2023-07-26 00:00:00 --- Date: July 26, 2023 @@ -29,6 +29,7 @@ Date: July 26, 2023 - Added Admin Server for Envoy Gateway - Added Pprof Debug Support for Envoy Gateway - Added Support to Watch for Resources in Select Namespaces + ### Breaking Changes - Renamed field in EnvoyGateway API from Extension to ExtensionManager @@ -50,7 +51,7 @@ Date: July 26, 2023 ## Translator ### Breaking Changes - Renamed IR resources from - to / - which also affects generated Xds Resources +- which also affects generated Xds Resources ## Providers - Reconcile Node resources to be able to compute Status Addresses for Gateway @@ -69,3 +70,4 @@ Date: July 26, 2023 ## Cli - Added egctl x translate Support to generate default missing Resources - Added egctl x translate Support for AuthenticationFilter and EnvoyPatchPolicy + diff --git a/site/content/en/latest/releases/v0.6.0-rc.1.md b/site/content/en/latest/releases/v0.6.0-rc.1.md index 5141bc27966e..9970245af0e2 100644 --- a/site/content/en/latest/releases/v0.6.0-rc.1.md +++ b/site/content/en/latest/releases/v0.6.0-rc.1.md @@ -1,6 +1,6 @@ --- title: "v0.6.0-rc.1" -publishdate: 2023-10-27 +publishdate: 2023-10-27 00:00:00 --- Date: Oct 27, 2023 @@ -30,18 +30,24 @@ Date: Oct 27, 2023 - Added Support for enabling EnvoyProxy Virtual Host metrics - Added Support for Merging Gateway resources onto the same infrastructure -### Breaking changes +### Breaking Changes - Removed the AuthenticationFilter CRD - Removed the RateLimitFilter CRD - Enabled EnvoyProxy Prometheus Endpoint by default with an option to disable it - Updated the Bootstrap field within the EnvoyProxy CRD with an additional value - field to specify bootstrap config -## watchable +## CI Tooling Testing +- + +## Conformance +- + +## Watchable - Improved caching of resource by implementing a compare function agnostic of resource order ## Translator -### Breaking changes +### Breaking Changes - Added support for routing to EndpointSlice endpoints - Added support for HTTPRoute Timeouts - Added support for multiple RequestMirror filters per HTTPRoute rule @@ -54,7 +60,7 @@ Date: Oct 27, 2023 - Added support for reconciling ServiceImport CRD - Added support for selectively watching resources based on Namespace Selector -## XDS +## xDS - Fixed Layered Runtime warnings - Upgraded to the latest version of go-control-plane that fixed xDS Resource ordering issues for ADS. - Added HTTP2 Keep Alives to the xds connection diff --git a/site/content/en/latest/releases/v0.6.0.md b/site/content/en/latest/releases/v0.6.0.md index 2b8714030b00..2404d7f489bd 100644 --- a/site/content/en/latest/releases/v0.6.0.md +++ b/site/content/en/latest/releases/v0.6.0.md @@ -1,6 +1,6 @@ --- title: "v0.6.0" -publishdate: 2023-11-01 +publishdate: 2023-11-01 00:00:00 --- Date: Nov 1, 2023 @@ -28,7 +28,7 @@ Date: Nov 1, 2023 - Added Support for enabling EnvoyProxy Virtual Host metrics - Added Support for Merging Gateway resources onto the same infrastructure -### Breaking changes +### Breaking Changes - Removed the AuthenticationFilter CRD - Removed the RateLimitFilter CRD - Moved EnvoyProxy CRD from `config.gateway.envoyproxy.io` to `gateway.envoyproxy.io` @@ -48,11 +48,11 @@ Date: Nov 1, 2023 - Improved caching of resource by implementing a compare function agnostic of resource order ## Translator -- Added support for routing to EndpointSlice endpoints -- Added support for HTTPRoute Timeouts -- Added support for multiple RequestMirror filters per HTTPRoute rule -- Use / instead of - in IR Route Names -- Added Support to ignore ports in Host header +- Added support for routing to EndpointSlice endpoints +- Added support for HTTPRoute Timeouts +- Added support for multiple RequestMirror filters per HTTPRoute rule +- Use / instead of - in IR Route Names +- Added Support to ignore ports in Host header ## Providers - Added the generationChangedPredicate to most resources to limit resource reconiliation @@ -60,11 +60,11 @@ Date: Nov 1, 2023 - Added support for reconciling ServiceImport CRD - Added support for selectively watching resources based on Namespace Selector - -## XDS +## xDS - Fixed Layered Runtime warnings - Upgraded to the latest version of go-control-plane that fixed xDS Resource ordering issues for ADS. - Added HTTP2 Keep Alives to the xds connection ## Cli - Added Support for egctl stats command + diff --git a/tools/make/docs.mk b/tools/make/docs.mk index 9a78e3032e3a..a3e40440e530 100644 --- a/tools/make/docs.mk +++ b/tools/make/docs.mk @@ -11,7 +11,7 @@ docs: docs.clean helm-readme-gen docs-api docs-api-headings ## Generate Envoy Ga cp tools/hack/get-egctl.sh $(DOCS_OUTPUT_DIR) .PHONY: docs-release -docs-release: docs-release-prepare docs-release-gen docs ## Generate Envoy Gateway Release Docs +docs-release: docs-release-prepare release-notes-docs docs-release-gen docs ## Generate Envoy Gateway Release Docs .PHONY: docs-serve docs-serve: ## Start Envoy Gateway Site Locally @@ -65,7 +65,7 @@ docs-release-prepare: echo $(TAG) > VERSION .PHONY: docs-release-gen -docs-release-gen: +docs-release-gen: @$(LOG_TARGET) @$(call log, "Added Release Doc: site/content/en/$(TAG)") cp -r site/content/en/latest site/content/en/$(TAG) @@ -79,3 +79,8 @@ docs-release-gen: @echo '[[params.versions]]' >> site/hugo.toml @echo ' version = "$(TAG)"' >> site/hugo.toml @echo ' url = "/$(TAG)"' >> site/hugo.toml + +.PHONY: release-notes-docs +release-notes-docs: $(tools/release-notes-docs) + @$(LOG_TARGET) + $(tools/release-notes-docs) release-notes/$(TAG).yaml site/content/en/latest/releases/; \ diff --git a/tools/make/tools.mk b/tools/make/tools.mk index edecb3b58f96..dda0fa26a41f 100644 --- a/tools/make/tools.mk +++ b/tools/make/tools.mk @@ -32,12 +32,17 @@ $(tools.bindir)/%: $(tools.srcdir)/%/pin.go $(tools.srcdir)/%/go.mod tools/codespell = $(tools.bindir)/codespell tools/yamllint = $(tools.bindir)/yamllint tools/sphinx-build = $(tools.bindir)/sphinx-build +tools/release-notes-docs = $(tools.bindir)/release-notes-docs $(tools.bindir)/%.d/venv: $(tools.srcdir)/%/requirements.txt mkdir -p $(@D) python3 -m venv $@ $@/bin/pip3 install -r $< || (rm -rf $@; exit 1) -$(tools.bindir)/%: $(tools.bindir)/%.d/venv - ln -sf $*.d/venv/bin/$* $@ +$(tools.bindir)/%: $(tools.bindir)/%.d/venv + @if [ -e $(tools.srcdir)/$*/$*.sh ]; then \ + ln -sf ../../$(tools.srcdir)/$*/$*.sh $@; \ + else \ + ln -sf $*.d/venv/bin/$* $@; \ + fi ifneq ($(GOOS),windows) # Shellcheck diff --git a/tools/src/release-notes-docs/release-notes-docs.sh b/tools/src/release-notes-docs/release-notes-docs.sh new file mode 100755 index 000000000000..d7102f49da12 --- /dev/null +++ b/tools/src/release-notes-docs/release-notes-docs.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -o errexit +set -o nounset +set -o pipefail + +SCRIPT_ROOT=$(dirname "${BASH_SOURCE}")/../.. + +venvPath="${SCRIPT_ROOT}/tools/bin/release-notes-docs.d/venv" + +source ${venvPath}/bin/activate +python ${SCRIPT_ROOT}/tools/src/release-notes-docs/yml2md.py "$@" +deactivate diff --git a/tools/src/release-notes-docs/requirements.txt b/tools/src/release-notes-docs/requirements.txt new file mode 100644 index 000000000000..cf39afa6b4c0 --- /dev/null +++ b/tools/src/release-notes-docs/requirements.txt @@ -0,0 +1 @@ +pyyaml==6.0.1 diff --git a/tools/src/release-notes-docs/yml2md.py b/tools/src/release-notes-docs/yml2md.py new file mode 100755 index 000000000000..d1a137682997 --- /dev/null +++ b/tools/src/release-notes-docs/yml2md.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python + +import sys +import yaml +import os +from datetime import datetime + +def change_to_markdown(change): + return '\n'.join("- {}".format(line.strip()) for line in change.strip().split('\n')) + +def format_date(date_str): + date_formats = ["%b %d, %Y", "%B %d, %Y"] + for date_format in date_formats: + try: + return datetime.strptime(date_str, date_format) + except ValueError: + pass # If the format doesn't match, move to the next one + + raise ValueError(f"Date string '{date_str}' does not match any supported format.") + +def capitalize(name): + fixed_mapping = { + 'ir': 'IR', + 'api': 'API', + 'xds': 'xDS', + 'ci-tooling-testing': 'CI Tooling Testing', + } + if name in fixed_mapping: + return fixed_mapping[name] + return name.capitalize() + +def convert_yaml_to_markdown(input_yaml_file, output_markdown_path): + # Extract the title from the input file name + title = os.path.basename(input_yaml_file).split('.yaml')[0] + # Generate the filename of output markdown file. + output_markdown_file=os.path.join(output_markdown_path,title + '.md') + + with open(input_yaml_file, 'r') as file: + data = yaml.safe_load(file) + + with open(output_markdown_file, 'w') as file: + file.write('---\n') + file.write('title: "{}"\n'.format(title)) + file.write("publishdate: {}\n".format(format_date(data['date']))) + file.write('---\n\n') + + file.write("Date: {}\n\n".format(data['date'])) + + for area in data['changes']: + file.write("## {}\n".format(capitalize(area['area']))) + if 'change' in area: + file.write(change_to_markdown(area['change']) + '\n\n') + + if 'breaking-change' in area: + file.write("### Breaking Changes\n") + file.write(change_to_markdown(area['breaking-change']) + '\n\n') + + print("Markdown file '{}' has been generated.".format(output_markdown_file)) + +if __name__ == "__main__": + if len(sys.argv) != 3: + print("Usage: python yml2md.py ") + sys.exit(1) + + input_yaml_file = sys.argv[1] + output_markdown_path = sys.argv[2] + convert_yaml_to_markdown(input_yaml_file, output_markdown_path) \ No newline at end of file