Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThe pull request introduces GitHub Actions matrix strategy for parallel integration testing with Docker build caching optimization, and fixes an error message in the handlers package to display actual error text instead of a hardcoded string. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.github/workflows/gateway-integration-test.yml:
- Around line 41-47: The backgrounded docker builds in the for-loop using the
mocks array may hide failures because a plain wait only returns the last job's
status; update the loop that starts docker build (symbols: mocks array, the for
mock in "${mocks[@]}" loop, docker build) to record each background PID (e.g.,
push $! into a pids array), then iterate over the pids and wait on each PID
individually, checking each exit code and failing the step (exit non-zero) if
any wait returns non-zero so build failures are propagated and the workflow
fails fast.
🧹 Nitpick comments (1)
.github/workflows/gateway-integration-test.yml (1)
49-66: Hardcoded feature file lists will silently exclude newly added tests.When a new
.featurefile is added to the repo, it won't be picked up by any group until someone manually updates this case statement. Consider auto-discovering features and splitting them dynamically (e.g.,ls features/*.feature | split), or at minimum add a CI check that verifies all.featurefiles appear in exactly one group.
| mocks=("mock-jwks" "mock-azure-content-safety" "mock-aws-bedrock-guardrail" "mock-embedding-provider" "mock-analytics-collector") | ||
| for mock in "${mocks[@]}"; do | ||
| echo "Building $mock..." | ||
| docker build -t ghcr.io/wso2/api-platform/$mock:latest tests/mock-servers/$mock | ||
| docker build -t ghcr.io/wso2/api-platform/$mock:latest tests/mock-servers/$mock & | ||
| done | ||
| wait | ||
| echo "All mock images built." |
There was a problem hiding this comment.
Backgrounded build failures may be silently ignored.
Bash wait with no arguments returns the exit status of the last process waited for. If an earlier docker build fails but a later one succeeds, the step will pass and the missing image will cause a confusing failure later during tests.
Capture PIDs and check each exit code:
🐛 Proposed fix to propagate build failures
mocks=("mock-jwks" "mock-azure-content-safety" "mock-aws-bedrock-guardrail" "mock-embedding-provider" "mock-analytics-collector")
+ pids=()
for mock in "${mocks[@]}"; do
echo "Building $mock..."
docker build -t ghcr.io/wso2/api-platform/$mock:latest tests/mock-servers/$mock &
+ pids+=($!)
done
- wait
+ failed=0
+ for pid in "${pids[@]}"; do
+ wait "$pid" || failed=1
+ done
+ if [ "$failed" -ne 0 ]; then
+ echo "One or more mock image builds failed."
+ exit 1
+ fi
echo "All mock images built."📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| mocks=("mock-jwks" "mock-azure-content-safety" "mock-aws-bedrock-guardrail" "mock-embedding-provider" "mock-analytics-collector") | |
| for mock in "${mocks[@]}"; do | |
| echo "Building $mock..." | |
| docker build -t ghcr.io/wso2/api-platform/$mock:latest tests/mock-servers/$mock | |
| docker build -t ghcr.io/wso2/api-platform/$mock:latest tests/mock-servers/$mock & | |
| done | |
| wait | |
| echo "All mock images built." | |
| mocks=("mock-jwks" "mock-azure-content-safety" "mock-aws-bedrock-guardrail" "mock-embedding-provider" "mock-analytics-collector") | |
| pids=() | |
| for mock in "${mocks[@]}"; do | |
| echo "Building $mock..." | |
| docker build -t ghcr.io/wso2/api-platform/$mock:latest tests/mock-servers/$mock & | |
| pids+=($!) | |
| done | |
| failed=0 | |
| for pid in "${pids[@]}"; do | |
| wait "$pid" || failed=1 | |
| done | |
| if [ "$failed" -ne 0 ]; then | |
| echo "One or more mock image builds failed." | |
| exit 1 | |
| fi | |
| echo "All mock images built." |
🤖 Prompt for AI Agents
In @.github/workflows/gateway-integration-test.yml around lines 41 - 47, The
backgrounded docker builds in the for-loop using the mocks array may hide
failures because a plain wait only returns the last job's status; update the
loop that starts docker build (symbols: mocks array, the for mock in
"${mocks[@]}" loop, docker build) to record each background PID (e.g., push $!
into a pids array), then iterate over the pids and wait on each PID
individually, checking each exit code and failing the step (exit non-zero) if
any wait returns non-zero so build failures are propagated and the workflow
fails fast.
Purpose
Summary by CodeRabbit
Release Notes