Skip to content

Commit

Permalink
Create cols in version doc generator dynamically.
Browse files Browse the repository at this point in the history
Signed-off-by: Humair Khan <HumairAK@users.noreply.github.com>
  • Loading branch information
HumairAK committed Aug 15, 2023
1 parent d0c7c5a commit 2bea1f7
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 46 deletions.
73 changes: 30 additions & 43 deletions docs/release/compatibility.yaml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 7 additions & 3 deletions scripts/release/version_doc.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import yaml


def table(rows, cols):
def table(rows):
"""
Convert a list of cits into a markdown table.
Expand All @@ -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'
Expand All @@ -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('<<GENERATED_COMPATIBILITY_TABLE>>', table_md)
final_md = '<!--THIS DOC IS AUTO GENERATED-->\n' + final_md
Expand Down

0 comments on commit 2bea1f7

Please sign in to comment.