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

Commit a597e21

Browse files
author
Jaroslav Sevcik
committed
chore(schema): schema format changes
1 parent ae4120d commit a597e21

File tree

5 files changed

+275
-222
lines changed

5 files changed

+275
-222
lines changed

test/components/test_components_generation.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ def generate_base_component(base_component_factory, link_factory, group_factory)
1515
component = base_component_factory(
1616
id=1,
1717
name="base",
18-
type="component",
18+
type="database",
1919
description="This is my fancy component",
20-
kind="kind",
20+
kind="component",
2121
owner="platform",
2222
service=None,
2323
library=None,
@@ -40,31 +40,32 @@ def generate_base_component(base_component_factory, link_factory, group_factory)
4040
id=2,
4141
name="Sentry",
4242
url="https://sentry.skypicker.com",
43-
icon="poop",
4443
component=component,
4544
)
4645

4746

4847
def test_generate_base_component(generate_base_component):
4948
expected = """
50-
apiVersion: v1alpha1,
51-
kind: component,
52-
metadata:
53-
name: base,
54-
owner: platform,
49+
- apiVersion: v1alpha1
50+
kind: component
51+
metadata:
52+
name: base
53+
owner: platform
5554
group:
56-
product_owner: john
57-
project_owner: doe
58-
maintainers: []
59-
description: This is my fancy component,
60-
tags: [],
55+
product_owner: john
56+
project_owner: doe
57+
maintainers: []
58+
description: This is my fancy component
59+
tags: []
6160
links:
6261
- name: Datadog
6362
url: https://dashboard.datadog.com
6463
icon: poop
6564
- name: Sentry
6665
url: https://sentry.skypicker.com
6766
icon: null
67+
spec:
68+
type: database
6869
"""
6970
repository = Repository.objects.get(pk=1)
7071
content = generate(repository)
Lines changed: 56 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,61 @@
1-
type: object
1+
---
2+
additionalProperties: false
23
properties:
3-
apiVersion:
4+
apiVersion:
5+
type: string
6+
kind:
7+
enum:
8+
- component
9+
type: string
10+
metadata:
11+
properties:
12+
description:
13+
nullable: true
414
type: string
5-
kind: "component"
6-
metadata:
7-
type: object
8-
properties:
9-
name:
10-
type: string
11-
owner:
12-
type: string
13-
description:
14-
type: ["string", "null"]
15-
tags:
16-
type: [array, null]
17-
items:
18-
type: string
19-
links:
20-
type: ["array", "null"]
21-
items:
22-
type: object
23-
properties:
24-
name:
25-
type: string
26-
url:
27-
type: string
28-
icon:
29-
type: ["string", "null"]
30-
group:
31-
type: object
32-
properties:
33-
product_owner:
34-
type: ["string", "null"]
35-
project_owner:
36-
type: ["string", "null"]
37-
maintainers:
38-
type: ["array", "null"]
39-
items:
40-
type: string
41-
spec:
42-
type: object
15+
group:
4316
properties:
17+
maintainers:
18+
items:
19+
type: string
20+
type: array
21+
product_owner:
22+
nullable: true
4423
type: string
45-
enum: []
46-
additionalProperties: false
24+
project_owner:
25+
nullable: true
26+
type: string
27+
type: object
28+
links:
29+
items:
30+
properties:
31+
icon:
32+
nullable: true
33+
type: string
34+
name:
35+
type: string
36+
url:
37+
type: string
38+
type: object
39+
type: array
40+
name:
41+
type: string
42+
owner:
43+
type: string
44+
tags:
45+
items:
46+
type: string
47+
type: array
48+
type: object
49+
spec:
50+
properties:
51+
type:
52+
enum:
53+
- database
54+
type: string
55+
type: object
4756
required:
48-
- kind
49-
- name
50-
- owner
51-
- type
57+
- kind
58+
- name
59+
- owner
60+
- type
61+
type: object
Lines changed: 83 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,89 @@
1-
type: object
1+
---
2+
additionalProperties: false
23
properties:
3-
apiVersion:
4-
type: string
5-
kind: "component"
6-
metadata:
7-
type: object
4+
apiVersion:
5+
type: string
6+
kind: component
7+
metadata:
8+
properties:
9+
description:
10+
type:
11+
- string
12+
nullable: true
13+
group:
814
properties:
15+
maintainers:
16+
items:
17+
type: string
18+
type: array
19+
product_owner:
20+
type: string
21+
project_owner:
22+
type: string
23+
type: object
24+
links:
25+
items:
26+
properties:
27+
icon:
28+
type:
29+
- string
30+
nullable: true
931
name:
32+
type: string
33+
url:
34+
type: string
35+
type: object
36+
type:
37+
- array
38+
name:
39+
type: string
40+
owner:
41+
type: string
42+
tags:
43+
items:
44+
type: string
45+
type:
46+
- array
47+
type: object
48+
spec:
49+
properties:
50+
analysis:
51+
items:
52+
properties:
53+
exclusions:
54+
items:
1055
type: string
11-
owner:
12-
type: string
13-
description:
14-
type: ["string", "null"]
15-
tags:
16-
type: [array, null]
17-
items:
18-
type: string
19-
links:
20-
type: ["array", "null"]
21-
items:
22-
type: object
23-
properties:
24-
name:
25-
type: string
26-
url:
27-
type: string
28-
icon:
29-
type: ["string", "null"]
30-
group:
31-
type: object
32-
properties:
33-
product_owner:
34-
type: string
35-
project_owner:
36-
type: string
37-
maintainers:
38-
type: array
39-
items:
40-
type: string
41-
spec:
56+
type: array
57+
type: object
58+
type:
59+
- array
60+
impact:
61+
enum:
62+
- profit
63+
- customers
64+
- employees
65+
type: string
66+
integrations:
67+
items:
68+
properties:
69+
slack_channel:
70+
type: string
71+
sonarqube_project:
72+
type: string
73+
type: object
4274
type: object
43-
properties:
44-
type: "library"
45-
lifecycle:
46-
type: string
47-
enum: [ "beta", "production", "deprecated", "discontinued" ]
48-
impact:
49-
type: string
50-
enum: [ "profit", "customers", "employees" ]
51-
analysis:
52-
type: [ "array", "null" ]
53-
items:
54-
type: object
55-
properties:
56-
exclusions:
57-
type: array
58-
items:
59-
type: string
60-
integrations:
61-
type: object
62-
items:
63-
type: object
64-
properties:
65-
sonarqube_project:
66-
type: string
67-
slack_channel:
68-
type: string
69-
additionalProperties: false
75+
lifecycle:
76+
enum:
77+
- beta
78+
- production
79+
- deprecated
80+
- discontinued
81+
type: string
82+
type: library
83+
type: object
7084
required:
71-
- kind
72-
- name
73-
- owner
74-
- type
85+
- kind
86+
- name
87+
- owner
88+
- type
89+
type: object

0 commit comments

Comments
 (0)