Skip to content

feat(services): add lifecycle and connectivity services - #984

Open
karlitschek wants to merge 5 commits into
masterfrom
split/07-services-lifecycle-connectivity
Open

feat(services): add lifecycle and connectivity services#984
karlitschek wants to merge 5 commits into
masterfrom
split/07-services-lifecycle-connectivity

Conversation

@karlitschek

Copy link
Copy Markdown
Member

Adds four read-only service classes used by the upcoming admin dashboard cards. None are wired into existing controllers yet, so this change is a pure addition with no behavior change.

  • EolInfo - PHP and Nextcloud end-of-life date warnings
  • OsUpdates - reads /var/lib/update-notifier/updates-available
    and /var/run/reboot-required (no sudo, no shell)
  • AppStoreReachability - cached HEAD probe to apps.nextcloud.com
  • FederationStats - sent / received / trusted-server counts

Adds four read-only service classes used by the upcoming admin
dashboard cards. None are wired into existing controllers yet, so
this change is a pure addition with no behavior change.

* EolInfo              - PHP and Nextcloud end-of-life date warnings
* OsUpdates            - reads /var/lib/update-notifier/updates-available
                         and /var/run/reboot-required (no sudo, no shell)
* AppStoreReachability - cached HEAD probe to apps.nextcloud.com
* FederationStats      - sent / received / trusted-server counts

Signed-off-by: Frank Karlitschek <frank@nextcloud.com>
Comment thread lib/EolInfo.php
Comment thread lib/EolInfo.php

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

Comment thread lib/EolInfo.php Outdated
Comment thread lib/EolInfo.php Outdated
Comment thread lib/EolInfo.php Outdated
karlitschek and others added 4 commits August 6, 2026 13:41
Co-authored-by: Christoph Wurst <1374172+ChristophWurst@users.noreply.github.com>
Signed-off-by: Frank Karlitschek <karlitschek@users.noreply.github.com>
Co-authored-by: Christoph Wurst <1374172+ChristophWurst@users.noreply.github.com>
Signed-off-by: Frank Karlitschek <karlitschek@users.noreply.github.com>
Co-authored-by: Christoph Wurst <1374172+ChristophWurst@users.noreply.github.com>
Signed-off-by: Frank Karlitschek <karlitschek@users.noreply.github.com>

Copilot AI 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.

Pull request overview

Adds four new read-only “service” classes under lib/ intended to back upcoming admin dashboard cards, providing OS update signals, EOL warnings, app store reachability probing, and federation sharing statistics. The change is additive and not yet wired into controllers.

Changes:

  • Add EolInfo to compute PHP and Nextcloud EOL status entries.
  • Add OsUpdates to derive update/reboot state from OS filesystem markers without shell/sudo.
  • Add AppStoreReachability (cached) and FederationStats (DB-derived) for dashboard connectivity/stat cards.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
lib/EolInfo.php New service computing PHP/Nextcloud EOL date status payloads.
lib/OsUpdates.php New service reading OS update and reboot-required signals from common distro files.
lib/AppStoreReachability.php New service probing apps.nextcloud.com and caching the result in app config.
lib/FederationStats.php New service querying DB tables to summarize federated share/trusted-server stats.
Suppressed comments (1)

lib/EolInfo.php:53

  • The constructor injects $config but the property is never used. This creates unnecessary DI requirements and may confuse readers about intended configuration behavior.
	public function __construct(
		private IConfig $config,
		private ServerVersion $serverVersion,
	) {

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/OsUpdates.php
}
}

$supported = $source !== '' || $rebootFlag || $distro !== '';
$reachable = false;
$status = 0;
try {
$response = $client->head('https://apps.nextcloud.com/api/v1/platform/29.0.0/apps.json', [
Comment thread lib/EolInfo.php
Comment on lines +12 to +13
use OCP\IConfig;
use OCP\ServerVersion;
Comment thread lib/FederationStats.php
Comment on lines +34 to +36
$enabled = $this->appManager->isInstalled('federation') || $this->appManager->isInstalled('federatedfilesharing');

try {
Comment thread lib/OsUpdates.php
Comment on lines +102 to +106
private function parseUpdateNotifier(string $content): array {
$updates = 0;
$security = 0;

if (preg_match('/(\d+)\s+updates?\s+can\s+be\s+(?:installed|applied)/i', $content, $m)) {
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