-
Notifications
You must be signed in to change notification settings - Fork 234
Add Copilot guidelines and setup workflow for WP Rocket #7483
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
base: develop
Are you sure you want to change the base?
Conversation
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesFootnotes
|
…with improved PHP and Node.js configurations, added integration tests, and comprehensive documentation checks.
There was a problem hiding this 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 a new set of GitHub Copilot–specific contribution guidelines and a CI workflow to automate environment setup and code validation for the WP Rocket plugin.
- Introduce
COPILOT_GUIDELINES.mdwith coding standards, architecture patterns, testing practices, and development workflows. - Add
copilot-setup-steps.ymlGitHub Actions workflow to install PHP/Composer/Node, run PHPCS, PHPStan, and PHPUnit on push and PR.
Reviewed Changes
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| .github/COPILOT_GUIDELINES.md | New markdown outlining coding conventions, project structure, TDD, CI |
| .github/workflows/copilot-setup-steps.yml | New GitHub Actions workflow for automated setup and testing |
| composer run phpcs # Code standards check (WordPress Coding Standards) | ||
| composer run run-stan # PHPStan static analysis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| composer run phpcs # Code standards check (WordPress Coding Standards) | |
| composer run run-stan # PHPStan static analysis | |
| composer phpcs # Code standards check (WordPress Coding Standards) | |
| composer run-stan # PHPStan static analysis |
| 1. Run `composer run phpcs` and fix all violations | ||
| 2. Run `composer run run-stan` and address type issues |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 1. Run `composer run phpcs` and fix all violations | |
| 2. Run `composer run run-stan` and address type issues | |
| 1. Run `composer phpcs` and fix all violations | |
| 2. Run `composer run-stan` and address type issues |
| - Fixtures: `tests/Fixtures/` (same path as test file) | ||
|
|
||
| **Naming Conventions:** | ||
| - Test files: `path/to/class/ClassName/methodName.php` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - Test files: `path/to/class/ClassName/methodName.php` | |
| - Test files: `path/to/class/ClassName/methodNameTest.php` |
|
|
||
| **Naming Conventions:** | ||
| - Test files: `path/to/class/ClassName/methodName.php` | ||
| - Test class: `Test_MethodName` (e.g., `Test_ProcessData`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - Test class: `Test_MethodName` (e.g., `Test_ProcessData`) | |
| - Test class: `MethodNameTest` (e.g., `ProcessDataTest`) |
|
|
||
| **Example:** | ||
| ```php | ||
| class Test_ProcessData extends TestCase { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| class Test_ProcessData extends TestCase { | |
| class ProcessDataTest extends TestCase { |
| * @group PerformanceMonitoring | ||
| * @group AdminOnly | ||
| */ | ||
| class Test_ProcessData extends TestCase { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| class Test_ProcessData extends TestCase { | |
| class ProcessDataTest extends TestCase { |
| - Description of what the filter does | ||
| - `@since` version tag | ||
| - `@param` for all parameters with types | ||
| - `@return` with the return type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - `@return` with the return type |
Return value is always the same as first param so it's unnecessary
Description
Won't impact users.
Setup the guidelines for CoPilot
Type of change
Detailed scenario
What was tested
None
How to test
None
Technical description
Documentation
This pull request introduces a set of guidelines for contributing to the WP Rocket plugin and a new GitHub Actions workflow for automated setup and testing. These changes aim to standardize development practices and streamline the CI/CD process.
Contribution Guidelines
COPILOT_GUIDELINES.mdfile outlining coding standards, project architecture, testing practices, and development workflows for WP Rocket. This includes PHP coding standards, JavaScript and CSS guidelines, and instructions for writing tests and fixtures.CI/CD Workflow
copilot-setup-steps.ymlGitHub Actions workflow to automate the setup and testing of WP Rocket. This workflow installs PHP, Composer, Node.js, and project dependencies, and runs PHPCS, PHPStan, and PHPUnit tests on pushes and pull requests tomainandtest/*branches.New dependencies
None
Risks
None
Mandatory Checklist
Unticked items justification
Not relevant because it's only markdown files.