test: wait for registration-service deployment to be created in manage-devsandbox-dashboard.sh#1246
Conversation
WalkthroughReplaces the single wait-for-availability call for Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant CI as CI script
participant K8s as Kubernetes API
participant Deployment as registration-service (Deployment)
participant Route as registration-service (Route)
rect rgb(230,245,255)
Note over CI,K8s: Phase 1 — poll for Deployment resource creation (<= 5m)
CI->>K8s: GET Deployment `registration-service` in host namespace
alt not present
K8s-->>CI: 404 / not found
CI->>CI: print dots, ++counter, sleep 2s
loop until timeout
end
rect rgb(255,230,230)
Note right of CI: on timeout -> list deployments, print error, exit
end
else present
K8s-->>CI: 200 / deployment exists
end
end
rect rgb(230,255,230)
Note over CI,Deployment: Phase 2 — wait for condition Available (<= 2m)
CI->>Deployment: wait-for condition=Available
alt becomes Available
Deployment-->>CI: status=Available
else timeout
Deployment-->>CI: status!=Available (timeout)
end
end
rect rgb(245,245,220)
Note over CI,Route: Route sync (unchanged)
CI->>K8s: existing route wait/poll logic
K8s-->>CI: route status / timeout as before
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🔇 Additional comments (3)
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 @scripts/ci/manage-devsandbox-dashboard.sh:
- Around line 179-192: The polling loop uses arithmetic post-increment
((COUNTER++)) which returns exit status 1 when COUNTER is 0 and causes the
script (with set -e enabled) to exit immediately; replace the increment with a
safe form that always succeeds (e.g., COUNTER=$((COUNTER+1)) or
COUNTER=$((COUNTER + 1)) or ((COUNTER+=1))) and keep the rest of the loop logic
around the deployment check for registration-service and TIMEOUT/COUTNER
variables; additionally, after the while loop completes successfully, add an
echo or newline to move output to the next line so the final messages aren’t
printed on the same line as the progress dots.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
scripts/ci/manage-devsandbox-dashboard.sh
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: GolangCI Lint
- GitHub Check: Unit Tests
- GitHub Check: Build & push operator bundles & dashboard image for e2e tests
🔇 Additional comments (1)
scripts/ci/manage-devsandbox-dashboard.sh (1)
193-194: Approve the two-phase wait approach.The solution correctly addresses the root cause described in the PR objectives by ensuring the deployment resource exists before waiting for the Available condition. The 2-minute timeout for the availability check is reasonable.
Once the critical
((COUNTER++))bug is fixed, this implementation will properly solve the "deployments.apps 'registration-service' not found" error.
|
xcoulon
left a comment
There was a problem hiding this comment.
yeah, it's too bad that the oc wait command fails when the resource to check doesn't exist yet :/
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alexeykazakov, fbm3307, rsoaresd, xcoulon The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |



Description
I thought
oc wait --for=condition=Available deployment/registration-service -n toolchain-host-06215102 --timeout=5mwas failing due to short timeout, but afterall it was failing because, by the time we check if deployment registration-service is available, the deployment was not created yet (Error from server (NotFound): deployments.apps "registration-service" not found), so we need to first wait for the deployment to be created.Sorry!
job example: https://prow.ci.openshift.org/view/gs/test-platform-results/pr-logs/pull/openshift_release/72470/rehearse-72470-pull-ci-codeready-toolchain-devsandbox-dashboard-master-e2e/2008644101292953600#1:build-log.txt%3A1270
More context: #1245
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.