Skip to content
This repository has been archived by the owner on Feb 21, 2022. It is now read-only.

Commit

Permalink
chore(schema): schema format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaroslav Sevcik committed Jun 24, 2021
1 parent 376c2e0 commit 14dc725
Show file tree
Hide file tree
Showing 5 changed files with 275 additions and 222 deletions.
27 changes: 14 additions & 13 deletions test/components/test_components_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ def generate_base_component(base_component_factory, link_factory, group_factory)
component = base_component_factory(
id=1,
name="base",
type="component",
type="database",
description="This is my fancy component",
kind="kind",
kind="component",
owner="platform",
service=None,
library=None,
Expand All @@ -40,31 +40,32 @@ def generate_base_component(base_component_factory, link_factory, group_factory)
id=2,
name="Sentry",
url="https://sentry.skypicker.com",
icon="poop",
component=component,
)


def test_generate_base_component(generate_base_component):
expected = """
apiVersion: v1alpha1,
kind: component,
metadata:
name: base,
owner: platform,
- apiVersion: v1alpha1
kind: component
metadata:
name: base
owner: platform
group:
product_owner: john
project_owner: doe
maintainers: []
description: This is my fancy component,
tags: [],
product_owner: john
project_owner: doe
maintainers: []
description: This is my fancy component
tags: []
links:
- name: Datadog
url: https://dashboard.datadog.com
icon: poop
- name: Sentry
url: https://sentry.skypicker.com
icon: null
spec:
type: database
"""
repository = Repository.objects.get(pk=1)
content = generate(repository)
Expand Down
102 changes: 56 additions & 46 deletions zoo/components/yaml_definitions/component.yaml
Original file line number Diff line number Diff line change
@@ -1,51 +1,61 @@
type: object
---
additionalProperties: false
properties:
apiVersion:
apiVersion:
type: string
kind:
enum:
- component
type: string
metadata:
properties:
description:
nullable: true
type: string
kind: "component"
metadata:
type: object
properties:
name:
type: string
owner:
type: string
description:
type: ["string", "null"]
tags:
type: [array, null]
items:
type: string
links:
type: ["array", "null"]
items:
type: object
properties:
name:
type: string
url:
type: string
icon:
type: ["string", "null"]
group:
type: object
properties:
product_owner:
type: ["string", "null"]
project_owner:
type: ["string", "null"]
maintainers:
type: ["array", "null"]
items:
type: string
spec:
type: object
group:
properties:
maintainers:
items:
type: string
type: array
product_owner:
nullable: true
type: string
enum: []
additionalProperties: false
project_owner:
nullable: true
type: string
type: object
links:
items:
properties:
icon:
nullable: true
type: string
name:
type: string
url:
type: string
type: object
type: array
name:
type: string
owner:
type: string
tags:
items:
type: string
type: array
type: object
spec:
properties:
type:
enum:
- database
type: string
type: object
required:
- kind
- name
- owner
- type
- kind
- name
- owner
- type
type: object
151 changes: 83 additions & 68 deletions zoo/components/yaml_definitions/library.yaml
Original file line number Diff line number Diff line change
@@ -1,74 +1,89 @@
type: object
---
additionalProperties: false
properties:
apiVersion:
type: string
kind: "component"
metadata:
type: object
apiVersion:
type: string
kind: component
metadata:
properties:
description:
type:
- string
nullable: true
group:
properties:
maintainers:
items:
type: string
type: array
product_owner:
type: string
project_owner:
type: string
type: object
links:
items:
properties:
icon:
type:
- string
nullable: true
name:
type: string
url:
type: string
type: object
type:
- array
name:
type: string
owner:
type: string
tags:
items:
type: string
type:
- array
type: object
spec:
properties:
analysis:
items:
properties:
exclusions:
items:
type: string
owner:
type: string
description:
type: ["string", "null"]
tags:
type: [array, null]
items:
type: string
links:
type: ["array", "null"]
items:
type: object
properties:
name:
type: string
url:
type: string
icon:
type: ["string", "null"]
group:
type: object
properties:
product_owner:
type: string
project_owner:
type: string
maintainers:
type: array
items:
type: string
spec:
type: array
type: object
type:
- array
impact:
enum:
- profit
- customers
- employees
type: string
integrations:
items:
properties:
slack_channel:
type: string
sonarqube_project:
type: string
type: object
type: object
properties:
type: "library"
lifecycle:
type: string
enum: [ "beta", "production", "deprecated", "discontinued" ]
impact:
type: string
enum: [ "profit", "customers", "employees" ]
analysis:
type: [ "array", "null" ]
items:
type: object
properties:
exclusions:
type: array
items:
type: string
integrations:
type: object
items:
type: object
properties:
sonarqube_project:
type: string
slack_channel:
type: string
additionalProperties: false
lifecycle:
enum:
- beta
- production
- deprecated
- discontinued
type: string
type: library
type: object
required:
- kind
- name
- owner
- type
- kind
- name
- owner
- type
type: object
Loading

0 comments on commit 14dc725

Please sign in to comment.