-
Notifications
You must be signed in to change notification settings - Fork 68
Raise mcpchecker core pass rate on OCP CI #463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,7 @@ | ||
| # !CAUTION! Destructive mode enabled by default for development. | ||
| read_only = false | ||
| disable_destructive = false | ||
|
|
||
| # Evals run the server out-of-cluster; pin the kubeconfig provider so an | ||
| # in-cluster environment cannot take over. Override in a later drop-in if needed. | ||
| cluster_provider_strategy = "kubeconfig" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| #!/usr/bin/env bash | ||
| kubectl delete pod -n web test-connection --ignore-not-found | ||
| kubectl delete namespace web |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,41 @@ | ||
| #!/usr/bin/env bash | ||
| # Check if service has endpoints | ||
| endpoints=$(kubectl get endpoints nginx -n web -o jsonpath='{.subsets[0].addresses}') | ||
| if [[ ! -z "$endpoints" ]]; then | ||
| # Verify service can access the pod | ||
| if kubectl run -n web test-connection --image=quay.io/prometheus/busybox --restart=Never --rm -i --wait --timeout=180s \ | ||
| -- wget -qO- nginx; then | ||
| exit 0 | ||
| fi | ||
| set -euo pipefail | ||
|
|
||
| # Check if service has endpoints. EndpointSlice/Endpoints propagation is | ||
| # asynchronous, so poll for a bounded period instead of failing on the first | ||
| # empty read -- otherwise a correct fix can still be reported as failed if it | ||
| # hasn't converged yet. | ||
| endpoints="" | ||
| for i in $(seq 1 15); do | ||
| endpoints=$(kubectl get endpoints nginx -n web -o jsonpath='{.subsets[0].addresses}' 2>/dev/null || true) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
printf '%s\n' '--- target script ---'
sed -n '4,19p' evals/tasks/core/fix-service-routing/verify.sh
printf '%s\n' '--- kubectl configuration references ---'
rg -n --hidden --glob '!.git/**' '(kubectl|KUBECTL|kubernetes)' .
if command -v kubectl >/dev/null 2>&1; then
printf '%s\n' '--- kubectl client version ---'
kubectl version --client --output=json
printf '%s\n' '--- request-timeout default ---'
kubectl options | rg -n -- '--request-timeout'
fiRepository: openshift/openshift-mcp-server Length of output: 50387 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
printf '%s\n' '--- target script ---'
cat -n evals/tasks/core/fix-service-routing/verify.sh | sed -n '1,40p'
printf '%s\n' '--- non-vendor kubectl references ---'
rg -n --hidden --glob '!.git/**' --glob '!vendor/**' --glob '!**/*.pot' \
'(kubectl|KUBECTL|timeout|deadline)' . | head -n 200
printf '%s\n' '--- dependency declarations ---'
rg -n --hidden --glob '!.git/**' --glob '!vendor/**' \
'k8s.io/(cli-runtime|kubectl|client-go)|replace .*k8s.io' go.mod go.sum 2>/dev/null || true
printf '%s\n' '--- vendored request-timeout definition and default ---'
rg -n -m 20 --glob 'vendor/k8s.io/**' \
'request-timeout|RequestTimeout|requestTimeout' vendor/k8s.io 2>/dev/null || trueRepository: openshift/openshift-mcp-server Length of output: 26554 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
printf '%s\n' '--- eval runner configuration ---'
cat -n build/evals.mk | sed -n '60,100p'
printf '%s\n' '--- task files ---'
find evals/tasks/core/fix-service-routing -maxdepth 1 -type f -print -exec sh -c 'echo "--- $1"; cat -n "$1"' _ {} \;
printf '%s\n' '--- kubectl request-timeout implementation ---'
cat -n vendor/k8s.io/cli-runtime/pkg/genericclioptions/config_flags.go | sed -n '45,75p'
rg -n -A 12 -B 8 'flagTimeout|Timeout:|request-timeout' vendor/k8s.io/cli-runtime vendor/k8s.io/kubectl | head -n 160Repository: openshift/openshift-mcp-server Length of output: 15641 Make the endpoint retry window truly bounded. The direct 🤖 Prompt for AI AgentsSource: MCP tools |
||
| if [[ -n "$endpoints" ]]; then | ||
| break | ||
| fi | ||
| sleep 2 | ||
| done | ||
| if [[ -z "$endpoints" ]]; then | ||
| echo "Service nginx in namespace web has no endpoints" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # If we get here, service connection failed | ||
| exit 1 | ||
| # Verify service can access the pod with a compatible probe pod. | ||
| cat <<'EOF' | kubectl apply -f - | ||
| apiVersion: v1 | ||
| kind: Pod | ||
| metadata: | ||
| name: test-connection | ||
| namespace: web | ||
| spec: | ||
| restartPolicy: Never | ||
| containers: | ||
| - name: test-connection | ||
| image: quay.io/curl/curl:8.11.1 | ||
| command: ["curl", "-sf", "--max-time", "15", "http://nginx"] | ||
| EOF | ||
|
|
||
| if ! kubectl wait -n web --for=jsonpath='{.status.phase}'=Succeeded pod/test-connection --timeout=180s; then | ||
| echo "Service connection probe did not succeed" | ||
| kubectl get pod -n web test-connection -o yaml || true | ||
| exit 1 | ||
| fi | ||
| exit 0 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cajieh any changes to this file (and anything under /evals) should go upstream first.
We can keep it open here for now to make it easy to run with prow, but will need to make this PR merge upstream first
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Cali0707 Thanks for the heads-up. I've opened the upstream PR with the same eval changes:
#1406. PTAL when you get a chance.