Skip to content

feat: add 'make status' unified dashboard#94

Open
fonta-rh wants to merge 7 commits into
openshift-eng:mainfrom
fonta-rh:make-status
Open

feat: add 'make status' unified dashboard#94
fonta-rh wants to merge 7 commits into
openshift-eng:mainfrom
fonta-rh:make-status

Conversation

@fonta-rh

@fonta-rh fonta-rh commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add make status as a unified dashboard that shows instance info, cluster VM state, proxy status, and cluster API health in one view
  • Fold make info into make status (info becomes an alias)
  • Remove standalone print_instance_data.sh — its output is now part of the status dashboard
  • Fix sync-config to fail when file copies fail instead of printing misleading "everything up to date" (suggested by @lucaconsalvi in Add central config/ folder with sync-to-canonical #92)

Changes

File Change
deploy/openshift-clusters/scripts/status.sh New: unified status dashboard script
deploy/Makefile Add status/info targets; fix sync-config error handling
deploy/common.sh Track CONFIG_SYNC_ERRORS in sync_config_files()
deploy/aws-hypervisor/scripts/print_instance_data.sh Removed (folded into status.sh)
deploy/aws-hypervisor/scripts/force-stop.sh Update common.sh source path
README.md, deploy/README.md, deploy/*/README.md Update docs for new targets

Test plan

  • make status shows instance info, cluster VMs, proxy, and API status
  • make info works as alias for make status
  • make sync-config exits non-zero when cp fails
  • make deploy still runs sync-config prerequisite correctly

Summary by CodeRabbit

  • New Features
    • Added a unified make status dashboard showing local config, instance state, hypervisor/VM health, proxy health, and cluster API readiness.
    • make info is now an alias for make status.
  • Bug Fixes
    • Improved configuration sync reporting: sync errors are now detected, surfaced, and stop the process instead of continuing silently.
  • Documentation
    • Updated setup and troubleshooting instructions to use make status first (including when access breaks) and to reference the new dashboard-based instance information.

claude and others added 3 commits July 10, 2026 10:16
Implements the plan in docs/plans/02-make-status.md: a single command
answering "what do I have running right now", with per-section graceful
degradation so it is useful at any deployment stage.

- Add deploy/openshift-clusters/scripts/status.sh with five sections:
  local config, EC2 instance (absorbs make info output plus live state
  and uptime), cluster state file, hypervisor probes bundled into one
  SSH round trip (dev-scripts dir, VM states, squid proxy, BMC
  simulator for fencing), and a cluster API probe via proxy.env.
- Every network operation has an explicit timeout; failing probes WARN
  and the script continues instead of aborting.
- Make 'info' an alias of 'status' and remove print_instance_data.sh,
  whose output is covered by the EC2 instance section.
- Update README/CLAUDE.md command references and point the
  troubleshooting docs at 'make status' first.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013T7qRUL2UGSKn5Si9ApYED
common.sh was relocated to deploy/ in an earlier commit; update the
source path in status.sh to match. Remove docs/plans/02-make-status.md
which is an internal design artifact not intended for upstream.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Track copy errors separately from synced count so the Makefile
target exits non-zero on failures instead of printing the
misleading "everything up to date" message.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-ci openshift-ci Bot requested a review from eggfoobar July 10, 2026 08:17
@openshift-ci

openshift-ci Bot commented Jul 10, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fonta-rh

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot requested a review from jeff-roche July 10, 2026 08:17
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 10, 2026
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: e6346e07-709a-4f92-af6f-a4905ff76697

📥 Commits

Reviewing files that changed from the base of the PR and between 6b0a031 and 5f67a7c.

📒 Files selected for processing (1)
  • deploy/openshift-clusters/scripts/status.sh
🚧 Files skipped from review as they are similar to previous changes (1)
  • deploy/openshift-clusters/scripts/status.sh

Walkthrough

A unified make status dashboard reports local configuration, EC2, hypervisor, and cluster API health. make info aliases it, synchronization failures are surfaced, and related command documentation is updated.

Changes

Status dashboard and deployment workflow

Layer / File(s) Summary
Dashboard data collection and local state
deploy/openshift-clusters/scripts/status.sh
Initializes the dashboard and reports local configuration, EC2 state, and cluster state-file values.
Hypervisor and cluster API probes
deploy/openshift-clusters/scripts/status.sh
Checks remote VMs and services over SSH, then reports cluster node readiness with graceful warning and skip handling.
Command wiring and synchronization failures
deploy/Makefile, deploy/common.sh, deploy/aws-hypervisor/scripts/force-stop.sh
Adds make status, aliases make info to it, tracks configuration copy failures, and updates the stop failure hint.
Status command documentation
CLAUDE.md, README.md, deploy/README.md, deploy/aws-hypervisor/README.md, deploy/openshift-clusters/README.md
Updates command references, status descriptions, and troubleshooting guidance to use make status.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Operator
  participant Makefile
  participant status.sh
  participant AWS
  participant RemoteHost
  participant ClusterAPI
  Operator->>Makefile: Run make status
  Makefile->>status.sh: Execute status dashboard
  status.sh->>AWS: Query EC2 instance state
  status.sh->>RemoteHost: Check VMs and services over SSH
  status.sh->>ClusterAPI: Query node readiness through proxy
  status.sh-->>Operator: Display aggregated status
Loading

Possibly related PRs

Suggested reviewers: clobrano, jaypoulz, qJkee

🚥 Pre-merge checks | ✅ 9 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Ai-Attribution ⚠️ Warning Commits credit AI tools with Co-Authored-By (Claude Opus 4.6, Claude Fable 5, coderabbitai), but no Assisted-by/Generated-by trailers are present. Replace AI co-author trailers with Assisted-by or Generated-by per policy, and do not use Co-Authored-By for AI tools.
✅ Passed checks (9 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding a unified make status dashboard.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
No-Weak-Crypto ✅ Passed Changed files contain no MD5/SHA1/DES/RC4/3DES/Blowfish/ECB or custom crypto; status.sh only uses AWS/SSH/oc probes and string checks.
Container-Privileges ✅ Passed The commit only adds a shell script; no container/K8s manifests or privileged settings (privileged, hostPID/Network/IPC, SYS_ADMIN, allowPrivilegeEscalation) were introduced.
No-Sensitive-Data-In-Logs ✅ Passed No passwords, tokens, API keys, or other secret/PII logging was added; the new dashboard only prints operational metadata like instance state and VM names.
No-Hardcoded-Secrets ✅ Passed No hardcoded credentials found in the changed code; the edits add status checks/docs and reference existing secret files only.
No-Injection-Vectors ✅ Passed No added SQL/shell/exec/yaml/pickle/DOM injection patterns were found; new shell paths quote user-derived values and use a single-quoted heredoc.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
deploy/openshift-clusters/scripts/status.sh (1)

1-1: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use the #!/usr/bin/bash shebang.

The repo shell-script standard mandates the #!/usr/bin/bash shebang.

Proposed change
-#!/bin/bash
+#!/usr/bin/bash

As per coding guidelines: "**/*.sh: Use the #!/usr/bin/bash shebang".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@deploy/openshift-clusters/scripts/status.sh` at line 1, Update the shebang at
the beginning of the script to use /usr/bin/bash instead of /bin/bash, matching
the repository standard for shell scripts.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@deploy/Makefile`:
- Around line 72-76: Add a .PHONY declaration for both status and info near
their targets in the Makefile, ensuring these targets always execute their
associated commands regardless of same-named files or directories.

In `@deploy/README.md`:
- Around line 277-283: Fix the MD014 violation in the status-dashboard example
by removing the `$` shell prompt from the `make status` command, or add
representative command output beneath it; update the documentation block
accordingly.

---

Nitpick comments:
In `@deploy/openshift-clusters/scripts/status.sh`:
- Line 1: Update the shebang at the beginning of the script to use /usr/bin/bash
instead of /bin/bash, matching the repository standard for shell scripts.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: e0b45431-3355-4013-9534-685eb061ab72

📥 Commits

Reviewing files that changed from the base of the PR and between 00d0675 and 03da98c.

📒 Files selected for processing (10)
  • CLAUDE.md
  • README.md
  • deploy/Makefile
  • deploy/README.md
  • deploy/aws-hypervisor/README.md
  • deploy/aws-hypervisor/scripts/force-stop.sh
  • deploy/aws-hypervisor/scripts/print_instance_data.sh
  • deploy/common.sh
  • deploy/openshift-clusters/README.md
  • deploy/openshift-clusters/scripts/status.sh
💤 Files with no reviewable changes (1)
  • deploy/aws-hypervisor/scripts/print_instance_data.sh

Comment thread deploy/Makefile
Comment thread deploy/README.md

@lucaconsalvi lucaconsalvi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for putting this together, Pablo! The unified dashboard is a great improvement — the graceful degradation design is solid, the single SSH round trip is efficient, and the sync-config error fix is well-constructed. The doc updates are thorough and consistent.

A few findings from the review, mostly around 2>/dev/null patterns being a bit too aggressive in some spots. One critical item, three important ones, and a few suggestions inline.


Critical (1)

source common.sh 2>/dev/null masks real errors and the comment is inaccuratestatus.sh:17

Suppressing all stderr from common.sh hides real errors (syntax errors, permission issues, broken instance.env). Combined with set -o nounset on line 20, if common.sh fails to source, the color variables (COLOR_BLUE, etc.) are undefined and the script crashes with a cryptic "unbound variable" error — hiding the actual cause.

The comment on line 14 says common.sh sources instance.env "unconditionally", but it's actually guarded by an -f check with a SKIP_INSTANCE_ENV_WARNING variable (common.sh:67-72).

Fix — use the existing purpose-built mechanism:

# common.sh warns to stderr when instance.env is missing; suppress only
# that warning since the local config section already reports its absence.
SKIP_INSTANCE_ENV_WARNING=1 source "${DEPLOY_DIR}/common.sh"

Important (3)

See inline comments below.

Suggestions

  • oc get nodes 2>/dev/null (status.sh:275) collapses auth failures, DNS issues, and timeouts into one generic "unreachable through the proxy" message. At minimum, exit code 124 from timeout is free info worth distinguishing.
  • source "${PROXY_ENV}" >/dev/null 2>&1 (status.sh:274) hides syntax errors in proxy.env, causing oc to run without proxy vars and then blaming the proxy container.
  • Consider a one-line comment before if [[ "${TOPOLOGY}" == "fencing" ]] (status.sh:197) explaining why BMC is only checked for fencing (STONITH uses out-of-band power management; other topologies don't).
  • The date -u -d uptime calculation (status.sh:137) degrades correctly on macOS but a brief inline note would save future maintainers from debugging why uptime never appears.

Strengths

  • Graceful degradation at every section — failures produce actionable messages, not crashes
  • Single SSH round trip with clear (single SSH round trip) documentation
  • sync-config error counter + Makefile propagation is correct end-to-end
  • "Intentionally no errexit" comment prevents future contributors from breaking the degradation design
  • make info alias comment is concise and accurate

Comment thread deploy/openshift-clusters/scripts/status.sh Outdated
Comment thread deploy/openshift-clusters/scripts/status.sh Outdated
Comment thread deploy/openshift-clusters/scripts/status.sh Outdated
Co-Authored-By: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@fonta-rh

Copy link
Copy Markdown
Contributor Author

Addressed CodeRabbit review findings:

  • Shebang (nitpick — status.sh:1): Applied — fixed in 0fd37aa. Updated to #!/usr/bin/bash per repo standard.
  • No-Sensitive-Data-In-Logs (pre-merge check): Won't fix — this is a developer status dashboard; showing instance info (public IP, SSH user, VM names) to the operator's terminal is its core purpose. The old make info printed the same data.

@openshift-ci openshift-ci Bot added the ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review label Jul 10, 2026

@dhensel-rh dhensel-rh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: awk '$2 == "Ready"' (line ~282) is an exact match — a cordoned node with status Ready,SchedulingDisabled would be counted as "not Ready" and trigger the warning. Consider $2 ~ /^Ready/ if you want cordoned nodes to count as ready.

Not a blocker — unlikely in a two-node cluster, just a heads-up.

- Replace `source common.sh 2>/dev/null` with SKIP_INSTANCE_ENV_WARNING
  to avoid masking real source errors (lucaconsalvi)
- Add pipefail to match doctor.sh shell options (lucaconsalvi)
- Add sudo canary check in SSH probe to surface permission failures
  instead of silently reporting no VMs (lucaconsalvi)
- Wrap SSH probe with `timeout 30` to prevent hang on stuck
  libvirtd (lucaconsalvi)
- Use awk regex match for Ready status to correctly count cordoned
  nodes as ready (dhensel-rh)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@fonta-rh

fonta-rh commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Addressed review findings from lucaconsalvi and dhensel-rh in 1d2aead:

Applied:

  • source common.sh 2>/dev/nullSKIP_INSTANCE_ENV_WARNING=1 source (critical)
  • Added pipefail to match doctor.sh shell options
  • Sudo canary check in SSH probe — surfaces [WARN] sudo access unavailable instead of false "no VMs"
  • SSH probe wrapped with timeout 30 to prevent hang on stuck libvirtd
  • awk '$2 == "Ready"'awk '$2 ~ /^Ready/' to correctly count cordoned nodes (dhensel-rh)

Acknowledged (non-blocking suggestions):

  • oc exit code 124 distinction, proxy.env stderr, BMC comment, macOS date -d — noted, may revisit in a follow-up EDIT: I did end up fixing it after all :)

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@deploy/openshift-clusters/scripts/status.sh`:
- Around line 288-296: Align the non-ready detail listing with the
classification used by READY_COUNT and NOT_READY_COUNT. In the node-reporting
awk command within the status-check logic, replace the exact `$2 != "Ready"`
test with the same /^Ready/ criterion so `Ready,SchedulingDisabled` nodes are
not incorrectly listed as not Ready.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: ed81ca9e-7b12-43fd-9e74-ec1ecdf029e4

📥 Commits

Reviewing files that changed from the base of the PR and between 00d0675 and 1d2aead.

📒 Files selected for processing (10)
  • CLAUDE.md
  • README.md
  • deploy/Makefile
  • deploy/README.md
  • deploy/aws-hypervisor/README.md
  • deploy/aws-hypervisor/scripts/force-stop.sh
  • deploy/aws-hypervisor/scripts/print_instance_data.sh
  • deploy/common.sh
  • deploy/openshift-clusters/README.md
  • deploy/openshift-clusters/scripts/status.sh
💤 Files with no reviewable changes (1)
  • deploy/aws-hypervisor/scripts/print_instance_data.sh

Comment thread deploy/openshift-clusters/scripts/status.sh
fonta-rh and others added 2 commits July 10, 2026 15:11
GNU date uses -d for parsing; BSD date (macOS) uses -j -f.
Try GNU first, fall back to BSD, degrade gracefully if neither works.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@lucaconsalvi lucaconsalvi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing all the findings, Pablo! Verified the fixes in the latest commits:

Finding Status Commit
Critical: source common.sh 2>/dev/null + inaccurate comment FixedSKIP_INSTANCE_ENV_WARNING=1, comment rewritten 1d2aead
Important: Missing set -o pipefail Fixedset -uo pipefail 1d2aead
Important: SSH hides sudo failures Fixed — sudo canary + SUDO_FAILED handler 1d2aead
Important: No SSH timeout Fixedtimeout 30 ssh ... 1d2aead
Suggestion: macOS date -d fallback Fixed — added BSD date -j -f chain 6b0a031
Suggestion: shellcheck directive Fixed# shellcheck source=/dev/null 5f67a7c

All fixes look correct. No new concerns from the follow-up commits.

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants