Skip to content

feat: NX-16342 detect and update outdated CLI tools on every setup run - #146

Merged
ktaganova merged 11 commits into
mainfrom
feature/NX-16342-tool-update-check
Nov 13, 2026
Merged

ktaganova merged 11 commits into
mainfrom
feature/NX-16342-tool-update-check

Conversation

@smini-digital

@smini-digital smini-digital commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Setup now detects outdated CLI tools on every run and offers to update them. Until now, tools were installed only when missing, while their docs were rewritten on every run, so agents read docs for commands the installed binary lacked.

  • lib/utils/versions.js (new): version comparison (semver incl. prerelease/pseudo-version ordering), time-boxed latest-version lookups, a per-run result cache, and the default-Yes offerUpdate() prompt.
  • Each installer registers itself with registerUpdatableTool(). "Latest" is always what that tool's update command would install, so an update cannot leave a tool permanently "outdated":
    • Go tools (atl, n8nctl, esq, discordctl): installed version from go version -m <binary>; latest = highest release tag via git ls-remote (what go install …@latest resolves to), or default-branch HEAD for untagged repos (discordctl, compared by pseudo-version commit). Update = existing go install flow. When no verdict is possible (no Go toolchain, (devel) build, lookup failed), the old "Reinstall?" prompt (default No) is kept.
    • Homebrew tools (gh, sqlcmd, hcloud, brew-installed gcx, cask ovhcloud): brew outdated --json=v2, which refreshes Homebrew's metadata on its normal auto-update schedule; pinned packages count as current; update = brew upgrade.
    • npm tools (m365, playwright): npm ls -g vs npm view <pkg>@latest; update = npm install -g <pkg>@latest. Playwright updates before the browser check so browsers match the new version.
    • Binary/script installs (gcx in ~/.local/bin, ovhcloud via install.sh): latest GitHub release; update reruns the existing installer.
  • The menu, --full and configureShellEnv() in lib/index.js check every tool once up front; the status display and tool selection append update available (a → b). Single-tool flags (--gh, --atl, …) check only that tool when it is configured, and --llm checks nothing.
  • Go tools verified current no longer get the manual "Reinstall?" prompt (DoD 12); it remains the fallback when no verdict is possible.
  • configureShellEnv() offers the update before running a replace hook. environment-setup replaces atl, discord and hcloud, and its discord hook bypasses configureDiscordCli(). offerUpdate asks at most once per tool per run, so the atl hook re-entering configureAtlassianCli() doesn't prompt twice.
  • Git lookups run with GIT_TERMINAL_PROMPT=0 and SSH BatchMode, so a passphrase or host-key prompt fails the check instead of hanging setup. Every lookup has a 10s timeout.

Acceptance criteria

# Criterion Status Where
3 Each run compares installed vs latest and lists outdated tools ✅ checkForUpdates() for the menu, --full and configureShellEnv(); single-tool flags check their own tool
4 Outdated → default-Yes update prompt; status marks outdated ✅ offerUpdate(), formatUpdateBadge()
5 Go tools read build info; latest = latest release, else HEAD ✅ goToolCheck, pickGoLatest, isGoBuildOutdated
6 Package-manager tools update via their manager ✅ (brew + npm) brewUpgrade, npmInstallLatest; apt/dnf/pacman installs are not checked (no lookup matching what their upgrade installs)
7 Unreachable network → skip + warn, never block ✅ verified offline, see below
8 Both entry points ✅ bin/cli.js, lib/index.js
9 Outdated atl listed and updated after default-Yes prompt ✅ live run: default-Yes prompt updated atl v1.13.0 → v1.15.0 (go version -m confirms), auth untouched; next run reports atl current
10 n8nctl, esq, discordctl "dev" builds recognized as outdated reworded 2026-11-12: "dev" builds are checked against the version recorded in the binary and flagged when older than the latest release tag ✅ n8nctl and discordctl are behind and flagged; esq's build info is v1.1.3 = latest tag, so it is current (#12)
11 Network down → setup completes with skipped-check warning ✅ offline run below
12 Current tools show no update prompt ✅ known-current Go tools no longer get "Reinstall?"

