Skip to content

Commit 00f7bb5

Browse files
committed
Merge branch 'main' of github.com:wundergraph/cosmo into ludwig/eng-6993-implement-field-resolver-for-graphql-operation
2 parents 70e28e8 + 65ecdc4 commit 00f7bb5

File tree

207 files changed

+22189
-10724
lines changed

Some content is hidden

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

207 files changed

+22189
-10724
lines changed

.github/scripts/setup-keycloak.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
export KC_VERSION=25.0.1
3+
export KC_VERSION=26.2.5
44
curl -LO https://github.com/keycloak/keycloak/releases/download/"${KC_VERSION}"/keycloak-"${KC_VERSION}".zip
55

66
unzip -q keycloak-${KC_VERSION}.zip

.github/workflows/query-planner-ci.yaml

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,25 @@ concurrency:
2222
group: ${{github.workflow}}-${{github.head_ref}}
2323
cancel-in-progress: true
2424
jobs:
25-
check-label-and-engine-changes:
25+
check-labels-and-engine-changes:
2626
runs-on: ubuntu-latest
2727
outputs:
2828
has_label: ${{ steps.check_label.outputs.has_label }}
29+
has_skip_label: ${{ steps.check_label_skip.outputs.has_label }}
2930
engine_changed: ${{ steps.check_engine_changes.outputs.engine_changed }}
3031
steps:
3132
- name: Checkout Code
3233
uses: actions/checkout@v4
3334
with:
3435
fetch-depth: 0
35-
- name: Setup Go
36+
- name: Setup Go
3637
uses: actions/setup-go@v5
3738
with:
3839
go-version-file: router/go.mod
3940
cache: true
4041
- name: Check for query-planner label
4142
id: check_label
42-
uses: actions/github-script@v6
43+
uses: actions/github-script@v7
4344
with:
4445
script: |
4546
const labels = await github.rest.issues.listLabelsOnIssue({
@@ -49,6 +50,18 @@ jobs:
4950
});
5051
const hasLabel = labels.data.some(label => label.name === 'query-planner');
5152
core.setOutput('has_label', hasLabel ? 'true' : 'false');
53+
- name: Check for query-planner-skip label
54+
id: check_label_skip
55+
uses: actions/github-script@v7
56+
with:
57+
script: |
58+
const labels = await github.rest.issues.listLabelsOnIssue({
59+
owner: context.repo.owner,
60+
repo: context.repo.repo,
61+
issue_number: context.issue.number
62+
});
63+
const hasLabel = labels.data.some(label => label.name === 'query-planner-skip');
64+
core.setOutput('has_label', hasLabel ? 'true' : 'false');
5265
- name: Check for changes of engine
5366
id: check_engine_changes
5467
working-directory: router
@@ -89,10 +102,10 @@ jobs:
89102
- 'connect/**/*'
90103
- '.github/workflows/cli-ci.yaml'
91104
build-router:
92-
needs: filter-changes
105+
needs: [filter-changes, check-labels-and-engine-changes]
93106
# This is a limitation of GitHub. Only organization members can push to GitHub Container Registry
94107
# For now, we will disable the push to the GitHub Container Registry for external contributor
95-
if: ${{ needs.filter-changes.outputs.router_changed == 'true' && github.event.pull_request.head.repo.full_name == github.repository}}
108+
if: ${{ needs.filter-changes.outputs.router_changed == 'true' && github.event.pull_request.head.repo.full_name == github.repository && needs.check-labels-and-engine-changes.outputs.has_skip_label != 'true'}}
96109
runs-on: ubuntu-latest
97110
outputs:
98111
image_ref: ${{ steps.build_push_image.outputs.image_ref }}
@@ -110,10 +123,9 @@ jobs:
110123
image_name: router-qp
111124
image_description: 'Cosmo Router Query Planner'
112125
image_platforms: linux/amd64
113-
with_tests: "false"
114126
build-cli:
115-
needs: filter-changes
116-
if: ${{ needs.filter-changes.outputs.cli_changed == 'true' }}
127+
needs: [filter-changes, check-labels-and-engine-changes]
128+
if: ${{ needs.filter-changes.outputs.cli_changed == 'true' && needs.check-labels-and-engine-changes.outputs.has_skip_label != 'true'}}
117129
runs-on: ubuntu-latest
118130
outputs:
119131
wgc: ${{ steps.cli-build.outputs.artifact-url }}
@@ -125,8 +137,9 @@ jobs:
125137
github-sha: ${{ github.sha }}
126138
target: bun-linux-x64
127139
cli-release-url:
140+
needs: [filter-changes, check-labels-and-engine-changes]
128141
runs-on: ubuntu-latest
129-
if: ${{ needs.filter-changes.outputs.cli_changed != 'true' }}
142+
if: ${{ needs.filter-changes.outputs.cli_changed != 'true' && needs.check-labels-and-engine-changes.outputs.has_skip_label != 'true'}}
130143
env:
131144
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
132145
steps:
@@ -139,13 +152,13 @@ jobs:
139152
build_test: # This job is use to lock the merge of the PR if anything fails in the query planner
140153
runs-on: ubuntu-latest
141154
if: ${{ always() }}
142-
needs: [ build-router, build-cli, cli-release-url, check-label-and-engine-changes ]
155+
needs: [build-router, build-cli, cli-release-url, check-labels-and-engine-changes]
143156
outputs:
144157
workflow_url: ${{ steps.trigger_workflow.outputs.workflow_url }}
145158
workflow_id: ${{ steps.trigger_workflow.outputs.workflow_id }}
146159
steps:
147160
- uses: convictional/[email protected]
148-
if: ${{ needs.check-label-and-engine-changes.outputs.has_label == 'true' || needs.check-label-and-engine-changes.outputs.engine_changed == 'true' }}
161+
if: ${{ (needs.check-labels-and-engine-changes.outputs.has_label == 'true' || needs.check-labels-and-engine-changes.outputs.engine_changed == 'true') && needs.check-labels-and-engine-changes.outputs.has_skip_label != 'true' }}
149162
id: trigger_workflow
150163
name: Trigger Query Planner CI
151164
with:
@@ -162,9 +175,9 @@ jobs:
162175
"wgc": "${{ needs.build-cli.outputs.wgc || needs.cli-release-url.outputs.wgc }}"
163176
}
164177
get_pr_url:
165-
needs: [ build_test, check-label-and-engine-changes ]
178+
needs: [build_test, check-labels-and-engine-changes]
166179
runs-on: ubuntu-latest
167-
if: ${{ always() && (needs.check-label-and-engine-changes.outputs.has_label == 'true' || needs.check-label-and-engine-changes.outputs.engine_changed == 'true') }}
180+
if: ${{ always() && (needs.check-labels-and-engine-changes.outputs.has_label == 'true' || needs.check-labels-and-engine-changes.outputs.engine_changed == 'true') && needs.check-labels-and-engine-changes.outputs.has_skip_label != 'true' }}
168181
outputs:
169182
pullrequest_url: ${{ steps.get_url.outputs.pr_url }}
170183
steps:
@@ -200,8 +213,8 @@ jobs:
200213
pr_url=$(cat pr-url.txt)
201214
echo "pr_url=$pr_url" >> $GITHUB_OUTPUT
202215
comment-on-failure:
203-
needs: [build_test, get_pr_url, check-label-and-engine-changes]
204-
if: ${{ (needs.check-label-and-engine-changes.outputs.has_label == 'true' || needs.check-label-and-engine-changes.outputs.engine_changed == 'true') && failure() }}
216+
needs: [build_test, get_pr_url, check-labels-and-engine-changes]
217+
if: ${{ (needs.check-labels-and-engine-changes.outputs.has_label == 'true' || needs.check-labels-and-engine-changes.outputs.engine_changed == 'true') && needs.check-labels-and-engine-changes.outputs.has_skip_label != 'true' && failure() }}
205218
runs-on: ubuntu-latest
206219
steps:
207220
- name: Comment PR on failure
@@ -219,8 +232,8 @@ jobs:
219232
The Internal Query Planner CI checks failed in the celestial repository, and this is going to stop the merge of this PR.
220233
If you are part of the WunderGraph organization, you can [see the PR with more details](${{ needs.get_pr_url.outputs.pullrequest_url }}).
221234
comment-on-success:
222-
needs: [build_test, get_pr_url, check-label-and-engine-changes]
223-
if: ${{ (needs.check-label-and-engine-changes.outputs.has_label == 'true' || needs.check-label-and-engine-changes.outputs.engine_changed == 'true') && success() }}
235+
needs: [build_test, get_pr_url, check-labels-and-engine-changes]
236+
if: ${{ (needs.check-labels-and-engine-changes.outputs.has_label == 'true' || needs.check-labels-and-engine-changes.outputs.engine_changed == 'true') && needs.check-labels-and-engine-changes.outputs.has_skip_label != 'true' && success() }}
224237
runs-on: ubuntu-latest
225238
steps:
226239
- name: Comment PR on failure
@@ -231,4 +244,3 @@ jobs:
231244
# ✅ Internal Query Planner CI checks passed
232245
The Internal Query Planner CI checks passed in the celestial repository, and this is going to allow the merge of this PR.
233246
If you are part of the WunderGraph organization, you can [see the PR with more details](${{ needs.get_pr_url.outputs.pullrequest_url }}).
234-

.github/workflows/router-ci.yaml

Lines changed: 93 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,50 @@ jobs:
187187
--health-interval 10s
188188
--health-timeout 5s
189189
--health-retries 5
190-
credentials:
191-
username: ${{secrets.DOCKER_USERNAME}}
192-
password: ${{secrets.DOCKER_PASSWORD}}
193190
ports:
194191
- 6379:6379
192+
redis-0:
193+
image: bitnamilegacy/redis-cluster:7.2
194+
options: >-
195+
--health-cmd "redis-cli ping"
196+
--health-interval 10s
197+
--health-timeout 5s
198+
--health-retries 5
199+
env:
200+
ALLOW_EMPTY_PASSWORD: "yes"
201+
REDIS_NODES: "redis-0 redis-1 redis-2"
202+
REDIS_CLUSTER_REPLICAS: "0"
203+
REDIS_CLUSTER_CREATOR: "no"
204+
ports:
205+
- 7001:6379
206+
redis-1:
207+
image: bitnamilegacy/redis-cluster:7.2
208+
options: >-
209+
--health-cmd "redis-cli ping"
210+
--health-interval 10s
211+
--health-timeout 5s
212+
--health-retries 5
213+
env:
214+
ALLOW_EMPTY_PASSWORD: "yes"
215+
REDIS_NODES: "redis-0 redis-1 redis-2"
216+
REDIS_CLUSTER_REPLICAS: "0"
217+
REDIS_CLUSTER_CREATOR: "no"
218+
ports:
219+
- 7002:6379
220+
redis-2:
221+
image: bitnamilegacy/redis-cluster:7.2
222+
options: >-
223+
--health-cmd "redis-cli ping"
224+
--health-interval 10s
225+
--health-timeout 5s
226+
--health-retries 5
227+
env:
228+
ALLOW_EMPTY_PASSWORD: "yes"
229+
REDIS_NODES: "redis-0 redis-1 redis-2"
230+
REDIS_CLUSTER_REPLICAS: "0"
231+
REDIS_CLUSTER_CREATOR: "yes"
232+
ports:
233+
- 7003:6379
195234
kafka:
196235
image: bitnamilegacy/kafka:3.7.0
197236
options: >-
@@ -214,6 +253,45 @@ jobs:
214253
ports:
215254
- '9092:9092'
216255
steps:
256+
- name: Wait for Redis Cluster
257+
run: |
258+
echo "[CHECK] Waiting for Redis Cluster to become healthy..."
259+
cluster_containers=$(docker ps --quiet --filter "ancestor=bitnamilegacy/redis-cluster:7.2")
260+
261+
success=0
262+
for i in {1..30}; do
263+
if [ $i -eq 1 ]; then
264+
echo "[INIT] Forcing cluster creation..."
265+
# pick one container as the "creator"
266+
creator=$(echo $cluster_containers | awk '{print $1}')
267+
# run the cluster create command inside it
268+
docker exec "$creator" redis-cli --cluster create redis-0:6379 redis-1:6379 redis-2:6379 --cluster-replicas 0 --cluster-yes || true
269+
fi
270+
271+
for cid in $cluster_containers; do
272+
docker exec "$cid" redis-cli -p 6379 cluster info
273+
if docker exec "$cid" redis-cli -p 6379 cluster info 2>/dev/null | grep -q "cluster_state:ok"; then
274+
echo "[SUCCESS] Redis Cluster is ready (reported by $cid)"
275+
success=1
276+
break 2
277+
fi
278+
done
279+
280+
echo "[WAITING] Cluster not ready yet (attempt $i)..."
281+
sleep 2
282+
done
283+
284+
if [ $success -eq 0 ]; then
285+
echo "[ERROR] Redis Cluster did not become healthy in time"
286+
for cid in $cluster_containers; do
287+
echo "--- Cluster info for $cid ---"
288+
docker exec "$cid" redis-cli -p 6379 cluster info || true
289+
docker exec "$cid" redis-cli -p 6379 cluster nodes || true
290+
echo "--- Logs for $cid ---"
291+
docker logs "$cid" | tail -n 100
292+
done
293+
exit 1
294+
fi
217295
- uses: actions/checkout@v4
218296
- uses: ./.github/actions/go
219297
with:
@@ -224,39 +302,26 @@ jobs:
224302
- name: Install dependencies
225303
working-directory: ./router-tests
226304
run: go mod download
227-
- name: Setup Redis Cluster (for Cluster tests)
228-
uses: vishnudxb/[email protected]
229-
with:
230-
master1-port: 7001
231-
master2-port: 7002
232-
master3-port: 7003
233-
slave1-port: 7004
234-
slave2-port: 7005
235-
slave3-port: 7006
236-
sleep-duration: 5
237305
- name: Configure Redis Authentication & ACL
238306
run: |
239-
sudo apt-get install -y redis-tools
240307
docker ps -a
241308
# Set a password for each master node
242-
for port in 7001 7002 7003; do
243-
redis-cli -h 127.0.0.1 -p $port ACL SETUSER cosmo on ">test" "~*" "+@all"
244-
redis-cli -u "redis://cosmo:test@127.0.0.1:$port" ping
245-
echo "ACL user 'cosmo' created with full access on port $port"
309+
for cid in $(docker ps --format "{{.ID}} {{.Image}}" | grep "redis-cluster" | awk '{print $1}'); do
310+
echo "Configuring ACLs in container $cid"
311+
docker exec "$cid" redis-cli -p 6379 ACL SETUSER cosmo on ">test" "~*" "+@all"
312+
docker exec "$cid" redis-cli -p 6379 ping
246313
done
314+
cid=$(docker ps --format "{{.ID}} {{.Image}}" | grep "redis:7" | awk '{print $1}')
315+
# Sanity checks
316+
docker exec "$cid" redis-cli -p 6379 ping
317+
docker exec "$cid" redis-cli -u "redis://cosmo:test@redis-0:6379" ping
318+
docker exec "$cid" redis-cli -u "redis://cosmo:test@redis-0:6379" cluster nodes
247319
- name: Run Integration tests ${{ matrix.test_target }}
248320
working-directory: ./router-tests
249-
run: make test test_params="-run '^Test[^(Flaky)]' --timeout=5m -p 1 --parallel 10" test_target="${{ matrix.test_target }}"
321+
run: make test test_retry_count=0 test_params="-run '^Test[^(Flaky)]' --timeout=5m -p 1 --parallel 10" test_target="${{ matrix.test_target }}"
250322
- name: Run Flaky Integration tests ${{ matrix.test_target }}
251-
uses: nick-fields/retry@v3
252-
with:
253-
timeout_minutes: 30
254-
max_attempts: 5
255-
retry_wait_seconds: 5
256-
retry_on: error
257-
command: |
258-
cd router-tests
259-
make test test_params="-run '^TestFlaky' --timeout=5m --parallel 1" test_target="${{ matrix.test_target }}"
323+
working-directory: ./router-tests
324+
run: make test test_retry_count=3 test_params="-run '^TestFlaky' --timeout=5m -p 1 --parallel 10" test_target="${{ matrix.test_target }}"
260325

261326
image_scan:
262327
if: github.event.pull_request.head.repo.full_name == github.repository

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ setup-build-tools:
44
go install github.com/bufbuild/buf/cmd/[email protected]
55
go install google.golang.org/protobuf/cmd/[email protected]
66
go install connectrpc.com/connect/cmd/[email protected]
7-
go install gotest.tools/gotestsum@v1.12.3
7+
go install gotest.tools/gotestsum@v1.13.0
88

99
setup-dev-tools: setup-build-tools
1010
go install github.com/amacneil/dbmate/[email protected]

admission-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
],
77
"scripts": {
88
"dev": "tsx watch src/index.ts",
9-
"build": "del dist && tsc"
9+
"build": "rm -rf dist && tsc"
1010
},
1111
"dependencies": {
1212
"@hono/node-server": "1.13.7",

cdn-server/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ Binaries are attached to the github release otherwise all images can be found [h
44
All notable changes to this project will be documented in this file.
55
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
66

7+
## [0.14.5](https://github.com/wundergraph/cosmo/compare/[email protected]@0.14.5) (2025-10-03)
8+
9+
**Note:** Version bump only for package cdn
10+
711
## [0.14.4](https://github.com/wundergraph/cosmo/compare/[email protected]@0.14.4) (2025-08-07)
812

913
**Note:** Version bump only for package cdn

cdn-server/cdn/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ Binaries are attached to the github release otherwise all images can be found [h
44
All notable changes to this project will be documented in this file.
55
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
66

7+
## [0.9.5](https://github.com/wundergraph/cosmo/compare/@wundergraph/[email protected]...@wundergraph/[email protected]) (2025-10-03)
8+
9+
**Note:** Version bump only for package @wundergraph/cosmo-cdn
10+
711
## [0.9.4](https://github.com/wundergraph/cosmo/compare/@wundergraph/[email protected]...@wundergraph/[email protected]) (2025-08-07)
812

913
**Note:** Version bump only for package @wundergraph/cosmo-cdn

cdn-server/cdn/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@wundergraph/cosmo-cdn",
3-
"version": "0.9.4",
3+
"version": "0.9.5",
44
"author": {
55
"name": "WunderGraph Maintainers",
66
"email": "[email protected]"
@@ -14,7 +14,7 @@
1414
"license": "Apache-2.0",
1515
"scripts": {
1616
"dev": "tsc --watch",
17-
"build": "del dist && tsc",
17+
"build": "rm -rf dist && tsc",
1818
"test:watch": "vitest test",
1919
"test": "vitest run",
2020
"lint": "eslint --cache && prettier -c src test",

cdn-server/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cdn",
3-
"version": "0.14.4",
3+
"version": "0.14.5",
44
"private": true,
55
"author": {
66
"name": "WunderGraph Maintainers",
@@ -16,7 +16,7 @@
1616
"license": "Apache-2.0",
1717
"scripts": {
1818
"dev": "tsx watch src/index.ts",
19-
"build": "del dist && tsc",
19+
"build": "rm -rf dist && tsc",
2020
"start": "tsx src/index.ts",
2121
"lint": "eslint --cache && prettier -c src",
2222
"format:fix": "prettier --write -c src",

0 commit comments

Comments
 (0)