Skip to content

Commit d768d53

Browse files
authored
Merge OpenAPI Specs (#136)
* merge openapi specs and delete public api * fix openapi difference + fix scripts + fix yaml * pop at end of script * remove working directory from spec generation commands * make sure yaml binaries are built * add --output-yaml instead of --output * template before worker * delete temp spec yamls after merge * update openapi client generator
1 parent 6ad0728 commit d768d53

File tree

12 files changed

+1181
-3777
lines changed

12 files changed

+1181
-3777
lines changed

.github/workflows/ci.yaml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ jobs:
2727
build-config: ""
2828
- platform: linux/arm64
2929
target: aarch64-unknown-linux-gnu
30-
build-config: "--config \"target.aarch64-unknown-linux-gnu.linker = 'aarch64-linux-gnu-gcc'\""
30+
build-config: '--config "target.aarch64-unknown-linux-gnu.linker = ''aarch64-linux-gnu-gcc''"'
3131
name: docker-targets-build (${{ matrix.platform.platform }})
3232
steps:
3333
- name: Checkout
3434
uses: actions/checkout@v3
3535
with:
3636
submodules: recursive
37-
fetch-depth: '0'
37+
fetch-depth: "0"
3838
- name: Prepare
3939
run: |
4040
platform=${{ matrix.platform.platform }}
@@ -89,7 +89,7 @@ jobs:
8989
uses: actions/checkout@v3
9090
with:
9191
submodules: recursive
92-
fetch-depth: '0'
92+
fetch-depth: "0"
9393
- name: Prepare
9494
run: |
9595
echo "PLATFORMS=linux/amd64,linux/arm64" >> $GITHUB_ENV
@@ -294,7 +294,8 @@ jobs:
294294
path: |
295295
target/release/golem-template-service
296296
target/release/golem-worker-service
297-
target/release/golem-service-yaml
297+
target/release/golem-worker-service-yaml
298+
target/release/golem-template-service-yaml
298299
target/release/golem-shard-manager
299300
target/release/worker-executor
300301
integration-tests:
@@ -332,9 +333,15 @@ jobs:
332333
path: ./target/debug/
333334
- name: Restore executable flag
334335
run: chmod a+x ./target/debug/*
335-
- name: Generate Golem OpenAPI yaml
336-
working-directory: golem-public-api
337-
run: ../target/debug/golem-service-yaml > ../target/golem-service.yaml
336+
- name: Generate golem-template-service OpenAPI yaml
337+
run: ./target/debug/golem-template-service-yaml > ./target/golem-template-service.yaml
338+
- name: Generate golem-worker-service OpenAPI yaml
339+
run: ./target/debug/golem-worker-service-yaml > ./target/golem-worker-service.yaml
340+
- name: Merge openapi specs
341+
working-directory: golem-openapi-client-generator
342+
run: |
343+
cargo build
344+
./target/debug/golem-openapi-client-generator merge --spec-yaml ../target/golem-template-service.yaml ../target/golem-worker-service.yaml --output-yaml ../target/golem-service.yaml
338345
- name: Check Golem OpenAPI yaml latest
339346
shell: bash
340347
run: |
@@ -351,7 +358,7 @@ jobs:
351358
run: |
352359
expected_version=$( ../scripts/expected-client-version.sh )
353360
cargo build
354-
./target/debug/golem-openapi-client-generator --spec-yaml ../openapi/golem-service.yaml --output-directory ../golem-client --name "golem-client" --client-version "${expected_version}"
361+
./target/debug/golem-openapi-client-generator generate --spec-yaml ../openapi/golem-service.yaml --output-directory ../golem-client --name "golem-client" --client-version "${expected_version}"
355362
- name: Integration tests
356363
working-directory: golem-cli
357364
env:

Cargo.lock

Lines changed: 0 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ members = [
1010
"golem-template-service",
1111
"golem-shard-manager",
1212
"golem-worker-service",
13-
"golem-public-api"
1413
]
1514

1615
exclude = [
@@ -45,7 +44,7 @@ exclude = [
4544
"golem-client",
4645
"golem-cli",
4746
"libtest-mimic",
48-
"wasm-rpc"
47+
"wasm-rpc",
4948
]
5049

5150
[workspace.dependencies]
@@ -59,7 +58,11 @@ chrono = { version = "0.4.32", features = ["serde"] }
5958
console-subscriber = "0.2.0"
6059
dashmap = "5.5.3"
6160
figment = { version = "0.10.14", features = ["toml", "env"] }
62-
fred = { version = "8.0.0", features = ["metrics", "serde-json", "partial-tracing"] }
61+
fred = { version = "8.0.0", features = [
62+
"metrics",
63+
"serde-json",
64+
"partial-tracing",
65+
] }
6366
futures = "0.3"
6467
futures-core = "0.3.29"
6568
futures-util = "0.3.29"
@@ -73,7 +76,15 @@ poem = "2.0.0"
7376
opentelemetry = "0.21.0"
7477
opentelemetry-prometheus = "0.14.1"
7578
opentelemetry_sdk = "0.21.2"
76-
poem-openapi = { version = "4.0.0", features = ["swagger-ui", "chrono", "time", "humantime", "uuid", "url", "websocket"] }
79+
poem-openapi = { version = "4.0.0", features = [
80+
"swagger-ui",
81+
"chrono",
82+
"time",
83+
"humantime",
84+
"uuid",
85+
"url",
86+
"websocket",
87+
] }
7788
prometheus = { version = "0.13.3", features = ["process"] }
7889
proptest = "1.4.0"
7990
prost = "0.12.3"
@@ -82,15 +93,27 @@ serde = { version = "1.0", features = ["derive"] }
8293
serde_json = { version = "1.0" }
8394
tempfile = "3.9.0"
8495
thiserror = "1.0.56"
85-
tokio = { version = "1.0", features = ["macros", "rt-multi-thread", "sync", "io-std", "net", "tracing"] }
96+
tokio = { version = "1.0", features = [
97+
"macros",
98+
"rt-multi-thread",
99+
"sync",
100+
"io-std",
101+
"net",
102+
"tracing",
103+
] }
86104
tokio-rustls = { version = "0.25.0" }
87105
tokio-stream = { version = "0.1", features = ["sync"] }
88106
tonic = "0.10.2"
89107
tonic-reflection = "0.10.2"
90108
tonic-health = "0.10.2"
91109
tracing = { version = "0.1.40", features = ["log"] }
92110
tracing-opentelemetry = "0.22.0"
93-
tracing-subscriber = { version = "0.3.17", features = ["env-filter", "fmt", "std", "json"] }
111+
tracing-subscriber = { version = "0.3.17", features = [
112+
"env-filter",
113+
"fmt",
114+
"std",
115+
"json",
116+
] }
94117
url = "2.5.0"
95118
uuid = { version = "1.7.0", features = ["serde", "v4"] }
96119
warp = "0.3.6"

golem-public-api/Cargo.toml

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

golem-public-api/README.md

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

golem-public-api/src/main.rs

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

golem-template-service/src/api/healthcheck.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ pub struct VersionInfo {
2121

2222
#[OpenApi(prefix_path = "/", tag = ApiTags::HealthCheck)]
2323
impl HealthcheckApi {
24-
#[oai(path = "/healthcheck", method = "get")]
24+
#[oai(path = "/healthcheck", method = "get", operation_id = "healthcheck")]
2525
async fn healthcheck(&self) -> Json<HealthcheckResponse> {
2626
Json(HealthcheckResponse {})
2727
}
2828

29-
#[oai(path = "/version", method = "get")]
29+
#[oai(path = "/version", method = "get", operation_id = "version")]
3030
async fn version(&self) -> Json<VersionInfo> {
3131
Json(VersionInfo {
3232
version: VERSION.to_string(),

0 commit comments

Comments
 (0)