Skip to content

feat(capabilities): add support capabilities to indicate valid subscription#12

Merged
Arsalanulhaq merged 3 commits intomainfrom
as/dev/add_capabilites_file
Feb 26, 2026
Merged

feat(capabilities): add support capabilities to indicate valid subscription#12
Arsalanulhaq merged 3 commits intomainfrom
as/dev/add_capabilites_file

Conversation

@Arsalanulhaq
Copy link
Contributor

@Arsalanulhaq Arsalanulhaq commented Feb 23, 2026

This pull request introduces a new Capabilities class 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:

  • Added a new Capabilities class in lib/Capabilities.php that implements ICapability and always returns support.hasValidSubscription = true and desktopEnterpriseChannel = 'stable' in the app's capabilities. This ensures the support capability is present even if other apps or checks fail.
  • Registered the new Capabilities class in the application bootstrap process, so it is included in the system capabilities. [1] [2]

@Arsalanulhaq Arsalanulhaq force-pushed the as/dev/add_capabilites_file branch from 0d5eaaf to 9b81da5 Compare February 23, 2026 12:46
…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>
@Arsalanulhaq Arsalanulhaq force-pushed the as/dev/add_capabilites_file branch from 9b81da5 to e5478c2 Compare February 23, 2026 13:33
@Arsalanulhaq Arsalanulhaq modified the milestones: rc/ncw-5, ncw-5 Feb 23, 2026
@bromiesTM bromiesTM requested a review from Copilot February 26, 2026 09:38
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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\Capabilities implementing ICapability.
  • 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
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copilot uses AI. Check for mistakes.
@Arsalanulhaq Arsalanulhaq changed the title feat(capabilities): add support capabilities to indicate invalid subs… feat(capabilities): add support capabilities to indicate valid subscription Feb 26, 2026
Copy link

@bromiesTM bromiesTM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@printminion-co printminion-co modified the milestones: ncw-5, ncw-4 Feb 26, 2026
@Arsalanulhaq Arsalanulhaq merged commit e1a0bec into main Feb 26, 2026
33 checks passed
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.

4 participants