Skip to content

Remove dead code from install.sh and install.ps1 - #588

Merged
dustinvannoy-db merged 1 commit into
install-from-databricks-agent-skillsfrom
polly/dead-code-cleanup
Jul 27, 2026
Merged

Remove dead code from install.sh and install.ps1#588
dustinvannoy-db merged 1 commit into
install-from-databricks-agent-skillsfrom
polly/dead-code-cleanup

Conversation

@dustinvannoy-db

Copy link
Copy Markdown
Collaborator

Pure cleanup of confirmed dead/unreachable/vestigial code in the two top-level installer scripts. No behavior change — every deletion was verified to have zero reachable call sites or reads.

Deleted

File Symbol Why it's dead
install.sh deprecation_notice() Zero call sites. The "skills are moving" announcement has already shipped and is being retired, so the call was not restored.
install.ps1 Show-DeprecationNotice Zero call sites, same reason.
install.ps1 $VenvDir / $VenvPython block Never read. The venv now lives in databricks-mcp-server/mcp_install.ps1, and Invoke-Uninstall edits JSON via ConvertFrom-Json/ConvertTo-Json rather than shelling out to a Python interpreter.
install.ps1 $line = " " in $drawCheckbox Assigned, never read.
install.ps1 $i++ after Write-Err in the arg-parse default arm Unreachable — Write-Err ends in exit 1.

The bash VENV_PYTHON is genuinely live (read at three call sites) and was deliberately left in place — only the PowerShell counterpart was dead.

Explicitly left untouched

  • All MCP deprecation shims: Show-McpMovedNotice / mcp_moved_notice and the --mcp / -Mcp, --mcp-path / -McpPath, --mcp-only / -McpOnly, and DEVKIT_INSTALL_MCP arms — reachable, they warn and point at mcp_install.
  • The --skills-only / -SkillsOnly arm despite its empty body — load-bearing, since removing it would make the flag fall through to the error/exit path.
  • The $AgentBExcluded / AGENT_B_EXCLUDED empty-array knob and its no-op loops — a documented deliberate knob.
  • The uninstall MCP-cleanup helpers (Test-McpJsonHasDatabricks, Remove-McpJsonKey, Remove-McpTomlBlock) and their mcpTargets/planMcp plumbing.
  • $script:InstallSkills always-true const — cosmetic, out of scope.

Gates

  • bash -n install.sh — passes.
  • shellcheck install.sh — 49 findings before, 49 after, and the normalized finding set is byte-identical (diff clean). No new warnings.
  • install.ps1 parse check — not run: no PowerShell binary is installed on the machine used for this change (pwsh, powershell, and the usual /usr/local/microsoft/powershell install paths are all absent). The PowerShell edits are localized deletions of whole function definitions, a variable-assignment block, and two single statements, but the parse gate is genuinely unverified and should be confirmed on a host with pwsh.
  • Post-deletion re-grep: deprecation_notice, Show-DeprecationNotice, VenvPython, VenvDir, and $line = " " all have zero occurrences; all KEEP-list symbols are still present at their expected sites.

Co-authored-by: omnigent noreply@omnigent.ai

This pull request and its description were written by Isaac.

Pure cleanup — no behavior change. Each item below was verified to have
zero reachable call sites or reads:

- install.sh: drop `deprecation_notice()`. The "skills are moving"
  announcement has shipped and is being retired; the function had no
  call sites.
- install.ps1: drop `Show-DeprecationNotice` for the same reason.
- install.ps1: drop the `$VenvDir` / `$VenvPython` block. The venv now
  lives in databricks-mcp-server/mcp_install.ps1, and Invoke-Uninstall
  edits JSON via ConvertFrom-Json/ConvertTo-Json rather than shelling
  out to a Python interpreter, so neither variable is read anywhere.
  (The bash `VENV_PYTHON` is still live and is left alone.)
- install.ps1: drop the vestigial `$line = "  "` assignment inside the
  `$drawCheckbox` scriptblock — assigned, never read.
- install.ps1: drop the unreachable `$i++` after `Write-Err` in the
  arg-parse `default` arm; `Write-Err` ends in `exit 1`.

The MCP deprecation shims, the no-op `--skills-only` arm, the
AgentBExcluded knob, and the uninstall MCP-cleanup helpers are all
reachable and left untouched.

Co-authored-by: omnigent <noreply@omnigent.ai>
@dustinvannoy-db
dustinvannoy-db merged commit 286e3b8 into install-from-databricks-agent-skills Jul 27, 2026
@dustinvannoy-db
dustinvannoy-db deleted the polly/dead-code-cleanup branch July 27, 2026 01:29
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.

1 participant