Skip to content

feat(cli): add --check option to only check for an available update - #784

Open
tobiasKaminsky wants to merge 2 commits into
masterfrom
feat/cli-check-option
Open

tobiasKaminsky wants to merge 2 commits into
masterfrom
feat/cli-check-option

Conversation

@tobiasKaminsky

Copy link
Copy Markdown
Member

Adds a --check option to updater.phar that only checks for an available update and prints the result in a stable, script-friendly format, without updating:

Current version: 31.0.5
Available version: 31.0.14.1
Available version name: Nextcloud 31.0.14
Updater can apply update: yes

(Available version: none if there is no update.)

Use case: let admins script updates within the current major version only (patch updates), by comparing the major of the current and available versions before running the updater.

  • Updater: keep the offered version and expose getAvailableVersion() / getAvailableVersionString() (index.php regenerated)
  • UpdateCommand: new --check option
  • Behat scenarios for "no update" and "update available" in check mode
  • README documents the option
  • updater.phar rebuilt

🤖 Generated with Claude Code

tobiasKaminsky and others added 2 commits November 3, 2026 13:25
Prints the current and available version in a stable, script friendly
format without updating, e.g. to only apply updates within the current
major version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
@joshtrichards

Copy link
Copy Markdown
Member

Arguably this would address #319.

Question is I guess: do we want to also include no major logic and are there any downsides to doing so?

@tobiasKaminsky

Copy link
Copy Markdown
Member Author

This check is broader, so anyone can then do whatever they want.
E.g.: run minor/patch updates during every night.
Run major updates only on weekend.

"Only" skip major is maybe too restricted.

@Altahrim

Copy link
Copy Markdown
Collaborator

I feel like most of the functionality is already in occ update:check. It also check apps.
I think we should add a JSON output to update:check, no?

@tobiasKaminsky

Copy link
Copy Markdown
Member Author

Never heard about updater:check so far, but yeah, if this is easier/better maintanable, totally up for it.

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