From 2bea1f7adae97e1f56a2939d062292d38c153191 Mon Sep 17 00:00:00 2001 From: Humair Khan Date: Tue, 15 Aug 2023 16:39:23 -0400 Subject: [PATCH] Create cols in version doc generator dynamically. Signed-off-by: Humair Khan --- docs/release/compatibility.yaml | 73 ++++++++++++++------------------- scripts/release/version_doc.py | 10 +++-- 2 files changed, 37 insertions(+), 46 deletions(-) diff --git a/docs/release/compatibility.yaml b/docs/release/compatibility.yaml index a972f0f7..b774bc56 100644 --- a/docs/release/compatibility.yaml +++ b/docs/release/compatibility.yaml @@ -1,43 +1,30 @@ -cols: - - dsp - - kfp-tekton - - ml-metadata - - envoy - - ocp-pipelines - - oauth-proxy - - mariadb-103 - - ubi-minimal - - ubi-micro - - openshift -# Every item in .cols should exist as a key in .rows[n] -rows: - - dsp: 1.0.x - kfp-tekton: 1.5.1 - ml-metadata: 1.5.0 - envoy: 1.8.4 - ocp-pipelines: v4.10 - oauth-proxy: v4.12 - mariadb-103: 1 - ubi-minimal: 8.8 - ubi-micro: 8.8 - openshift: 4.10,4.11,4.12 - - dsp: 1.1.x - kfp-tekton: 1.5.1 - ml-metadata: 1.5.0 - envoy: 1.8.4 - ocp-pipelines: v4.10 - oauth-proxy: v4.12 - mariadb-103: 1 - ubi-minimal: 8.8 - ubi-micro: 8.8 - openshift: 4.10,4.11,4.12 - - dsp: 1.2.x - kfp-tekton: 1.5.1 - ml-metadata: 1.5.0 - envoy: 1.8.4 - ocp-pipelines: v4.10 - oauth-proxy: v4.10 - mariadb-103: 1 - ubi-minimal: 8.8 - ubi-micro: 8.8 - openshift: 4.10,4.11,4.12 +- dsp: 1.0.x + kfp-tekton: 1.5.1 + ml-metadata: 1.5.0 + envoy: 1.8.4 + ocp-pipelines: v4.10 + oauth-proxy: v4.12 + mariadb-103: 1 + ubi-minimal: 8.8 + ubi-micro: 8.8 + openshift: 4.10,4.11,4.12 +- dsp: 1.1.x + kfp-tekton: 1.5.1 + ml-metadata: 1.5.0 + envoy: 1.8.4 + ocp-pipelines: v4.10 + oauth-proxy: v4.12 + mariadb-103: 1 + ubi-minimal: 8.8 + ubi-micro: 8.8 + openshift: 4.10,4.11,4.12 +- dsp: 1.2.x + kfp-tekton: 1.5.1 + ml-metadata: 1.5.0 + envoy: 1.8.4 + ocp-pipelines: v4.10 + oauth-proxy: v4.10 + mariadb-103: 1 + ubi-minimal: 8.8 + ubi-micro: 8.8 + openshift: 4.10,4.11,4.12 diff --git a/scripts/release/version_doc.py b/scripts/release/version_doc.py index 4fb7eee4..2fe13437 100644 --- a/scripts/release/version_doc.py +++ b/scripts/release/version_doc.py @@ -1,7 +1,7 @@ import yaml -def table(rows, cols): +def table(rows): """ Convert a list of cits into a markdown table. @@ -14,6 +14,10 @@ def table(rows, cols): if len(rows) == 0: return markdown_table + cols = [] + for row in rows: + cols.extend([key for key in row.keys() if key not in cols]) + markdown_header = '| ' + ' | '.join(cols) + ' |' markdown_header_separator = '|-----' * len(cols) + '|' markdown_table += markdown_header + '\n' @@ -31,12 +35,12 @@ def version_doc(args): input_file = args.input_file out_file = args.out_file with open(input_file, 'r') as f: - versions = yaml.safe_load(f) + rows = yaml.safe_load(f) with open('template/version_doc.md', 'r') as vd: final_md = vd.read() - table_md = table(versions['rows'], versions['cols']) + table_md = table(rows) final_md = final_md.replace('<>', table_md) final_md = '\n' + final_md