chore: upgrade repository scaffolding (Step 1)#149
Open
milindmore22 wants to merge 8 commits into
Open
Conversation
…g and docblock types
Contributor
There was a problem hiding this comment.
Pull request overview
This PR performs Step 1 of the repository migration runbook: upgrading OneUpdate’s scaffold to current standards, introducing modular CI/CD workflows, and modernizing lint/test/release tooling to match the plugin-skeleton-d baseline.
Changes:
- Introduces a modular GitHub Actions CI setup (linting, PHPStan/PHPCS/PHPUnit, Jest, E2E, build + Playground preview) and release automation via release-please.
- Modernizes JS/TS tooling (ESLint flat config, Jest setup, shared TS config) and updates build configuration (webpack/wp-scripts).
- Updates PHP tooling + testing scaffold (PHPUnit 11.5 config/bootstrap, PHPStan config, PHPCS ruleset) and aligns repo meta/docs/config files.
Reviewed changes
Copilot reviewed 88 out of 98 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
webpack.config.js |
Updates custom webpack config to align with newer @wordpress/scripts and improves empty-script cleanup staging. |
uninstall.php |
Formatting tweak to declare(strict_types) spacing. |
tsconfig.json |
Simplifies TS config to extend a shared base and adjusts include/exclude/paths. |
tsconfig.base.json |
Adds shared TypeScript baseline compiler configuration. |
tests/phpunit/TestCase.php |
Adds a shared PHPUnit base test case for WP tests and PHPUnit 11.5 compatibility. |
tests/phpunit/bootstrap.php |
Adds a PHPUnit bootstrap tailored for WP test environment discovery and plugin activation. |
tests/phpstan/stubs/wordpress-extended.php |
Adds PHPStan stub scaffolding for WP dynamic properties/classes. |
tests/js/tsconfig.json |
Adds TS config for JS test workspace. |
tests/js/setup.ts |
Adds Jest test environment setup and browser/WP globals. |
tests/js/__mocks__/@wordpress/api-fetch.ts |
Adds Jest mock for @wordpress/api-fetch. |
tests/_data/plugins/localhost-helper.php |
Adds a wp-env helper plugin for localhost URL rewriting in Docker-based tests. |
release-please-config.json |
Adds release-please configuration for automated releases/changelog. |
playwright.config.ts |
Adds Playwright config aligned to wp-scripts and test artifact paths. |
phpunit.xml.dist |
Upgrades PHPUnit config/schema and enables modern reporting/caching paths. |
phpstan.neon.dist |
Updates PHPStan baseline configuration (rules, paths, stubs). |
phpcs.xml.dist |
Removes old PHPCS ruleset in favor of new .phpcs.xml.dist. |
package.json |
Updates engines/deps/scripts for new build/lint/test workflows (wp-scripts, Jest, Playwright, tooling). |
oneupdate.php |
Modernizes plugin header/bootstrapping and moves initialization to Main::instance(). |
jest.config.js |
Adds Jest configuration extending wp-scripts with coverage + aliases + setup. |
inc/Modules/Settings/Settings.php |
Minor formatting/readability spacing changes. |
inc/Modules/Settings/Admin.php |
Adds strict_types and aligns file header. |
inc/Modules/Rest/Workflow_Controller.php |
Adds strict_types and performs docblock/format cleanups; minor PHP modernization (??). |
inc/Modules/Rest/S3_Controller.php |
Adds strict_types and minor formatting cleanup. |
inc/Modules/Rest/Governing_Controller.php |
Adds strict_types and docblock/format cleanups. |
inc/Modules/Rest/GH_Pull_Request_Controller.php |
Adds strict_types and docblock/format cleanups. |
inc/Modules/Rest/Basic_Options_Controller.php |
Adds strict_types and docblock/format cleanups. |
inc/Modules/Rest/Abstract_REST_Controller.php |
Minor docblock/format cleanup. |
inc/Modules/Plugin/VIP_Activation.php |
Docblock cleanup. |
inc/Modules/Plugin/Settings.php |
Docblock cleanup. |
inc/Modules/Plugin/S3.php |
Docblock cleanup. |
inc/Modules/Plugin/Cache.php |
Docblock cleanup and improves $hook_extra phpdoc typing. |
inc/Modules/Plugin/Admin.php |
Docblock cleanup. |
inc/Modules/Jobs/Scheduler.php |
Docblock/format cleanup. |
inc/Modules/Core/Rest.php |
Docblock/format cleanup. |
inc/Modules/Core/DB.php |
Adds strict_types and docblock cleanup. |
inc/Modules/Core/Assets.php |
Adds strict_types. |
inc/Contracts/Interfaces/Registrable.php |
Minor formatting cleanup. |
eslint.config.mjs |
Introduces ESLint flat config with WP + TS + Jest + project rules. |
composer.json |
Updates Composer metadata/tooling dependencies and introduces coding standards package. |
blueprint.json |
Adds WP Playground blueprint to demo/install plugin. |
babel.config.js |
Minor formatting change to exported function signature. |
assets/src/js/utils.ts |
Adds dependency-group header comment for lint conventions. |
assets/src/components/SiteTable.tsx |
Formatting + import grouping and minor JSX/layout adjustments. |
assets/src/components/SiteSettings.tsx |
Formatting + import grouping; improves readability of JSX and strings. |
assets/src/components/SiteModal.tsx |
Formatting + import grouping; improves readability and string wrapping. |
assets/src/components/S3Credentials.tsx |
Formatting + import grouping; refactors fetch calls for readability. |
assets/src/components/PluginGrid.js |
Adds headers/import grouping and formatting refactors. |
assets/src/components/PluginCard.js |
Adds headers/import grouping and formatting refactors. |
assets/src/components/icons/View.js |
Formatting refactor for SVG markup readability. |
assets/src/components/icons/Merge.js |
Formatting refactor for SVG markup readability. |
assets/src/components/icons/Close.js |
Formatting refactor for SVG markup readability. |
assets/src/components/GitHubRepoToken.tsx |
Formatting + import grouping; refactors fetch calls for readability. |
assets/src/admin/settings/page.tsx |
Formatting + minor typing cleanup; refactors promise chain formatting. |
assets/src/admin/settings/index.tsx |
Adds dependency-group header comment. |
assets/src/admin/pull-requests/index.js |
Formatting + import grouping; improves readability of UI markup. |
assets/src/admin/onboarding/page.tsx |
Formatting + typing cleanup and import grouping. |
assets/src/admin/onboarding/index.tsx |
Adds dependency-group header comment. |
AGENTS.md |
Adds agent/developer guidance pointers and common wp-env commands. |
actions/oneupdate-pr-creation.yml |
Whitespace/format cleanup in GitHub Action workflow. |
actions/oneupdate-pr-creation-private.yml |
Whitespace/format cleanup in GitHub Action workflow. |
.wp-env.test.json |
Adds dedicated wp-env test configuration. |
.wp-env.json |
Simplifies wp-env config and includes helper plugin in local dev. |
.wp-env.child.json |
Adds child wp-env config variant. |
.stylelintrc.json |
Removes legacy Stylelint config in favor of centralized approach. |
.stylelint.config.js |
Adds Stylelint config file aligned to WP presets. |
.release-please-manifest.json |
Adds release-please manifest for version tracking. |
.prettierrc.js |
Adds Prettier config based on @wordpress/prettier-config with overrides. |
.prettierignore |
Adds Prettier ignore patterns for build/vendor/output artifacts. |
.phpcs.xml.dist |
Adds new PHPCS ruleset aligned to rtcamp/coding-standards-d. |
.lintstagedrc.mjs |
Adds lint-staged configuration for pre-commit formatting/linting. |
.lefthook.yml |
Adds (currently commented) lefthook pre-commit scaffold. |
.gitignore |
Overhauls ignore patterns for dependencies, build output, test artifacts, and tooling files. |
.github/workflows/test.yml |
Removes legacy monolithic “Test” workflow. |
.github/workflows/reusable-wp-playground-pr-preview.yml |
Adds reusable workflow to post WP Playground PR preview links. |
.github/workflows/reusable-phpunit.yml |
Adds reusable PHPUnit workflow (with optional coverage). |
.github/workflows/reusable-phpstan.yml |
Adds reusable PHPStan workflow with caching + cs2pr output. |
.github/workflows/reusable-phpcs.yml |
Adds reusable PHPCS workflow with caching + cs2pr output. |
.github/workflows/reusable-lint-css-js.yml |
Adds reusable CSS/JS lint workflow (ESLint/TS/Stylelint/Prettier). |
.github/workflows/reusable-jest.yml |
Adds reusable Jest workflow with Codecov upload option. |
.github/workflows/reusable-e2e.yml |
Adds reusable Playwright E2E workflow with wp-env:test. |
.github/workflows/reusable-build.yml |
Adds reusable “build plugin zip” workflow used by preview/release pipelines. |
.github/workflows/release.yml |
Migrates release pipeline to release-please + build + upload release asset. |
.github/workflows/README.md |
Documents the new modular workflows and how they relate. |
.github/workflows/pr-title.yml |
Adds PR title validation for Conventional Commits. |
.github/workflows/copilot-setup-steps.yml |
Updates Copilot coding agent setup workflow for modern dependencies/build. |
.github/workflows/ci.yml |
Adds the new top-level CI orchestrator workflow with change detection + reusable jobs. |
.github/PULL_REQUEST_TEMPLATE.md |
Updates PR template, including AI disclosure and checklist improvements. |
.github/dependabot.yml |
Updates dependabot grouping/scheduling and adds GitHub Actions updates grouping. |
.github/.codecov.yml |
Adds Codecov configuration (coverage targets, ignores, path fixes, comments). |
.gitattributes |
Adds export-ignore and linguist attributes for distribution and GitHub language stats. |
.eslintrc.json |
Removes legacy ESLint config in favor of eslint.config.mjs. |
.eslintignore |
Removes legacy ESLint ignore file (handled by flat config ignores). |
Comments suppressed due to low confidence (1)
phpstan.neon.dist:41
- The PHPStan config currently ends with an empty
ignoreErrors:key, which makes the NEON invalid (and will cause PHPStan to fail to parse the config). Also,vendor-prefixed/ (?)andnode_modules (?)look like accidental placeholders and won’t match real paths.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+70
to
73
| // Load the plugin. | ||
| if ( class_exists( '\OneUpdate\Main' ) ) { | ||
| \OneUpdate\Main::instance(); | ||
|
|
||
| //phpcs:ignore PluginCheck.CodeAnalysis.DiscouragedFunctions.load_plugin_textdomainFound -- @todo remove before submitting to .org. | ||
| load_plugin_textdomain( 'oneupdate', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); | ||
| } |
Comment on lines
+163
to
+171
| build-plugin-zip: | ||
| name: Build Plugin Zip | ||
| permissions: | ||
| contents: read | ||
| uses: ./.github/workflows/reusable-build.yml | ||
| with: | ||
| php-version: '8.3' | ||
| artifact-name: oneupdate-pr${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }} | ||
| secrets: inherit |
This was referenced Jul 3, 2026
6 tasks
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.
What
This PR upgrades the repository scaffolding to the latest standards, introduces modular CI/CD workflows, automates dependency and coverage management, and modernizes project documentation and configurations.
Note: This PR exclusively handles Step 1 of the migration runbook. Subsequent runbook steps will be addressed in their own separate PRs.
Why
This update is necessary to align the repository with the latest best practices established by
plugin-skeleton-din oneSearch and replicating same in oneUpdate. By upgrading the repository files and adopting modernized automation, we significantly reduce future migration and maintenance times, enforce consistent code quality, and make the project easier to navigate and contribute to.Related Issue(s):
How
Following Step 1 of the migration runbook, the following implementation details were executed:
inc/andassets/src/) with the latest scaffold and meticulously reapplied plugin-specific configurations (ensuring properOneUpdate/oneupdatenomenclature).ci.yml(for conditional PHP, JS, CSS linting, and testing),pr-title.yml(to enforce Conventional Commits), andcopilot-setup-steps.yml.dependabot.ymlfor streamlined GitHub Actions, Composer, and NPM updates. Added a.codecov.ymlfile to manage coverage reporting..eslintrc.jsonand.eslintignorein favor of the new centralized CI configurations.npm run format,npm run lint:css:fix,npm run lint:js:fix, andnpm run lint:php:fixto address automatically resolvable code smells..gitattributesfile, an updated PR template, and a detailed README specifically for the new GitHub workflows.Testing Instructions
rm -rf package-lock.json composer.lock vendor node_modules.wp-env(e.g.,npm run wp-env:cli -- composer install).npm run formatnpm run lint:cssnpm run lint:jsnpm run lint:phppr-title.ymlenforces the Conventional Commit format.ci.ymljobs are properly triggered and running.Screenshots
N/A - This PR focuses on backend configuration, tooling, and CI/CD workflows.
Additional Info
Important Migration Context: This PR only fulfills Step 1: Upgrade the repo files. While autofixable lints were run, we are not manually remediating underlying code smells in this step. Any failing CI checks caused by pre-existing code smells or adoption of the new tooling are expected for now.
The remaining phases of the runbook will be tackled in separate, dedicated PRs:
Checklist