Skip to content

Commit 9bf5478

Browse files
authored
[docs] Move OPA ecosystem pages to site top-level (#6198)
* We are having trouble managing the complexity of having ecosystem pages shown in the versioned area of the OPA docs site (see website: link ecosystem from edge #6170) * We have invested in the OPA ecosystem data recently and it makes sense to make it more prominent. * The data in the OPA Ecosystem is harder to use when nested in docs as some Hugo functions are unavailable to nested sections. This PR implements a solution by: * Pages that were under /docs/version/ecosystem, /docs/version/integrations etc have been moved to /ecosystem and /integrations. * Redirects have been created for the old pages in the netlify config. Signed-off-by: Charlie Egan <[email protected]>
1 parent df0addf commit 9bf5478

File tree

301 files changed

+668
-3820
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

301 files changed

+668
-3820
lines changed

build/policy/integrations.rego

+25-33
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ allowed_image_extensions := ["png", "svg"]
88

99
# check that all integrations have an image
1010
deny contains result if {
11-
some id, integration in input.integrations
11+
some path, integration in input.integrations
12+
13+
id := split(path, "/")[2]
1214

1315
# some integrations are allowed to have a missing image as no suitable image is available
1416
not integration.allow_missing_image == true
@@ -26,7 +28,7 @@ deny contains result if {
2628

2729
result := {
2830
"key": "integration_image",
29-
"message": sprintf("integration %s missing image in 'static/img/logos/integrations' with extension of: %v", [id, concat(",", allowed_image_extensions)]),
31+
"message": sprintf("%s missing image in 'static/img/logos/integrations' with extension of: %v", [path, concat(",", allowed_image_extensions)]),
3032
}
3133
}
3234

@@ -36,7 +38,7 @@ deny contains result if {
3638

3739
id := split(image, ".")[0]
3840

39-
not id in object.keys(input.integrations)
41+
not sprintf("/integrations/%s/", [id]) in object.keys(input.integrations)
4042

4143
result := {
4244
"key": "image_integration",
@@ -48,13 +50,13 @@ deny contains result if {
4850
deny contains result if {
4951
some id, integration in input.integrations
5052

51-
missing_fields := {"title", "layout"} - object.keys(integration)
53+
missing_fields := {"title"} - object.keys(integration)
5254

5355
count(missing_fields) > 0
5456

5557
result := {
5658
"key": "fields",
57-
"message": sprintf("integration %s missing required fields: %v", [id, concat(", ", sort(missing_fields))]),
59+
"message": sprintf("%s missing required fields: %v", [id, concat(", ", sort(missing_fields))]),
5860
}
5961
}
6062

@@ -68,21 +70,7 @@ deny contains result if {
6870

6971
result := {
7072
"key": "content",
71-
"message": sprintf("integration %s has no content", [id]),
72-
}
73-
}
74-
75-
# check that all integrations have a layout set to integration-single
76-
deny contains result if {
77-
some id, integration in input.integrations
78-
79-
layout := object.get(integration, "layout", "")
80-
81-
layout != "integration-single"
82-
83-
result := {
84-
"key": "layout",
85-
"message": sprintf("integration %s does not have layout set to: integration-single", [id]),
73+
"message": sprintf("%s has no content", [id]),
8674
}
8775
}
8876

@@ -94,11 +82,11 @@ deny contains result if {
9482

9583
some _, inventor in inventors
9684

97-
not inventor in object.keys(input.organizations)
85+
not sprintf("/organizations/%s/", [inventor]) in object.keys(input.organizations)
9886

9987
result := {
10088
"key": "inventors",
101-
"message": sprintf("integration %s references organization %s which does not exist", [id, inventor]),
89+
"message": sprintf("%s references organization %s which does not exist", [id, inventor]),
10290
}
10391
}
10492

@@ -110,45 +98,47 @@ deny contains result if {
11098

11199
some _, software in softwares
112100

113-
not software in object.keys(input.softwares)
101+
not sprintf("/softwares/%s/", [software]) in object.keys(input.softwares)
114102

115103
result := {
116104
"key": "software",
117-
"message": sprintf("integration %s references software %s which does not exist", [id, software]),
105+
"message": sprintf("%s references software %s which does not exist", [id, software]),
118106
}
119107
}
120108

121109
# check that softwares have required fields
122110
deny contains result if {
123111
some id, software in input.softwares
124112

125-
missing_fields := {"title", "layout", "link"} - object.keys(software)
113+
missing_fields := {"title", "link"} - object.keys(software)
126114

127115
count(missing_fields) > 0
128116

129117
result := {
130118
"key": "fields",
131-
"message": sprintf("software %s missing required fields: %v", [id, concat(", ", sort(missing_fields))]),
119+
"message": sprintf("%s missing required fields: %v", [id, concat(", ", sort(missing_fields))]),
132120
}
133121
}
134122

135123
# check that organizations have required fields
136124
deny contains result if {
137-
some id, organization in input.organizations
125+
some path, organization in input.organizations
138126

139-
missing_fields := {"title", "layout", "link"} - object.keys(organization)
127+
missing_fields := {"title", "link"} - object.keys(organization)
140128

141129
count(missing_fields) > 0
142130

143131
result := {
144132
"key": "fields",
145-
"message": sprintf("organization %s missing required fields: %v", [id, concat(", ", sort(missing_fields))]),
133+
"message": sprintf("%s missing required fields: %v", [path, concat(", ", sort(missing_fields))]),
146134
}
147135
}
148136

149137
# check that each organization has at least one integration
150138
deny contains result if {
151-
some id, organization in input.organizations
139+
some path, organization in input.organizations
140+
141+
id := split(path, "/")[2]
152142

153143
inventor_integrations := {i |
154144
some i, integration in input.integrations
@@ -167,13 +157,15 @@ deny contains result if {
167157

168158
result := {
169159
"key": "orphaned_org",
170-
"message": sprintf("organization %s has no integrations", [id]),
160+
"message": sprintf("%s has no integrations", [path]),
171161
}
172162
}
173163

174164
# check that each software has at least one integration
175165
deny contains result if {
176-
some id, software in input.softwares
166+
some path, software in input.softwares
167+
168+
id := split(path, "/")[2]
177169

178170
integrations := {i |
179171
some i, integration in input.integrations
@@ -184,6 +176,6 @@ deny contains result if {
184176

185177
result := {
186178
"key": "orphaned_software",
187-
"message": sprintf("software %s has no integrations", [id]),
179+
"message": sprintf("%s has no integrations", [path]),
188180
}
189181
}

0 commit comments

Comments
 (0)