Skip to content

Commit 30ed651

Browse files
authored
docs: add ADR-021 component upgrade safety (#2343)
Signed-off-by: Brian Lockwood <lockwobr@gmail.com>
1 parent 05b75b7 commit 30ed651

5 files changed

Lines changed: 1082 additions & 0 deletions

File tree

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,3 +187,4 @@ aicr-e2e.xml
187187
# Resolved MDX toolchain for tools/check-docs-mdx-parse. The manifest and
188188
# lockfile in tools/mdx/ ARE committed; only the installed tree is not.
189189
tools/mdx/node_modules/
190+
*.pyc

‎Makefile‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,27 @@ coverage-check: ## Verifies $(COVERAGE_DOC_PATH) is up to date (run by qualify a
458458
fi; \
459459
echo "$(COVERAGE_DOC_PATH) is up to date"
460460

461+
VERSION_MATRIX_DOC_PATH := docs/user/component-version-matrix.md
462+
463+
.PHONY: version-matrix-docs
464+
version-matrix-docs: ## Regenerates the component version matrix in $(VERSION_MATRIX_DOC_PATH) from git history
465+
@set -e; \
466+
if ! grep -q '<!-- BEGIN AICR-VERSION-MATRIX -->' $(VERSION_MATRIX_DOC_PATH) || \
467+
! grep -q '<!-- END AICR-VERSION-MATRIX -->' $(VERSION_MATRIX_DOC_PATH); then \
468+
echo "ERROR: $(VERSION_MATRIX_DOC_PATH) is missing AICR-VERSION-MATRIX markers." >&2; exit 1; \
469+
fi; \
470+
TMP="$$(mktemp -d)"; \
471+
trap 'rm -rf "$$TMP"' EXIT; \
472+
{ ./tools/upgrade-matrix --releases 8; echo; echo "## Transitions"; echo; \
473+
./tools/upgrade-matrix --releases 8 --transitions; } > "$$TMP/matrix.md"; \
474+
awk -v body="$$TMP/matrix.md" ' \
475+
/<!-- BEGIN AICR-VERSION-MATRIX -->/ { print; while ((getline line < body) > 0) print line; close(body); skip = 1; next } \
476+
/<!-- END AICR-VERSION-MATRIX -->/ { skip = 0 } \
477+
!skip { print } \
478+
' $(VERSION_MATRIX_DOC_PATH) > "$$TMP/merged.md"; \
479+
mv "$$TMP/merged.md" $(VERSION_MATRIX_DOC_PATH); \
480+
echo "Updated $(VERSION_MATRIX_DOC_PATH)"
481+
461482
.PHONY: bom-pinning-check
462483
bom-pinning-check: ## Verifies every Helm component in the registry has a pinned chart version (per ADR-006)
463484
@set -e; \

0 commit comments

Comments
 (0)