Skip to content

Show CLI update reminders for version checks - #1802

Merged
ChiragAgg5k merged 2 commits into
mainfrom
fix/cli-update-reminder
Aug 16, 2026
Merged

Show CLI update reminders for version checks#1802
ChiragAgg5k merged 2 commits into
mainfrom
fix/cli-update-reminder

Conversation

@ChiragAgg5k

@ChiragAgg5k ChiragAgg5k commented Aug 16, 2026

Copy link
Copy Markdown
Member

Summary

  • run the CLI update check after Cobra handles early exits such as --version and --help
  • avoid repeating the check for commands that already ran PersistentPreRun
  • link the installed version's GitHub release notes after a successful update
  • hide account prefs from human-readable output while retaining them under --raw
  • add regression coverage for these behaviors
before: appwrite -v -> appwrite version 26.1.0
after:  appwrite -v -> appwrite version 26.1.0 + 27.0.0 update reminder

update: Updated to version 27.0.0.
        Release notes: https://github.com/appwrite/sdk-for-cli/releases/tag/27.0.0

Test plan

  • php example.php cli
  • cd examples/cli && go mod tidy && go build ./... && go vet ./... && go test ./...
  • test -z "$(gofmt -l examples/cli)"
  • composer lint-twig
  • composer refactor:check
  • Build a 26.1.0 CLI and verify appwrite -v reports the 27.0.0 update

@greptile-apps

greptile-apps Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR moves CLI update checks behind a shared execution wrapper so Cobra early exits can still display update reminders while avoiding duplicate checks.

  • Adds update reminders for successful --version and similar early-exit paths.
  • Deduplicates checks already performed by PersistentPreRun.
  • Prints release-note links after successful updates.
  • Hides account preferences from human-readable output while preserving them in raw output.
  • Adds regression tests for update checking, release-note URLs, and preference filtering.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
templates/cli/internal/cmd/root.go.twig Adds the shared execution wrapper and root-scoped annotation used to run and deduplicate update checks.
templates/cli/main.go.twig Routes CLI execution through the new wrapper while retaining the executed command for error reporting.
templates/cli/internal/cmd/update.go.twig Prints the corresponding release-notes URL after successful managed and standalone updates.
templates/cli/internal/output/filter.go Excludes top-level preferences from human-readable output without affecting JSON or raw rendering.
templates/cli/internal/cmd/help_test.go Adds regression coverage proving that the version early-exit path performs the update check.
templates/cli/internal/output/filter_test.go Extends hidden-key and raw-output coverage for account preferences.

Reviews (2): Last reviewed commit: "feat(cli): link release notes after upda..." | Re-trigger Greptile

@ChiragAgg5k
ChiragAgg5k merged commit c876443 into main Aug 16, 2026
58 of 59 checks passed
@ChiragAgg5k
ChiragAgg5k deleted the fix/cli-update-reminder branch August 16, 2026 10:34
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