Skip to content

feat(bundler): structured deploy.sh output with color and step headers#1393

Open
mohityadav8 wants to merge 5 commits into
NVIDIA:mainfrom
mohityadav8:fix-1362-deploy-script-ux
Open

feat(bundler): structured deploy.sh output with color and step headers#1393
mohityadav8 wants to merge 5 commits into
NVIDIA:mainfrom
mohityadav8:fix-1362-deploy-script-ux

Conversation

@mohityadav8

Copy link
Copy Markdown
  • Add NO_COLOR-aware color helpers (_ok, _fail, _warn_line)
  • Add _step_header/ok/fail/retry for per-component section framing
  • Show [N/M] progress counter and manual copy-paste command per step
  • Color-code pre-flight pass/fail and final deployment summary

Closes #1362

- Add NO_COLOR-aware color helpers (_ok, _fail, _warn_line)
- Add _step_header/ok/fail/retry for per-component section framing
- Show [N/M] progress counter and manual copy-paste command per step
- Color-code pre-flight pass/fail and final deployment summary

Closes NVIDIA#1362
@mohityadav8 mohityadav8 requested a review from a team as a code owner June 17, 2026 13:48
@copy-pr-bot

copy-pr-bot Bot commented Jun 17, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions

Copy link
Copy Markdown
Contributor

Welcome to AICR, @mohityadav8! Thanks for your first pull request.

Before review, please ensure:

  • All commits are signed off per the DCO
  • CI checks pass (tests, lint, security scan)
  • The PR description explains the why behind your changes

A maintainer will review this soon.

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 48bd4e49-6886-4ac4-81d3-5e15efc298cf

📥 Commits

Reviewing files that changed from the base of the PR and between 4eb36f6 and 3bc089e.

📒 Files selected for processing (1)
  • pkg/bundler/deployer/helm/templates/deploy.sh.tmpl

📝 Walkthrough

Walkthrough

The deploy script template (deploy.sh.tmpl) and all six rendered testdata instances receive identical changes: seven new color/TTY-aware helper functions (_ok, _fail, _warn_line, _step_header, _step_ok, _step_fail, _step_retry) are added. These helpers respect NO_COLOR environment variable and TTY detection, replacing plain echo-based status output throughout the script. The helm_failed best-effort warning switches to _warn_line. Pre-flight checks gain a formatted section header and use _fail/_ok for failure/pass outcomes. The component install loop pre-counts directories for [N/M] progress display and calls _step_header per component. The retry loop uses _step_ok on successful install, _step_fail on max-retry exhaustion (followed by helm_failed), and _step_retry with exponentially-computed backoff on intermediate failures. The final summary uses _fail/_ok based on whether FAILED_COMPONENTS accumulated any failures.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: adding structured output with color formatting and step headers to the deploy.sh script.
Description check ✅ Passed The description relates to the changeset by outlining the color helpers, step framing functions, progress counters, and color-coded output enhancements added throughout.
Linked Issues check ✅ Passed The PR successfully implements the requirements from issue #1362 by making deploy.sh output more understandable through structured step headers and progress display, enabling users to comprehend and manually execute commands.
Out of Scope Changes check ✅ Passed All changes focus on improving deploy.sh output formatting and user visibility through color helpers and step framing, directly aligned with making the script more transparent and copy-pasteable as specified.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 `@pkg/bundler/deployer/helm/templates/deploy.sh.tmpl`:
- Around line 70-73: In the _step_header function, the second printf statement
prints the directory path without quotes in the manual execution instruction.
Add quotes around the path parameter in the printf format string so that when
the bundle path is substituted, it will be properly escaped for shell copy-paste
commands. This ensures paths containing spaces or special characters will not
break the displayed command.
🪄 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: f957c905-4a38-4094-9c8a-ca0384a6bcf5

📥 Commits

Reviewing files that changed from the base of the PR and between eea2a81 and 4eb36f6.

📒 Files selected for processing (7)
  • pkg/bundler/deployer/helm/templates/deploy.sh.tmpl
  • pkg/bundler/deployer/helm/testdata/kai_scheduler_present/deploy.sh
  • pkg/bundler/deployer/helm/testdata/manifest_only/deploy.sh
  • pkg/bundler/deployer/helm/testdata/mixed_gpu_operator/deploy.sh
  • pkg/bundler/deployer/helm/testdata/mixed_with_pre/deploy.sh
  • pkg/bundler/deployer/helm/testdata/nodewright_present/deploy.sh
  • pkg/bundler/deployer/helm/testdata/upstream_helm_only/deploy.sh

Comment thread pkg/bundler/deployer/helm/templates/deploy.sh.tmpl

@mchmarny mchmarny left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Welcome to AICR, @mohityadav8 — and thanks for picking this up! This is a genuinely nice quality-of-life improvement to deploy.sh: the NO_COLOR + non-TTY detection is done correctly, the helpers are clean, and the per-step [N/M] framing makes a long install far easier to follow. Regenerating all 6 testdata goldens alongside the template is exactly the right discipline, too.

One thing blocks merge: the goldens are out of sync with the template. The _step_header quoting fix (printf -v manual_dir '%q') landed in deploy.sh.tmpl but the committed testdata/*/deploy.sh files still have the pre-fix version, so the byte-comparing TestBundleGolden_* tests will fail. A quick go test ./pkg/bundler/deployer/helm/... -run TestBundleGolden -update (then commit) fixes all six at once — details inline. The other two are small nits (loop indentation, and the Manual: hint not reflecting the env the real install uses).

Heads up: the PR is behind main, so rebasing on origin/main before re-pushing will also let the real CI gates run. Nice first contribution — this is close.


function _step_header() {
printf '\n%s┌─ [%s/%s] %s → %s%s\n' "${_B}" "$1" "$2" "$3" "$4" "${_X}"
printf '%s│ Manual: cd %s && bash install.sh%s\n' "${_D}" "$5" "${_X}"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This golden is out of sync with the template. deploy.sh.tmpl's _step_header now shell-quotes the path (local manual_dir; printf -v manual_dir '%q' "$5" → prints ${manual_dir}), but this golden still prints "$5" directly — same in all 6 testdata/*/deploy.sh.

assertBundleGolden byte-compares every rendered file including deploy.sh, so TestBundleGolden_* will fail on the mismatch. Regenerate and commit:

go test ./pkg/bundler/deployer/helm/... -run TestBundleGolden -update

# diagnostics and clean up stale Helm hook Jobs between attempts.
attempt=0
while true; do
attempt=0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: attempt=0 / while true; do / done got dedented to column 0, but they're inside the for dir … do loop (body still indented 8 spaces). It's harmless to bash, but in this block — retry + hook cleanup + kai diagnostics — the while now reads as if it sits outside the for-loop. Re-indent to match the enclosing loop.

local manual_dir
printf -v manual_dir '%q' "$5"
printf '\n%s┌─ [%s/%s] %s → %s%s\n' "${_B}" "$1" "$2" "$3" "$4" "${_X}"
printf '%s│ Manual: cd %s && bash install.sh%s\n' "${_D}" "${manual_dir}" "${_X}"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: the actual install runs install.sh with exported COMPONENT_WAIT_ARGS, DRY_RUN_FLAG, KUBECONFIG_FLAG, and HELM_DEBUG_FLAG, but this Manual: hint reproduces none of them — a copy-paste won't match the wait/timeout/kubeconfig/dry-run behavior of the real run. Worth a short caveat that it's an approximation, or noting the relevant env.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: deploy.sh should be copy'n'pasteable command by command

2 participants