Skip to content

Commit 703062d

Browse files
authored
Merge pull request #89 from grafana/revert-85-update-k6registry
Revert "Update k6registry v0.3.0"
2 parents 71e2172 + 42903f2 commit 703062d

Some content is hidden

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

54 files changed

+1832
-3554
lines changed

.github/workflows/watch.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,9 @@ jobs:
6464
uses: grafana/k6-extension-actions/[email protected]
6565

6666
- name: Setup k6registry
67-
run: >
68-
go install github.com/grafana/k6registry/cmd/[email protected]
69-
70-
- name: Setup gomplate
71-
uses: jason-dour/action-setup-gomplate@81b9ca6f49d6594a118d19f0d05f6fd05372e64c # v1.1.0
72-
env:
73-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
uses: grafana/k6-extension-actions/[email protected]
68+
with:
69+
k6registry-version: v0.2.6
7470

7571
- name: Run k6registry
7672
id: generate
@@ -79,10 +75,12 @@ jobs:
7975
run: >
8076
k6registry -v
8177
--lint
78+
--api "${HTDOCS_DIR}"
8279
--ref "${BASE_URL}/registry.json"
83-
registry.yaml --out "${HTDOCS_DIR}/registry.json"
84-
85-
./generate-api-files.sh -b "${HTDOCS_DIR}"
80+
--test /registry.json,/catalog.json,/product/oss.json,/product/oss-catalog.json
81+
--test /tier/official.json,/tier/official-catalog.json,/tier/community.json,/tier/community-catalog.json
82+
--test /tier/at-least/official.json,/tier/at-least/official-catalog.json,/tier/at-least/partner.json,/tier/at-least/partner-catalog.json
83+
registry.yaml
8684
8785
- name: Cache Clean
8886
if: ${{ ( github.ref_name == 'main' && steps.generate.outputs.changed == 'true' ) || inputs.force_changed }}

CONTRIBUTING.md

Lines changed: 18 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,20 @@ Before you begin, make sure to familiarize yourself with the [Code of Conduct](C
99
## Contributing to the registry
1010

1111
> [!IMPORTANT]
12-
> Before registering a new extension, please read the [Registry Requirements](https://grafana.com/docs/k6/latest/extensions/create/extensions-registry/).
12+
> Before registering a new extension, please read the [Registry Requirements](https://grafana.com/docs/k6/latest/extensions/explanations/extensions-registry/#registry-requirements).
1313
1414
The source of the registry can be found in the [registry.yaml] file. To register an extension, simply add a new entry to the end of the file. The data of the already registered extension can be modified accordingly.
1515

1616
After modifying the [registry.yaml], it is advisable to [run the linter](#lint---run-the-linter).
1717

18-
The schema for the registry [registry.schema.json] file.
18+
[registry.yaml]: registry.yaml
1919

20-
> [!IMPORTANT]
21-
> The schema is maintained in [k6registry](https://github.com/grafana/k6registry) it is copied here for convenience but any change in the schema must be done in k6registry's repository.
20+
## Contribute to the JSON schema
21+
22+
The source of the JSON schema can be found in the [registry.schema.yaml] file. After the modification, the [schema should be converted](#schema---convert-the-schema-to-json) to JSON format and saved in the [registry.schema.json] file.
23+
24+
[registry.schema.yaml]: registry.schema.yaml
25+
[registry.schema.json]: registry.schema.json
2226

2327
## Tasks
2428

@@ -29,6 +33,7 @@ The following sections describe the typical tasks of contributing. As long as th
2933
Contributing will require the use of some tools, which can be installed most easily with a well-configured [eget] tool.
3034

3135
```bash
36+
eget mikefarah/yq
3237
eget grafana/k6registry
3338
eget hairyhenderson/gomplate
3439
pip install json-schema-for-humans
@@ -47,74 +52,20 @@ k6registry -q --lint registry.yaml
4752
[lint]: #lint---run-the-linter
4853
[k6registry]: https://github.com/grafana/k6registry
4954

50-
### public - Generate static documentation
55+
### schema - Convert the schema to JSON
56+
57+
The source of the JSON schema is [registry.schema.yaml], after its modification, the schema should be converted into JSON format and saved in [registry.schema.json].
5158

5259
```bash
53-
npx @redocly/cli build-docs -o public/index.html openapi.yaml
54-
generate-schema-doc --config with_footer=false --config collapse_long_descriptions=false registry.schema.json public/schema
55-
mv public/schema/registry.schema.html public/schema/index.html
60+
yq -o=json -P registry.schema.yaml > registry.schema.json
5661
```
5762

58-
### wiki - Generate API files
59-
60-
The registry is exposed using and API defined in [openapi.yaml]. This API is served using static files generated from the registry using the [generate-api-files.sh] script. The script takes the registry.json generated from [registry.yaml] using `k6registry` as input to generate the json file to be returned by each endpoint. It also generates a metrics.txt file with metrics for the extensions by tier, grade, and issues found.
63+
### public - Generate static documentation
6164

6265
```bash
63-
BUILD_DIR=build
64-
k6registry registry.yaml > ${BUILD_DIR}/registry.json
65-
./generate-api-files.sh -b ${BUILD_DIR}
66-
```
67-
68-
Generates the following files
69-
70-
```ascii
71-
build/
72-
├── catalog.json
73-
├── metrics.json
74-
├── metrics.txt
75-
├── registry.json
76-
├── grade
77-
│ ├── A.json
78-
│ ├── B.json
79-
│ ├── C.json
80-
│ ├── D.json
81-
│ ├── E.json
82-
│ └── F.json
83-
├── module
84-
│ ├── github.com
85-
│ │ └── grafana
86-
│ │ ├── xk6-dashboard
87-
│ │ │ ├── badge.svg
88-
│ │ │ ├── extension.json
89-
│ │ │ └── grade.svg
90-
│ │ ├── xk6-disruptor
91-
│ │ │ ├── badge.svg
92-
│ │ │ ├── extension.json
93-
│ │ │ └── grade.svg
94-
│ │ ├── xk6-faker
95-
│ │ │ ├── badge.svg
96-
│ │ │ ├── extension.json
97-
│ │ │ └── grade.svg
98-
│ │ └── xk6-sql
99-
│ │ ├── badge.svg
100-
│ │ ├── extension.json
101-
│ │ └── grade.svg
102-
│ ├── gitlab.com
103-
│ │ └── szkiba
104-
│ │ └── xk6-banner
105-
│ │ ├── badge.svg
106-
│ │ ├── extension.json
107-
│ │ └── grade.svg
108-
│ └── go.k6.io
109-
│ └── k6
110-
│ └── extension.json
111-
└── tier
112-
├── community-catalog.json
113-
├── community.json
114-
├── community-metrics.json
115-
├── official-catalog.json
116-
├── official.json
117-
└── official-metrics.json
66+
npx @redocly/cli build-docs -o public/index.html openapi.yaml
67+
generate-schema-doc --config with_footer=false --config collapse_long_descriptions=false registry.schema.json public/schema
68+
mv public/schema/registry.schema.html public/schema/index.html
11869
```
11970

12071
### wiki - Generate wiki pages
@@ -124,5 +75,5 @@ export BASE_URL=https://registry.k6.io
12475
curl -s -o build/registry.json $BASE_URL/registry.json
12576
curl -s -o build/metrics.json $BASE_URL/metrics.json
12677
curl -s -o build/official-metrics.json $BASE_URL/tier/official-metrics.json
127-
gomplate -c registry=build/registry.json -c metrics=build/metrics.json -c official_metrics=build/tier/official-metrics.json -c schema=registry.schema.json --input-dir wiki --output-map='build/wiki/{{.in|strings.TrimSuffix ".tpl"}}'
78+
gomplate -c registry=build/registry.json -c metrics=build/metrics.json -c official_metrics=build/official-metrics.json -c schema=registry.schema.json --input-dir wiki --output-map='build/wiki/{{.in|strings.TrimSuffix ".tpl"}}'
12879
```

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ Refers to the maintainer of the extension. **Optional, defaults to `community`**
6363

6464
Extensions owned by the `grafana` GitHub organization are not officially supported by Grafana by default.
6565

66+
### `products`
67+
68+
Products in which the extension can be used. **Optional, defaults to `["oss"]`**
69+
70+
### `categories`
71+
72+
The categories to which the extension belongs. **Optional, defaults to `["misc"]`**
73+
6674
### `versions`
6775

6876
List of supported versions. **Optional, the default is to query the repository manager API**

api/grade-badge.svg.tpl

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)