Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Run setup checks by category or class #49978

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

joshtrichards
Copy link
Member

Summary

This PR adds the ability to run:

  • a specific category of setup checks
  • an individual check

Implementation:

  • Existing setup check category names are used for running checks in a specific category (e.g. network)
  • Existing class names are used for running individual checks
  • All checks still run otherwise by default so not a breaking change in behavior

Examples:

Run all checks in a specific category - e.g. the network related tests:

./occ setupchecks network

RESULT:

www-data@83e3407f887c:~/html$ ./occ setupchecks network
	network:
		✓ WebDAV endpoint: Your web server is properly set up to allow file synchronization over WebDAV.
		✓ Data directory protected
		✓ Internet connectivity
		✓ JavaScript source map support
		✓ JavaScript modules support
		✓ OCS provider resolving
		✓ .well-known URLs: Your server is correctly configured to serve `.well-known` URLs.
		✓ Font file loading
www-data@83e3407f887c:~/html$ 

Run a specific individual check - e.g. the InternetConnectivity test:

./occ setupcheck OCA\\Settings\\SetupChecks\\InternetConnectivity

RESULT:

www-data@83e3407f887c:~/html$ ./occ setupcheck OCA\\Settings\\SetupChecks\\InternetConnectivity
	network:
		✓ Internet connectivity
www-data@83e3407f887c:~/html$ 

If an unrecognized category / class is specified inform the user:

www-data@83e3407f887c:~/html$ ./occ setupchecks xxx    
Invalid type specified (or no results for that type)
www-data@83e3407f887c:~/html$ 

TODO

Checklist

@joshtrichards joshtrichards force-pushed the jtr-feat-setupchecks-limit-type branch from 63f03c8 to 6221951 Compare December 28, 2024 16:57
Copy link
Contributor

@come-nc come-nc left a comment

Choose a reason for hiding this comment

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

👍

@blizzz blizzz mentioned this pull request Jan 8, 2025
This was referenced Jan 14, 2025
@Altahrim Altahrim mentioned this pull request Jan 21, 2025
;
}

protected function execute(InputInterface $input, OutputInterface $output): int {
$results = $this->setupCheckManager->runAll();
$limit = $input->getArgument('type');
Copy link
Contributor

Choose a reason for hiding this comment

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

Why call it limit?

Suggested change
$limit = $input->getArgument('type');
$type = $input->getArgument('type');

Comment on lines +55 to +59
if (substr_count($limit, '\\') > 1) {
$results = $this->setupCheckManager->runClass($limit);
} else {
$results = $this->setupCheckManager->runCategory($limit);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe introducing two distinct flags would make it more straightforward

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants