List available updates - #160
Conversation
WalkthroughAdds an ChangesAvailable-updates subcommand
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant CLI as app available-updates
participant RunApp as RunApp
participant API as apps/installed endpoint
CLI->>RunApp: dispatch available-updates
RunApp->>API: GET apps/installed
API-->>RunApp: installed app metadata
RunApp->>RunApp: FindAvailableUpdates
RunApp-->>CLI: print update table or up-to-date message
Possibly related issues
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
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 `@internal/commands/app.go`:
- Around line 159-166: The condition at line 159 checking only `app.App.Version
< app.Metadata.LatestVersion` fails to detect updates when the Tipi version is
unchanged but a newer Docker image version is available. Modify the if condition
to also check whether the current Docker version (app.Info.Version) differs from
the latest available Docker version (app.Metadata.LatestDockerVersion). Use a
logical OR operator to ensure the appUpdate struct gets populated whenever
either the Tipi version or the Docker version has a newer release available.
🪄 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 UI
Review profile: CHILL
Plan: Pro
Run ID: d50a40e6-906a-4bc8-bac1-35cd5dd11cf3
📒 Files selected for processing (1)
internal/commands/app.go
fd99a08 to
8adcd19
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/commands/app_test.go (1)
10-72: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd test coverage for whitespace validation and AppUpdate field assertions.
The
FindAvailableUpdatesfunction validates whitespace-only values forURN,Version, andLatestDockerVersionusingstrings.TrimSpace, but no test case exercises these paths. Additionally, lines 65-69 only assertTipiVersionandLatestTipi, leavingURN,CurrentVersion, andLatestVersionunverified — a mapping bug in those fields would go undetected.Consider adding:
- A test case with whitespace-only
urnorversionvalues to cover theTrimSpacerejection paths.- A test case with multiple installed apps where some have updates and some don't, verifying correct filtering.
- Assertions for
URN,CurrentVersion, andLatestVersionon the returnedAppUpdateto catch field-mapping regressions.🤖 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 `@tests/commands/app_test.go` around lines 10 - 72, Expand TestFindAvailableUpdates to cover TrimSpace rejection for whitespace-only URN, Version, or LatestDockerVersion values, and add a multiple-app payload verifying only outdated apps are returned. Extend the returned AppUpdate assertions beyond TipiVersion and LatestTipi to validate URN, CurrentVersion, and LatestVersion, using expected values from the update fixture.
🤖 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.
Nitpick comments:
In `@tests/commands/app_test.go`:
- Around line 10-72: Expand TestFindAvailableUpdates to cover TrimSpace
rejection for whitespace-only URN, Version, or LatestDockerVersion values, and
add a multiple-app payload verifying only outdated apps are returned. Extend the
returned AppUpdate assertions beyond TipiVersion and LatestTipi to validate URN,
CurrentVersion, and LatestVersion, using expected values from the update
fixture.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 92e3d9f3-187b-4f54-80b9-d63c0d8c7db3
📒 Files selected for processing (5)
.github/workflows/ci.ymlcmd/runtipi/main.gointernal/commands/app.gointernal/types/args.gotests/commands/app_test.go
🚧 Files skipped from review as they are similar to previous changes (3)
- internal/types/args.go
- cmd/runtipi/main.go
- internal/commands/app.go

Closes runtipi/runtipi#2490
Summary by CodeRabbit
app available-updatescommand to identify installed apps with available updates.