Skip to content

List available updates - #160

Open
DireMunchkin wants to merge 4 commits into
runtipi:developfrom
DireMunchkin:list-available-updates
Open

List available updates#160
DireMunchkin wants to merge 4 commits into
runtipi:developfrom
DireMunchkin:list-available-updates

Conversation

@DireMunchkin

@DireMunchkin DireMunchkin commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Closes runtipi/runtipi#2490

Summary by CodeRabbit

  • New Features
    • Added an app available-updates command to identify installed apps with available updates.
    • Displays current and latest Docker and Tipi versions in a table.
    • Reports when all installed apps are up to date.
  • Bug Fixes
    • Added validation and clear error handling for incomplete or invalid app data.
  • Tests
    • Added coverage for update detection, up-to-date apps, and invalid responses.

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Adds an app available-updates CLI command that retrieves installed apps, validates version metadata, identifies apps with newer TIPI versions, and prints update details. Tests cover update detection and invalid payloads, and CI now runs Go tests.

Changes

Available-updates subcommand

Layer / File(s) Summary
AppCommand constant and CLI subcommand registration
internal/types/args.go, cmd/runtipi/main.go, internal/commands/app.go
Adds the available-updates command, registers it with the app command, and dispatches it through RunApp.
Installed-app response contract and update detection
internal/commands/app.go, tests/commands/app_test.go
Adds typed API DTOs and FindAvailableUpdates, which validates payload fields, compares current and latest TIPI versions, and maps update details. Tests cover updates, current apps, and invalid payloads.
Update retrieval, rendering, and CI validation
internal/commands/app.go, .github/workflows/ci.yml
Fetches apps/installed, handles request and response errors, renders update results, and runs Go tests in CI.

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
Loading

Possibly related issues

Possibly related PRs

  • runtipi/cli#111 — Both extend the centralized RunApp app-command dispatch.
  • runtipi/cli#112 — Both add CLI functionality using the apps/installed API response.

Suggested labels: size/L

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately summarizes the new available-updates command.
Linked Issues check ✅ Passed The PR lists apps with available updates and includes current and available versions plus extra update details requested in #2490.
Out of Scope Changes check ✅ Passed The CI test step and new tests support the update-listing feature and do not appear unrelated to the issue.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

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

@DireMunchkin
DireMunchkin marked this pull request as draft June 23, 2026 08:43
@DireMunchkin
DireMunchkin marked this pull request as ready for review June 23, 2026 15:57
@DireMunchkin

Copy link
Copy Markdown
Contributor Author

Here is an example of the output when there is an update:

Screenshot from 2026-06-23 17-56-52

@coderabbitai coderabbitai Bot 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.

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

📥 Commits

Reviewing files that changed from the base of the PR and between f1597a8 and fd99a08.

📒 Files selected for processing (1)
  • internal/commands/app.go

Comment thread internal/commands/app.go Outdated
@DireMunchkin
DireMunchkin force-pushed the list-available-updates branch from fd99a08 to 8adcd19 Compare June 23, 2026 16:24

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (1)
tests/commands/app_test.go (1)

10-72: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add test coverage for whitespace validation and AppUpdate field assertions.

The FindAvailableUpdates function validates whitespace-only values for URN, Version, and LatestDockerVersion using strings.TrimSpace, but no test case exercises these paths. Additionally, lines 65-69 only assert TipiVersion and LatestTipi, leaving URN, CurrentVersion, and LatestVersion unverified — a mapping bug in those fields would go undetected.

Consider adding:

  1. A test case with whitespace-only urn or version values to cover the TrimSpace rejection paths.
  2. A test case with multiple installed apps where some have updates and some don't, verifying correct filtering.
  3. Assertions for URN, CurrentVersion, and LatestVersion on the returned AppUpdate to 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

📥 Commits

Reviewing files that changed from the base of the PR and between fd99a08 and ff85fb0.

📒 Files selected for processing (5)
  • .github/workflows/ci.yml
  • cmd/runtipi/main.go
  • internal/commands/app.go
  • internal/types/args.go
  • tests/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

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.

[REQUEST] CLI check if an update is available for an app

1 participant