Skip to content

Commit

Permalink
refactor: 'tier' and 'product' properties are introduced instead of '…
Browse files Browse the repository at this point in the history
…official' and 'cloud' properties
  • Loading branch information
szkiba committed Aug 16, 2024
1 parent b902953 commit 3111757
Show file tree
Hide file tree
Showing 12 changed files with 853 additions and 87 deletions.
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ go-jsonschema -p k6registry --only-models -o registry_gen.go docs/registry.schem
The example registry can be found in [example.yaml] file, the documentation ([registry.md], [README.md]) must be updated after modification.

```bash
go run ./cmd/k6registry --lint docs/example.yaml > docs/example.json
mdcode update docs/registry.md
mdcode update README.md
```
Expand Down Expand Up @@ -147,5 +148,5 @@ Requires
## legacy - Convert legacy registry

```bash
go run ./cmd/k6registry . --legacy | yq '.[]|= pick(["module","description","official","cloud","imports","outputs","repo"])|sort_by(.module)' > ./docs/legacy.yaml
go run ./cmd/k6registry . --legacy | yq '.[]|= pick(["module","description","tier","product","imports","outputs","repo"])|sort_by(.module)' > ./docs/legacy.yaml
```
326 changes: 320 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,341 @@ Check [k6 Extension Registry Concept](docs/registry.md) for information on desig
description: Web-based metrics dashboard for k6
outputs:
- dashboard
official: true
tier: official

- module: github.com/grafana/xk6-sql
description: Load test SQL Servers
imports:
- k6/x/sql
cloud: true
official: true
tier: official
product: ["cloud", "oss"]

- module: github.com/grafana/xk6-disruptor
description: Inject faults to test
imports:
- k6/x/disruptor
official: true
tier: official

