feat(services): add lifecycle and connectivity services - #984
Open
karlitschek wants to merge 5 commits into
Open
feat(services): add lifecycle and connectivity services#984karlitschek wants to merge 5 commits into
karlitschek wants to merge 5 commits into
Conversation
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>
ChristophWurst
left a comment
Member
There was a problem hiding this comment.
Date correction according to https://github.com/nextcloud/server/wiki/Maintenance-and-Release-Schedule
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>
karlitschek
requested review from
ChristophWurst
and
a lite review from Copilot
August 6, 2026 11:55
There was a problem hiding this comment.
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
EolInfoto compute PHP and Nextcloud EOL status entries. - Add
OsUpdatesto derive update/reboot state from OS filesystem markers without shell/sudo. - Add
AppStoreReachability(cached) andFederationStats(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
$configbut 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.
| } | ||
| } | ||
|
|
||
| $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 on lines
+12
to
+13
| use OCP\IConfig; | ||
| use OCP\ServerVersion; |
Comment on lines
+34
to
+36
| $enabled = $this->appManager->isInstalled('federation') || $this->appManager->isInstalled('federatedfilesharing'); | ||
|
|
||
| try { |
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)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
and /var/run/reboot-required (no sudo, no shell)