Skip to content

chore: upgrade repository scaffolding (Step 1)#149

Open
milindmore22 wants to merge 8 commits into
developfrom
migrate/scaffold
Open

chore: upgrade repository scaffolding (Step 1)#149
milindmore22 wants to merge 8 commits into
developfrom
migrate/scaffold

Conversation

@milindmore22

@milindmore22 milindmore22 commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

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-d in 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:

  • Scaffolding Upgrade: Replaced root project files (excluding inc/ and assets/src/) with the latest scaffold and meticulously reapplied plugin-specific configurations (ensuring proper OneUpdate / oneupdate nomenclature).
  • CI/CD Workflows: Added a comprehensive ci.yml (for conditional PHP, JS, CSS linting, and testing), pr-title.yml (to enforce Conventional Commits), and copilot-setup-steps.yml.
  • Dependency & Coverage Automation: Updated dependabot.yml for streamlined GitHub Actions, Composer, and NPM updates. Added a .codecov.yml file to manage coverage reporting.
  • Linting Cleanup: Removed legacy configurations like .eslintrc.json and .eslintignore in favor of the new centralized CI configurations.
  • Autofixes: Ran npm run format, npm run lint:css:fix, npm run lint:js:fix, and npm run lint:php:fix to address automatically resolvable code smells.
  • Documentation: Added a .gitattributes file, an updated PR template, and a detailed README specifically for the new GitHub workflows.

Testing Instructions

  1. Checkout this branch locally.
  2. Delete outdated dependency directories to prevent conflicts: rm -rf package-lock.json composer.lock vendor node_modules.
  3. Reinstall dependencies locally or via wp-env (e.g., npm run wp-env:cli -- composer install).
  4. Run the local formatting and linting commands to ensure everything passes locally:
  • npm run format
  • npm run lint:css
  • npm run lint:js
  • npm run lint:php
  1. Create a test commit to verify that pr-title.yml enforces the Conventional Commit format.
  2. Verify the GitHub Actions tab to ensure ci.yml jobs 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:

  • Step 2: Remediate Tooling Errors
  • Step 3: Finish repo configurations
  • Step 4: Backfill JS Unit tests
  • Step 5: Convert JS files to TypeScript

Checklist

  • I have read the Contribution Guidelines
  • I have read the [Development Guidelines.
  • My code is tested to the best of my abilities.
  • My code passes all lints (ESLint etc.). (Note: autofixes applied, remaining smells deferred to Step 2)
  • My code has detailed inline documentation.
  • I have updated the project documentation as needed.
Open WordPress Playground Preview

@milindmore22
milindmore22 marked this pull request as ready for review July 3, 2026 11:28
Copilot AI review requested due to automatic review settings July 3, 2026 11:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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/ (?) and node_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 thread oneupdate.php
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 thread .github/workflows/ci.yml
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
@milindmore22 milindmore22 changed the title chore: upgrade repository scaffolding (step 1) chore: upgrade repository scaffolding (Step 1) Jul 7, 2026
@milindmore22
milindmore22 requested a review from justlevine July 7, 2026 09:46
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.

2 participants