Skip to content

fix(doctor): guard service registry resolution and declare port maps for standalone execution - #5867

Closed
vaibhavsrv wants to merge 1 commit into
Osmantic:public-betafrom
vaibhavsrv:fix/doctor-standalone-service-registry
Closed

vaibhavsrv wants to merge 1 commit into
Osmantic:public-betafrom
vaibhavsrv:fix/doctor-standalone-service-registry

Conversation

@vaibhavsrv

Copy link
Copy Markdown
Contributor

Why this matters

In ods/scripts/ods-doctor.sh, the script provides a fallback environment loader load_env_safe() explicitly designated for "a tree without lib/". However, immediately following load_env_safe, line 98 called sr_resolve_ports unconditionally without checking declare -F sr_resolve_ports. In environments lacking lib/service-registry.sh (such as minimal runtime containers or standalone diagnostic runs), this caused an immediate fatal error sr_resolve_ports: command not found. Additionally, associative array SERVICE_PORTS was accessed without prior declare -A initialization, causing associative lookups under strict mode to treat service keys as undeclared integer variable names.

This patch declares SERVICE_PORTS and SERVICE_HEALTH as associative arrays and guards sr_resolve_ports behind declare -F sr_resolve_ports, ensuring standalone executions cleanly fall back to default ports (3001 for dashboard, 3000 for WebUI).

Validation

  • Repro baseline: Executed initial doctor port discovery without lib/service-registry.sh; confirmed execution failed with sr_resolve_ports: command not found.
  • Post-fix: Verified test_doctor_standalone_registry.py passes with exit code 0; doctor initializes default ports without errors when service-registry.sh is absent.
  • Doctor suites: 1 passed. New-test Ruff, ShellCheck, and diff checks pass; new regressions wired into Linux CI.

Overlap check

Risk / AI disclosure

AI-assisted investigation, implementation and CLI regressions. This strengthens function existence checks and associative array declarations during diagnostic initialization, not runtime service routing. Independent human review and platform/runtime qualification remain gates. No running configuration, deployment or upstream merge changed.

Follow-up integration evidence

Composed with #5861 at 2a24f49 without conflicts. Production and test diffs passed together; doctor and compose failure reporting suites remain intact.
Backlog composition was local-only (production/test diffs, excluding workflow/Makefile wiring); it is not an upstream merge or independent human approval. Declared live-review gates remain open.

@Lightheartdevs

Copy link
Copy Markdown
Collaborator

Thanks for this contribution. public-beta was promoted into main on 2026-09-24 and no longer receives changes, so we're closing pull requests that target it. This isn't a judgment on the change itself. If it's still needed, please rebase onto main and open a focused PR. See #7253 for details and the contribution policy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants