Skip to content

Updated script to generate feature catalog files #1735

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all 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
12 changes: 5 additions & 7 deletions scripts/generate_feature_catalog_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

import yaml

DEFAULT_STATUS = 'unsupported'
DEFAULT_EMULATION_LEVEL = 'CRUD'
FEATURES_FILE_NAME='features.yml'

MD_FILE_HEADER = """---
Expand Down Expand Up @@ -39,16 +37,16 @@ def __init__(self, file_path: str):

def add_service_section(self, feature_file_content: str):
service_name = feature_file_content.get('name')
emulation_level = feature_file_content.get('emulation_level', DEFAULT_EMULATION_LEVEL)
emulation_level = feature_file_content.get('emulation_level')
self.md_content.append(f"| **{service_name}** | [Details 🔍] | {emulation_level} | |")

def add_features_rows(self, feature_file_content: str):
for feature in feature_file_content.get('features', []):
feature_name = feature.get('name', '')
documentation_page = feature.get('documentation_page')
if documentation_page:
feature_name = f'[{feature_name}]({documentation_page})'
status = feature.get('status', DEFAULT_STATUS)
aws_docs_url = feature.get('aws_documentation_url')
if aws_docs_url:
Copy link
Member

Choose a reason for hiding this comment

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

comment: Since you've made it required in the schema you theoretically won't need this check in there anymore. But I guess it's good to stay defensive :D

feature_name = f'[{feature_name}]({aws_docs_url})'
status = feature.get('status')

limitations = feature.get('limitations', [])
limitations_md = '\n '.join(limitations) if limitations else ''
Expand Down