- module: github.com/szkiba/xk6-faker
description: Generate random fake data
imports:
- k6/x/faker
```
<details>
<summary><b>Example registry</b></summary>
Registry generated from the source above.
```json file=docs/example.json
[
{
"description": "Web-based metrics dashboard for k6",
"module": "github.com/grafana/xk6-dashboard",
"outputs": [
"dashboard"
],
"product": [
"oss"
],
"repo": {
"description": "A k6 extension that makes k6 metrics available on a web-based dashboard.",
"homepage": "https://github.com/grafana/xk6-dashboard",
"license": "AGPL-3.0",
"name": "xk6-dashboard",
"owner": "grafana",
"public": true,
"stars": 320,
"topics": [
"xk6",
"xk6-official",
"xk6-output-dashboard"
],
"url": "https://github.com/grafana/xk6-dashboard",
"versions": [
"v0.7.5",
"v0.7.4",
"v0.7.3",
"v0.7.3-alpha.1",
"v0.7.2",
"v0.7.1",
"v0.7.0",
"v0.7.0-apha.3",
"v0.7.0-alpha.5",
"v0.7.0-alpha.4",
"v0.7.0-alpha.3",
"v0.7.0-alpha.2",
"v0.7.0-alpha.1",
"v0.6.1",
"v0.6.0",
"v0.5.5",
"v0.5.4",
"v0.5.3",
"v0.5.2",
"v0.5.1",
"v0.5.0",
"v0.4.4",
"v0.4.3",
"v0.4.2",
"v0.4.1",
"v0.4.0",
"v0.3.2",
"v0.3.1",
"v0.3.0",
"v0.2.0",
"v0.1.3",
"v0.1.2",
"v0.1.1",
"v0.1.0"
]
},
"tier": "official"
},
{
"description": "Load test SQL Servers",
"imports": [
"k6/x/sql"
],
"module": "github.com/grafana/xk6-sql",
"product": [
"cloud",
"oss"
],
"repo": {
"description": "k6 extension to load test RDBMSs (PostgreSQL, MySQL, MS SQL and SQLite3)",
"homepage": "https://github.com/grafana/xk6-sql",
"license": "Apache-2.0",
"name": "xk6-sql",
"owner": "grafana",
"public": true,
"stars": 102,
"topics": [
"k6",
"sql",
"xk6"
],
"url": "https://github.com/grafana/xk6-sql",
"versions": [
"v0.4.0",
"v0.3.0",
"v0.2.1",
"v0.2.0",
"v0.1.1",
"v0.1.0",
"v0.0.1"
]
},
"tier": "official"
},
{
"description": "Inject faults to test",
"imports": [
"k6/x/disruptor"
],
"module": "github.com/grafana/xk6-disruptor",
"product": [
"oss"
],
"repo": {
"description": "Extension for injecting faults into k6 tests",
"homepage": "https://k6.io/docs/javascript-api/xk6-disruptor/",
"license": "AGPL-3.0",
"name": "xk6-disruptor",
"owner": "grafana",
"public": true,
"stars": 87,
"topics": [
"chaos-engineering",
"fault-injection",
"k6",
"testing",
"xk6"
],
"url": "https://github.com/grafana/xk6-disruptor",
"versions": [
"v0.3.11",
"v0.3.10",
"v0.3.9",
"v0.3.8",
"v0.3.7",
"v0.3.6",
"v0.3.5",
"v0.3.5-rc2",
"v0.3.5-rc1",
"v0.3.4",
"v0.3.3",
"v0.3.2",
"v0.3.1",
"v0.3.0",
"v0.2.1",
"v0.2.0",
"v0.1.3",
"v0.1.2",
"v0.1.1",
"v0.1.0"
]
},
"tier": "official"
},
{
"description": "Generate random fake data",
"imports": [
"k6/x/faker"
],
"module": "github.com/szkiba/xk6-faker",
"product": [
"oss"
],
"repo": {
"description": "Random fake data generator for k6.",
"homepage": "http://ivan.szkiba.hu/xk6-faker/",
"license": "AGPL-3.0",
"name": "xk6-faker",
"owner": "szkiba",
"public": true,
"stars": 49,
"topics": [
"xk6",
"xk6-javascript-k6-x-faker"
],
"url": "https://github.com/szkiba/xk6-faker",
"versions": [
"v0.3.0",
"v0.3.0-alpha.1",
"v0.2.2",
"v0.2.1",
"v0.2.0",
"v0.1.0"
]
},
"tier": "community"
},
{
"description": "A modern load testing tool, using Go and JavaScript",
"module": "go.k6.io/k6",
"product": [
"cloud",
"oss"
],
"repo": {
"description": "A modern load testing tool, using Go and JavaScript - https://k6.io",
"homepage": "https://github.com/grafana/k6",
"license": "AGPL-3.0",
"name": "k6",
"owner": "grafana",
"public": true,
"stars": 24184,
"topics": [
"es6",
"go",
"golang",
"hacktoberfest",
"javascript",
"load-generator",
"load-testing",
"performance"
],
"url": "https://github.com/grafana/k6",
"versions": [
"v0.53.0",
"v0.52.0",
"v0.51.0",
"v0.50.0",
"v0.49.0",
"v0.48.0",
"v0.47.0",
"v0.46.0",
"v0.45.1",
"v0.45.0",
"v0.44.1",
"v0.44.0",
"v0.43.1",
"v0.43.0",
"v0.42.0",
"v0.41.0",
"v0.40.0",
"v0.39.0",
"v0.38.3",
"v0.38.2",
"v0.38.1",
"v0.38.0",
"v0.37.0",
"v0.36.0",
"v0.35.0",
"v0.34.1",
"v0.34.0",
"v0.33.0",
"v0.32.0",
"v0.31.1",
"v0.31.0",
"v0.30.0",
"v0.29.0",
"v0.28.0",
"v0.27.1",
"v0.27.0",
"v0.26.2",
"v0.26.1",
"v0.26.0",
"v0.25.1",
"v0.25.0",
"v0.24.0",
"v0.23.1",
"v0.23.0",
"v0.22.1",
"v0.22.0",
"v0.21.1",
"v0.21.0",
"v0.20.0",
"v0.19.0",
"v0.18.2",
"v0.18.1",
"v0.18.0",
"v0.17.2",
"v0.17.1",
"v0.17.0",
"v0.16.0",
"v0.15.0",
"v0.14.0",
"v0.13.0",
"v0.12.2",
"v0.12.1",
"v0.11.0",
"v0.10.0",
"v0.9.3",
"v0.9.2",
"v0.9.1",
"v0.9.0",
"v0.8.5",
"v0.8.4",
"v0.8.3",
"v0.8.2",
"v0.8.1",
"v0.8.0",
"v0.7.0",
"v0.6.0",
"v0.5.2",
"v0.5.1",
"v0.5.0",
"v0.4.5",
"v0.4.4",
"v0.4.3",
"v0.4.2",
"v0.4.1",
"v0.4.0",
"v0.3.0",
"v0.2.1",
"v0.2.0",
"v0.0.2",
"v0.0.1"
]
},
"tier": "official"
}
]
```

</details>

A [legacy extension registry](docs/legacy.yaml) converted to the new format is also a good example.

## Install
Expand Down Expand Up @@ -82,11 +396,11 @@ changed | `true` if the output has changed compared to `ref`, otherwise `false`

```yaml
- name: Generate registry in JSON format
uses: grafana/[email protected].4
uses: grafana/[email protected].10
with:
in: "registry.yaml"
out: "registry.json"
filter: "."
lint: "true"
```
## CLI
Expand Down
Loading

0 comments on commit 3111757

Please sign in to comment.