feat(capabilities): add support capabilities to indicate valid subscription#12
Merged
Arsalanulhaq merged 3 commits intomainfrom Feb 26, 2026
Merged
feat(capabilities): add support capabilities to indicate valid subscription#12Arsalanulhaq merged 3 commits intomainfrom
Arsalanulhaq merged 3 commits intomainfrom
Conversation
0d5eaaf to
9b81da5
Compare
…iption status Signed-off-by: Arsalan Ul Haq Sohni <arsalan-ul-haq.sohni@strato.de>
…ion tests Signed-off-by: Arsalan Ul Haq Sohni <arsalan-ul-haq.sohni@strato.de>
…lass Signed-off-by: Arsalan Ul Haq Sohni <arsalan-ul-haq.sohni@strato.de>
9b81da5 to
e5478c2
Compare
There was a problem hiding this comment.
Pull request overview
Adds an app capability provider to surface support-related capability data via Nextcloud’s capabilities system, and wires it into the app bootstrap. Also introduces unit/integration test suite separation for PHPUnit.
Changes:
- Added
OCA\NcwTools\CapabilitiesimplementingICapability. - Registered the capability in
lib/AppInfo/Application.php. - Added unit + integration tests and split PHPUnit configuration into separate unit/integration suites (plus composer scripts).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
lib/Capabilities.php |
Introduces the capability payload returned to the Nextcloud capabilities system. |
lib/AppInfo/Application.php |
Registers the new capability with the bootstrap registration context. |
tests/unit/CapabilitiesTest.php |
Unit tests for the Capabilities payload and interface implementation. |
tests/integration/CapabilitiesIntegrationTest.php |
Integration-style test around CapabilitiesManager behavior when the capability is registered. |
tests/phpunit.xml |
Adjusts PHPUnit to run only unit tests from tests/unit. |
tests/phpunit.integration.xml |
New PHPUnit config for integration tests in tests/integration. |
composer.json |
Updates test scripts to run unit vs integration suites separately. |
Comment on lines
+21
to
+22
| * | ||
| * @group DB |
There was a problem hiding this comment.
This test is annotated with @group DB, but it doesn't appear to interact with the database (it only constructs a CapabilitiesManager). If it doesn't actually require DB setup, consider removing the DB group to avoid unnecessarily running it in DB-only pipelines.
Suggested change
| * | |
| * @group DB |
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.
This pull request introduces a new
Capabilitiesclass to ensure the app always advertises a valid subscription in the system capabilities, regardless of the actual subscription state. It also adds comprehensive unit and integration tests for this capability and reorganizes the PHPUnit test configuration to separate unit and integration tests.Capabilities override and registration:
Capabilitiesclass inlib/Capabilities.phpthat implementsICapabilityand always returnssupport.hasValidSubscription = trueanddesktopEnterpriseChannel = 'stable'in the app's capabilities. This ensures the support capability is present even if other apps or checks fail.Capabilitiesclass in the application bootstrap process, so it is included in the system capabilities. [1] [2]