diff --git a/copier.yml b/copier.yml index cd9b6730..84dec3b4 100644 --- a/copier.yml +++ b/copier.yml @@ -61,9 +61,37 @@ author_email: component_owner: type: str help: | - Owner of the component in the Developer Portal Software Catalogue. - This will normally be group:default/ - default: "group:default/sscc" + The unique name of the person or group who owns this component in + the Developer Portal Software Catalogue. + This will normally be group:default/. For a full list of groups visit + https://dev-portal.diamond.ac.uk/catalog?filters%5Bkind%5D=group&filters%5Buser%5D=all + and hover over each group link to see its group ID, e.g. + https://dev-portal.diamond.ac.uk/catalog/default/group/accelerator-controls + would go here as group:default/accelerator-controls. + + +component_type: + type: str + help: | + Type of the component in the Developer Portal Software Catalogue. + Most likely service, library or application (without quotes). + choices: + - library + - service + - user-interface + - website + default: library + +component_lifecycle: + type: str + help: | + Project's current lifecycle stage, to be displayed in the Developer + Portal Software Catalogue. + choices: + - experimental + - production + - deprecated + default: experimental # Template Options docker: diff --git a/example-answers.yml b/example-answers.yml index 8a94d7d4..0ff28f7f 100644 --- a/example-answers.yml +++ b/example-answers.yml @@ -1,6 +1,8 @@ author_email: tom.cobb@diamond.ac.uk author_name: Tom Cobb -component_owner: group:default/sscc +component_owner: group:default/daq +component_type: service +component_lifecycle: experimental description: An expanded https://github.com/DiamondLightSource/python-copier-template to illustrate how it looks with all the options enabled. distribution_name: dls-python-copier-template-example docker: true diff --git a/template/catalog-info.yaml.jinja b/template/catalog-info.yaml.jinja index 84c68b35..f58977e0 100644 --- a/template/catalog-info.yaml.jinja +++ b/template/catalog-info.yaml.jinja @@ -5,6 +5,6 @@ metadata: title: {{ repo_name }} description: {{ description }} spec: - type: documentation - lifecycle: experimental + type: {{ component_type }} + lifecycle: {{ component_lifecycle }} owner: {{ component_owner }} diff --git a/tests/test_example.py b/tests/test_example.py index 185a588c..e772a833 100644 --- a/tests/test_example.py +++ b/tests/test_example.py @@ -163,3 +163,26 @@ def test_works_in_pyright_strict_mode(tmp_path: Path): # Ensure pyright is still happy run = make_venv(tmp_path) run(f"./venv/bin/pyright {tmp_path}") + + +def test_catalog_info(tmp_path: Path): + copy_project(tmp_path) + catalog_info_path = tmp_path / "catalog-info.yaml" + with catalog_info_path.open("r") as stream: + catalog_info = yaml.safe_load(stream) + assert catalog_info == { + "apiVersion": "backstage.io/v1alpha1", + "kind": "Component", + "metadata": { + "name": "dls-python-copier-template-example", + "title": "python-copier-template-example", + "description": "An expanded " + "https://github.com/DiamondLightSource/python-copier-template " + "to illustrate how it looks with all the options enabled.", + }, + "spec": { + "type": "service", + "lifecycle": "experimental", + "owner": "group:default/daq", + }, + }