Testing

  • npm test: 52 pass. New test/versions.test.js covers semver/prerelease ordering, pseudo-versions, (devel), tag selection (peeled, v2+ and prerelease tags), the HEAD fallback, brewPackageInfo with a stubbed brew (incl. malformed output), the checkForUpdates listing, skipped-lookup warning and up-to-date summary, and offerUpdate outcomes with a stubbed prompt: default Yes, one prompt per run after a decline or failure, no prompt when current, unknown or absent.
  • npx eslint . and prettier --check . are clean. fetch/AbortSignal were added to the ESLint globals (Node ≥ 24 built-ins).
  • Live read-only check on a dev machine (2.2s; 5–54s when brew outdated first runs Homebrew's auto-update, which the check line now mentions):
    Updates available:
      sqlcmd       1.9.0 → 1.10.0
      gh           2.97.0 → 2.103.3
      atl          v1.13.0 → v1.15.0
      n8nctl       commit 718627d (2025-12-22) → v1.5.0
      gcx          1.3.1 → 1.7.1
      m365         11.4.0 → 12.0.0
      discordctl   commit 9f8ddaa (2026-07-16) → commit 973e4c1
      playwright   1.58.2 → 1.65.0
    
    (esq v1.1.3 = current; hcloud/ovhcloud not installed.)
  • Offline run (proxy to a dead port): setup completes and prints ⚠ Skipped update check for atl, n8nctl, m365, esq, discordctl, playwright (lookup failed — offline?). Brew-managed tools are still checked from local tap metadata. Worst-case duration is about 11s (npm retries until the timeout).
  • Every tool's flow was run in a real terminal, answering No to each update: they all continue to their normal config step. esq (current) gets no update or reinstall prompt; hcloud and ovhcloud (absent) only see the install prompt.
  • configureShellEnv() status table shows · update available (a → b) on outdated tools.
  • End to end: npm start -- --atl, Enter at the update prompt → go install …@v1.15.0, then normal auth check.
  • Go pseudo-versions display as commit <hash> (<date>).
  • Not exercised for real: brew upgrade and npm install -g updates.

Each installer registers an update check. Setup compares installed and
latest versions in parallel, lists outdated tools, and prompts to update
them (default Yes). Go tools read versions from binary build info and
compare against the tag go install @latest resolves to (or HEAD for
untagged repos). Homebrew and npm tools use their manager's own latest
version. Failed lookups are skipped with a warning.
@smini-digital smini-digital self-assigned this Nov 10, 2026

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces a comprehensive version-checking and self-updating mechanism for various CLI tools, centralizing the logic in a new lib/utils/versions.js utility and integrating it across installers and the main CLI flow. Feedback on the implementation focuses on enhancing robustness: ensuring strict Semver 2.0.0 compliance regarding leading zeroes in pre-release identifiers, wrapping JSON.parse in a try-catch block to handle malformed Homebrew output, adding authorization headers to GitHub API requests to prevent rate-limiting, and defensively wrapping tool updates in a try-catch block.

Comment thread lib/utils/versions.js Resolved
Comment thread lib/utils/versions.js Resolved
Comment thread lib/utils/versions.js Resolved
Comment thread lib/utils/versions.js Resolved
@smini-digital
smini-digital requested a review from fank November 11, 2026 12:38
@fank

fank commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Ratatoskr reviewed this pull request.

Changes requested on 976ef220. See the review.

Finished 2026-11-11 12:42 UTC.

@smini-digital

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces a robust update-checking mechanism for various CLI tools managed by the application, implementing version comparison, registry checks (Homebrew, npm, Go, GitHub releases), and interactive update prompts. Feedback on the new lib/utils/versions.js utility suggests adding a mandatory User-Agent header to GitHub API requests to avoid 403 errors, and adding a falsy guard for the binary argument in commandVersion to prevent execution errors.

Comment thread lib/utils/versions.js Resolved
Comment thread lib/utils/versions.js Resolved

@fank fank 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.

REQUEST_CHANGES — 1 verified update-path defect.

Review details

Required correction

[P2] Update the binary that was checked, not a different installation — lib/installers/atl.js:397–402 (also the n8n/esq/discord registrations).

findAtlBinary() explicitly supports ~/.local/bin/atl and /usr/local/bin/atl, but the new updater delegates to installAtl(), whose go install writes to GOBIN or GOPATH/bin (normally ~/go/bin). When the detected older binary remains first on PATH, accepting the update reports success and caches current, yet normal configuration still executes the old binary. The next run offers the same update again. This leaves the original docs/binary mismatch unresolved for these supported installation locations.

Reproduced in an isolated temporary HOME with stubbed git/go and the real registry/installer flow: active ~/.local/bin/atl was v1.0.0; latest was v1.1.0; offerUpdate('atl') returned updated; v1.1.0 appeared in ~/go/bin/atl; the active binary remained v1.0.0 and the next check again reported v1.0.0 → v1.1.0.

Make the update target the detected installation (or explicitly migrate selection/PATH), and verify the selected binary after updating before declaring it current. Add a regression test with the active binary outside the Go install destination; the existing tests stub update() and do not exercise this mismatch.

Verification

Reviewed head: 976ef220621f1b63f16a2fd5724649cf59a1eaa7.

The checkout has no installed dependencies, so its initial npm test failed with missing chalk/inquirer. Without modifying it, exported this exact commit to /tmp/pr146-validation-M278HL (a temporary validation directory), installed dependencies there using Node 24.21.0, and ran:

  • npm ci --ignore-scripts — succeeded.
  • npm test — 35 passed.
  • npm run lint — passed.
  • npm run check-format — passed.
  • node /tmp/pr146-repro.mjs — reproduced the update-path defect above with local stubs only.

No real package upgrades, authentication flows, or live-system configuration changes were run. CI lint/format/CodeQL checks were successful; License Check was skipped.

Earlier discussions

GraphQL enumeration included all four threads and all their comments; neither connection required another page. 0 unresolved; 0 resolved by this review. All four were already resolved and were authored by another reviewer, not authenticated reviewer fank:

No replies or thread-state changes were made.

Also cover the update listing and skipped-lookup warning with tests, and
document that installers must be imported before checkForUpdates().
go install now targets the directory of the active binary via GOBIN, so a
binary in ~/.local/bin or /usr/local/bin is replaced instead of a second
copy landing in GOPATH/bin behind it. offerUpdate re-checks the tool after
an update and reports it as failed when it is still outdated.
@smini-digital

Copy link
Copy Markdown
Contributor Author

FIXED in ad60444: Ratatoskr review, "Update the binary that was checked, not a different installation".

  • The Go tools' update() is now goToolUpdate(findBinary, install). It resolves the binary actually on PATH (symlinks followed) and runs the existing installer with GOBIN set to that binary's directory, so ~/.local/bin/atl or /usr/local/bin/atl is replaced in place. GOBIN is restored afterwards.
  • offerUpdate() now re-checks the tool after a successful update. If it still reports the old version (for example, another copy comes first on PATH), it warns and returns failed instead of caching current. This covers the Homebrew and npm paths too.
  • Regression test test/go-tool-update.test.js stubs go and git on PATH, puts the active v1.0.0 binary outside GOPATH/bin, and asserts that the update replaces it and writes nothing to GOPATH/bin. With the GOBIN targeting disabled, it fails with ⚠ faketool still reports v1.0.0 after the update, which is your reproduction. With the fix: npm test 40/40, lint and format clean.

@smini-digital

Copy link
Copy Markdown
Contributor Author

FIXED: the change request announced in Ratatoskr's status comment is addressed in ad60444. Details: reply to the review.

@smini-digital

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces a comprehensive update-checking mechanism for installed CLI tools by adding a new versions.js utility and integrating it across various installer modules and the main CLI flow. It also includes robust test suites for these new features. The review feedback highlights two valuable improvements: wrapping fs.realpathSync in a try-catch block within goToolUpdate to ensure process.env.GOBIN is safely restored even if resolving a symlink fails, and utilizing GITHUB_TOKEN or GH_TOKEN in latestGithubRelease requests to prevent hitting GitHub API rate limits.

Comment thread lib/utils/versions.js Resolved
Comment thread lib/utils/versions.js Resolved
…s current

The up-to-date banner now requires every installed tool to be verified
current. Release comparisons in the npm, gcx and ovhcloud checks throw on
non-semver versions, so they show up as skipped.
@smini-digital

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces a comprehensive update-checking mechanism for the CLI tools. It adds a new utility module lib/utils/versions.js to handle version parsing, semver comparison, and latest-version lookups across multiple sources (Git tags, Homebrew, npm, and GitHub releases). It integrates these checks into the main CLI flow and individual tool installers, allowing users to see update badges and receive interactive prompts to update outdated tools. The review feedback suggests enhancing the GitHub API lookup by supporting GITHUB_TOKEN or GH_TOKEN environment variables to prevent rate-limiting issues.

Comment thread lib/utils/versions.js Resolved
@smini-digital

Copy link
Copy Markdown
Contributor Author

🔏 Readiness attested — the pr-readiness-check gate completed for PR #146 at 2542dd68314809b13dd9d4f3cfbb848cd417b75b (2026-11-11T13:00:48Z). If the branch head has moved, this evidence covers the earlier state only.

Readiness summary

PR Readiness Check (#146, 2542dd6)
Review mode INITIAL
Branch/base PASS (contains origin/main, clean, pushed head = PR head)
Local verification PASS: npm run lint, npm run check-format, npm test 42/42. CI runs lint and format but no tests, so the full test suite ran locally.
Remote CI PASS / DEFERRED UNTIL READY
- NPM (Lint, Check format): success on 2542dd6
- CodeQL (Analyze actions, javascript-typescript): success on 2542dd6
- License NPM / License Check: skipped on draft; DEFERRED UNTIL READY (ready_for_review trigger)
- Excluded: Publish to GitHub Packages (publishes; release-only), Dependabot Updates (not PR-triggered)
Coverage NOT REPORTED (no coverage instrumentation in this repo)
Automated reviewers PASS: Gemini reviewed head 2542dd6 (1 thread, REFUTED); Ratatoskr (fank) reviewed 976ef22 with 1 required change, FIXED in ad60444
Review threads PASS (0 unresolved; 9 Gemini threads answered and resolved)
Review comments PASS (open-review-comments.sh exit 0)
Council findings DISPOSITIONED. Three rounds (cap). Rounds 2–3 degraded: the deepseek juror's gcloud auth had expired; gemini-3-flash covered its reviewer roles.
- Round 1: 7 findings (1 FIXED, 3 REFUTED, 2 ADVISORY; the 2 duplicate-check findings were merged)
- Round 2: 5 findings (2 FIXED, 1 REFUTED, 2 ADVISORY)
- Round 3: 1 Minor finding, REFUTED
Standards review DISPOSITIONED: 1 Minor finding FIXED; 6 advisory notes (2 FIXED, 3 ADVISORY, 1 REFUTED)
Spec review DISPOSITIONED: 6 findings (2 FIXED, 1 REFUTED, 3 ADVISORY). Disclosed: classifying esq as current (DoD 10) was the implementer's clarification, shown to the user before they asked for the ready transition.
PR description PASS (what/why, AC table, testing, updated to 42 tests)
SQL/UI evidence SKIP (no SQL or UI changes)
Result: READY

Fixes made during readiness:

  • ea6e310: the up-to-date banner no longer claims success when nothing was checked; listing and warning tests added.
  • ad60444: Go tools update the binary that is on PATH (GOBIN); after an update, the tool is checked again.
  • 2542dd6: the banner requires every installed tool to be verified; versions that are not semver show as skipped.

Not exercised for real: brew upgrade and npm install -g updates. The Go update path was exercised live (atl v1.13.0 → v1.15.0).

@smini-digital
smini-digital marked this pull request as ready for review November 11, 2026 13:00
@smini-digital
smini-digital requested a review from fank November 11, 2026 13:01
@fank

fank commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Ratatoskr reviewed this pull request.

Changes requested on 2542dd68. See the review.

Finished 2026-11-11 13:06 UTC.

@fank fank 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.

REQUEST_CHANGES — 1 blocking correctness finding.

Review details

Reviewed head 2542dd68314809b13dd9d4f3cfbb848cd417b75b.

Finding

[P2] Refresh Homebrew metadata before declaring tools current — lib/utils/versions.js:175–179

The only Homebrew lookup is brew info, which does not trigger Homebrew's normal auto-update. Consequently, an installed tool matching cached metadata is reported as current even when brew upgrade would refresh metadata and install a newer release. This affects gh, sqlcmd, hcloud and brew-managed gcx/ovhcloud. In particular, the third-party OVH tap can remain stale indefinitely if the developer only runs setup; repeated setup runs never reach brew upgrade because no update prompt is offered.

Homebrew explicitly enables auto-update for outdated/upgrade, but not info (command classification). API-backed metadata also has a different cache lifetime outside auto-update commands. Please refresh metadata once per setup run within the timeout/error policy, or use a lookup that participates in Homebrew's normal freshness checks, before trusting outdated: false. Add coverage distinguishing stale metadata from a verified-current installation; the existing fake-brew test only checks parsing a supplied flag.

Verification

  • In a temporary archive of the exact head, using Node 24.21.0: npm ci --ignore-scripts, npm test, npm run lint, and npm run check-format all succeeded. 42 tests passed. The default shell initially lacked npm; the installed Node toolchain was then added to PATH.
  • GitHub checks were all passing when inspected.
  • No real package upgrades or interactive account/configuration changes were executed. Homebrew freshness behavior was checked against upstream source, not a local Homebrew installation.
  • The reviewed checkout remains unchanged.

Earlier discussions

Enumerated all review threads and their comments through GraphQL; neither connection required another page. All nine existing threads were already resolved; 0 unresolved, 0 newly resolved, 0 replies posted. No thread mutations were needed (existing discussions).

brew info never refreshes Homebrew metadata, so a stale tap reported tools
as current. brew outdated refreshes on Homebrew's auto-update schedule and
reflects what brew upgrade would install; pinned packages count as current.
brew info still decides whether brew manages a tool. Calls are serialized
to avoid contending for Homebrew's update lock.
@smini-digital

Copy link
Copy Markdown
Contributor Author

FIXED in 86b4e33: Ratatoskr review on 2542dd6, "Refresh Homebrew metadata before declaring tools current".

  • brewPackageInfo now decides outdated with brew outdated --json=v2, which takes part in Homebrew's auto-update (stale metadata is refreshed on Homebrew's schedule). brew info is used only to tell whether brew manages the tool. Pinned packages count as current because brew upgrade skips them.
  • The brew calls are serialized so parallel checks don't contend for Homebrew's update lock. They have a 60s timeout. A failed outdated lookup reports a skipped check with a warning.
  • brew outdated exits 1 whenever it lists something, so stdout is read on exit 1.
  • Tests (fake brew answering info and outdated separately): stale brew info metadata vs. a refreshed brew outdated listing (fails on 2542dd6, passes now), current, pinned, tapped cask matched by token, exit-1-with-listing, failed lookup.
  • npm test 47/47, lint and format clean. Live run on a dev machine: gh, sqlcmd and gcx are reported via brew outdated in 2.3s total.

@smini-digital
smini-digital requested a review from fank November 11, 2026 13:09
@fank

fank commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Ratatoskr reviewed this pull request.

Changes requested on 86b4e33b. See the review.

Finished 2026-11-11 13:13 UTC.

@smini-digital

Copy link
Copy Markdown
Contributor Author

FIXED: the change request in Ratatoskr's second status comment is addressed in 86b4e33. Details: reply.

@smini-digital

Copy link
Copy Markdown
Contributor Author

/gemini review

@fank fank 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.

REQUEST_CHANGES — 1 blocking correctness finding.

Review details

Finding

[P2] Match tapped Homebrew formula names — lib/utils/versions.js:219–222

brew outdated --json=v2 uses the formula's full name for non-core taps (for example, grafana/grafana/gcx), whereas this predicate compares it to the unqualified gcx. Consequently, an installed, outdated tapped formula is treated as current: no badge or update prompt appears. This affects the supported Homebrew-managed gcx path and other registered tools installed from taps.

Reproduced with a stubbed brew: info reports installed gcx 1.3.1, and outdated lists name: "grafana/grafana/gcx", current_version: "1.7.1", pinned: false; await brewPackageInfo('gcx') incorrectly returns { installed: '1.3.1', latest: '1.3.1', outdated: false }. Homebrew's outdated.rb emits f.full_name for formulae, unlike cask tokens.

Match the resolved full formula name (or normalize the returned formula name appropriately), and add a regression test with a qualified formula name. The existing tapped-cask test does not exercise this case.

Verification

Reviewed head 86b4e33b61d1691394c62455c62d5453514f9f12. In a temporary copy created with git archive HEAD (review checkout unchanged), ran:

  • npm ci --ignore-scripts: succeeded.
  • npm test: 47 passed, 0 failed.
  • npm run lint: passed.
  • npm run check-format: passed.
  • Isolated fake-Homebrew reproduction described above: confirmed the incorrect current verdict.

No real package upgrades, authentication flows, or browser installation were executed. GitHub checks inspected: lint/format, license and Actions analysis passed; JavaScript/TypeScript analysis was pending, and the CodeQL summary was skipped. Pending CI is not the reason for this verdict.

Earlier discussions

Enumerated review threads and comments through GraphQL; neither connection required another page. All nine existing threads were already resolved, so there were no unresolved findings to follow up, replies to post, or thread resolutions to perform.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces a comprehensive update-checking utility (lib/utils/versions.js) and integrates it across various CLI tool installers to check for and offer updates during setup. It also adds extensive test coverage for these new version-checking features. The review feedback highlights three key areas for improvement: updating the regular expression in extractVersion to correctly support hyphens in prerelease tags, adding a User-Agent header to GitHub API requests to prevent rate-limiting or 403 errors, and wrapping fs.realpathSync in a try-catch block to handle potential file system exceptions gracefully.

Comment thread lib/utils/versions.js Resolved
Comment thread lib/utils/versions.js Resolved
Comment thread lib/utils/versions.js Resolved
@smini-digital

Copy link
Copy Markdown
Contributor Author

FIXED in a2014bf: Ratatoskr review on 86b4e33, "Match tapped Homebrew formula names".

brew outdated --json=v2 --formula|--cask <name> is queried for exactly one package, so brewPackageInfo now takes that single entry instead of comparing names. Tapped formulae (grafana/grafana/gcx) and tapped casks are both covered, with no name normalization. The regression test (outdated lists name: "grafana/grafana/gcx") fails on 86b4e33/1acbf61 and passes now. npm test 49/49, lint and format clean, and the live check still reports the 7 outdated tools.

@smini-digital

Copy link
Copy Markdown
Contributor Author

FIXED: the change request in Ratatoskr's third status comment is addressed in a2014bf. Details: reply.

@smini-digital
smini-digital requested a review from fank November 11, 2026 13:32
@fank

fank commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Ratatoskr reviewed this pull request.

Approved on a2014bf5. See the review.

Finished 2026-11-11 13:36 UTC.

@smini-digital

Copy link
Copy Markdown
Contributor Author

🔏 Readiness attested — the pr-readiness-check gate completed for PR #146 at a2014bf5c3df6cb96750a35c2595dda095c87125 (2026-11-11T13:33:33Z). If the branch head has moved, this evidence covers the earlier state only.

Readiness summary

PR Readiness Check (#146, a2014bf)
Review mode FOLLOW-UP SUBSTANTIAL (delta 2542dd6 → a2014bf: the Homebrew lookup now uses brew outdated, which changes behaviour)
Branch/base PASS
Local verification PASS: npm run lint, npm run check-format, npm test 49/49
Remote CI PASS on a2014bf: NPM (Lint, Check format), License NPM (License Check), CodeQL (Analyze actions, javascript-typescript)
Coverage NOT REPORTED (no coverage instrumentation)
Automated reviewers PASS: Gemini reviewed 1acbf61 (3 threads, REFUTED). a2014bf is a small follow-up, so no retrigger. Ratatoskr (fank) requested changes on 2542dd6 and 86b4e33; both FIXED (86b4e33, a2014bf), re-review requested
Review threads PASS (0 unresolved)
Review comments PASS (open-review-comments.sh exit 0)
Council findings DISPOSITIONED. One refresh round on 2542dd6..86b4e33, degraded: 1 of 3 jurors usable because deepseek's gcloud auth had expired. 1 Minor finding: the cask name match had only been verified against fake brew output. FIXED in 1acbf61 after checking real brew outdated --cask output, then superseded by a2014bf
Standards review SKIP (covered in the initial readiness round; refresh got one Council round)
Spec review SKIP (covered in the initial readiness round)
PR description PASS
SQL/UI evidence SKIP
Result: READY

Refresh fixes:

  • 86b4e33: Homebrew tools are checked with brew outdated, which refreshes stale metadata on Homebrew's own schedule (the user chose this approach). Pinned packages count as current. Brew calls run one at a time. Exit code 1 from a listing is handled.
  • 1acbf61 / a2014bf: the single entry brew outdated returns is read directly, so tapped formulae and casks listed under their full name are recognized.

Open: fank's CHANGES_REQUESTED review state remains until Ratatoskr re-reviews a2014bf.

@fank fank 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.

APPROVE — 0 blocking findings; earlier update-path and Homebrew findings are fixed.

Review details

Reviewed head a2014bf5c3df6cb96750a35c2595dda095c87125 against base 0dd6979ea801164dd06384d5520d2886e1b715ad, including both entry points and installer integration. No remaining actionable blocking defects identified.

Earlier findings rechecked

  • Go update destination: goToolUpdate() now targets the resolved active binary directory using GOBIN and restores the previous environment; offerUpdate() checks the result again. test/go-tool-update.test.js exercises an active binary outside GOPATH/bin and passes.
  • Homebrew metadata freshness: checks now use brew outdated, participating in Homebrew's normal auto-update schedule. The stale-info regression passes; verified the command's freshness behavior against upstream Homebrew source.
  • Tapped formula names: the package-specific query now reads the returned entry without incorrectly comparing its qualified name to an unqualified name. Tests cover grafana/grafana/gcx and both cask name forms.

Verification

The default shell lacked npm, and the checkout had no installed dependencies. Using the installed Node 24.21.0 toolchain, exported the exact head with git archive HEAD into a temporary directory and ran:

  • npm ci --ignore-scripts — succeeded.
  • npm test — 49 passed, 0 failed.
  • npm run lint — passed.
  • npm run check-format — passed.

All GitHub checks inspected were passing. No real package upgrades, account authentication/configuration changes, or browser installations were performed. Those live integration paths remain unverified locally. The reviewed checkout is unchanged.

Discussion follow-up

GraphQL enumeration returned all 12 review threads and their comments; neither connection required pagination. All were already resolved: 0 unresolved, 0 newly resolved, 0 replies posted. No thread-state mutations were appropriate. Existing discussions: PR review threads.

@smini-digital

Copy link
Copy Markdown
Contributor Author

ADVISORY: Ratatoskr's approval of a2014bf confirms the three earlier findings are fixed. Nothing further to address.

@ktaganova ktaganova 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.

Ran the full flow locally on macOS (Node 24, Homebrew 6) with expect driving the prompts — works as described.

  • npm test 49/49; read-only check lists the expected tools, esq reported current
  • Decline path (--gh), current tool (--esq, no prompt), replace-hook path via configureShellEnv with a discord replace hook (one prompt, none on re-entry) — all ✅
  • Real updates (noted as not exercised in the PR): npm install -g (playwright 1.61.1 → 1.65.0, matching chromium-1254 installed in the same run) and brew upgrade (sqlcmd 1.9.0 → 1.10.0) both work. Also Go (atl v1.14.0 → v1.15.0, auth untouched) and the gcx GitHub-release download (1.0.0 → 1.7.1, context kept). A re-check afterwards reports all four current.

Offline test note: an HTTP proxy alone doesn't make the machine offline. With url.ssh://git@github.com/.insteadof https://github.com/ in the git config, git ls-remote goes over SSH and ignores the proxy, and Node 24's fetch ignores HTTPS_PROXY unless NODE_USE_ENV_PROXY=1 is set. In my first proxy-only run, only npm was skipped. With NODE_USE_ENV_PROXY=1 plus a dead GIT_SSH_COMMAND, the behavior is correct: a skip warning, brew still reports, the Reinstall (y/N) fallback appears, and the run takes about 14s.

Nothing blocking; three small inline notes.

Comment thread lib/utils/versions.js Resolved
Comment thread bin/cli.js Resolved
Comment thread lib/utils/versions.js Resolved
- Single-tool flags (--gh, --atl, --llm, ...) no longer wait on every lookup;
  offerUpdate checks the selected tool lazily and warns once if it fails.
- The full check hints that Homebrew may refresh its metadata first.
- GitHub release versions drop the leading v, matching installed versions.
@smini-digital

Copy link
Copy Markdown
Contributor Author

/gemini review

@smini-digital

Copy link
Copy Markdown
Contributor Author

Thanks for the review and for running the real updates.

  • FIXED in 85edc28: all three inline notes (Homebrew refresh hint, single-tool flags check only their own tool, no leading v on GitHub release versions). Details are in each thread.
  • ADVISORY: the offline-test note about the proxy, NODE_USE_ENV_PROXY=1 and the SSH insteadOf needs no code change. It is a caveat for how to simulate offline. The behaviour you saw once the network was really cut (skip warning, brew still reports, Reinstall fallback) is the intended behaviour.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces a comprehensive update-checking mechanism for various CLI tools, implementing version comparisons, latest-version lookups (via Git tags, Homebrew, npm, and GitHub releases), caching, and interactive update prompts. It integrates these checks across multiple installer modules and adds thorough unit tests. The review feedback suggests two key improvements in lib/utils/versions.js: adding a required User-Agent header to GitHub API requests to ensure reliability, and wrapping the tool.isInstalled() check inside the try...catch block in evaluate to handle potential exceptions and undefined tools more robustly.

Comment thread lib/utils/versions.js Resolved
Comment thread lib/utils/versions.js Resolved

@ktaganova ktaganova 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.

Verified 85edc28 locally: npm test 52/52, eslint/prettier clean. Homebrew hint shows on the full check; --gh/--esq check only their own tool (~2s instead of the full sweep); offline --discord warns and falls back to the Reinstall prompt; GitHub release versions come back without the v (1.7.1). LGTM.

@ktaganova
ktaganova merged commit a7ee241 into main Nov 13, 2026
6 checks passed
@ktaganova
ktaganova deleted the feature/NX-16342-tool-update-check branch November 13, 2026 07:21
@ktaganova ktaganova mentioned this pull request Nov 13, 2026
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.

3 participants