Skip to content
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

scripts: backstage: Warn on missing description #1553

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: 9 additions & 3 deletions .github/scripts/gen_backstage_yaml.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import Dict, List, Tuple
from os import path, mkdir, walk, chdir
from glob import glob
import sys
import yaml
import re
import argparse
Expand Down Expand Up @@ -93,7 +94,8 @@ def get_description_parts(


def get_description(
data: List[str]
data: List[str],
file: str
) -> List[str]:
desc = []
directive_lock = False
Expand All @@ -109,6 +111,10 @@ def get_description(
else:
continue
desc.append(d)

if len(desc) < 3:
sys.exit(f"{file}: Missing overview/short-description.")

desc.pop()
desc.pop()
return desc
Expand Down Expand Up @@ -139,7 +145,7 @@ def get_description_library(

title = data[index-3][:-1]
data = data[index:]
desc = get_description(data)
desc = get_description(data, file)

return *get_description_parts(desc), title

Expand Down Expand Up @@ -182,7 +188,7 @@ def get_description_project(
index = index+1 if data[index] == '\n' else index

data = data[index:]
desc = get_description(data)
desc = get_description(data, file)

return *get_description_parts(desc), title

Expand Down
Loading