Skip to content

Conversation

@Miraeld
Copy link
Contributor

@Miraeld Miraeld commented Jul 3, 2025

Description

Won't impact users.
Setup the guidelines for CoPilot

Type of change

  • Chore

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

  • Added a new COPILOT_GUIDELINES.md file 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

  • Introduced a copilot-setup-steps.yml GitHub 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 to main and test/* branches.

New dependencies

None

Risks

None

Mandatory Checklist

Unticked items justification

Not relevant because it's only markdown files.

@Miraeld Miraeld self-assigned this Jul 3, 2025
Copilot AI review requested due to automatic review settings July 3, 2025 03:10

This comment was marked as outdated.

@codacy-production
Copy link

codacy-production bot commented Jul 3, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for da3e3e11 (target: 50.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (da3e3e1) Report Missing Report Missing Report Missing
Head commit (1d7b84b) 41646 18638 44.75%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#7483) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

Miraeld added 3 commits July 3, 2025 08:34
…with improved PHP and Node.js configurations, added integration tests, and comprehensive documentation checks.
@Miraeld Miraeld requested a review from Copilot July 4, 2025 03:36
Copy link
Contributor

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 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.md with coding standards, architecture patterns, testing practices, and development workflows.
  • Add copilot-setup-steps.yml GitHub 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

Comment on lines +420 to +421
composer run phpcs # Code standards check (WordPress Coding Standards)
composer run run-stan # PHPStan static analysis
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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

Comment on lines +425 to +426
1. Run `composer run phpcs` and fix all violations
2. Run `composer run run-stan` and address type issues
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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`
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- 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`)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Test class: `Test_MethodName` (e.g., `Test_ProcessData`)
- Test class: `MethodNameTest` (e.g., `ProcessDataTest`)


**Example:**
```php
class Test_ProcessData extends TestCase {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
class Test_ProcessData extends TestCase {
class ProcessDataTest extends TestCase {

* @group PerformanceMonitoring
* @group AdminOnly
*/
class Test_ProcessData extends TestCase {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- `@return` with the return type

Return value is always the same as first param so it's unnecessary

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.

3 participants