Skip to content

chore: upgrade repository scaffolding (step 1)#148

Closed
milindmore22 wants to merge 8 commits into
rtCamp:developfrom
milindmore22:migrate/scaffold
Closed

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

Conversation

@milindmore22

@milindmore22 milindmore22 commented Jul 2, 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.

@milindmore22 milindmore22 changed the title Migrate/scaffold chore: upgrade repository scaffolding (step 1) Jul 3, 2026
@milindmore22
milindmore22 marked this pull request as ready for review July 3, 2026 06:53
Copilot AI review requested due to automatic review settings July 3, 2026 06:53

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 a repo scaffolding migration, updating build/test tooling and CI/CD workflows to match newer project standards (WordPress scripts, modular reusable workflows, automated release/dependency/coverage plumbing), while keeping functional code changes minimal.

Changes:

  • Introduces modular GitHub Actions CI (lint/test/build/e2e) plus release automation via release-please.
  • Modernizes JS/PHP tooling configs (ESLint flat config, Jest, Playwright, TS config split, PHPCS ruleset, PHPStan/PHPUnit config).
  • Adds/updates local dev + test scaffolding (wp-env variants, PHPUnit bootstrap/TestCase, Jest setup/mocks, test helper plugin).

Reviewed changes

Copilot reviewed 88 out of 98 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
webpack.config.js Updates WP Scripts webpack integration and empty-script cleanup behavior.
uninstall.php Formatting-only strict_types declaration style update.
tsconfig.json Switches to base tsconfig + adjusts compiler options and include/exclude.
tsconfig.base.json Adds shared TypeScript baseline config for the repo.
tests/phpunit/TestCase.php Adds a shared WP_UnitTestCase base with PHPUnit 11.5 compatibility helpers.
tests/phpunit/bootstrap.php Adds PHPUnit bootstrap for wp-phpunit + plugin activation.
tests/phpstan/stubs/wordpress-extended.php Adds WP stubs to improve PHPStan analysis.
tests/js/tsconfig.json Adds TS config for JS tests (extends root tsconfig).
tests/js/setup.ts Adds Jest setup (fetch mock, globals, clipboard mock).
tests/js/mocks/@wordpress/api-fetch.ts Adds a Jest mock for @wordpress/api-fetch.
tests/_data/plugins/localhost-helper.php Adds a dev/test helper MU plugin for localhost URL rewriting in wp-env.
release-please-config.json Adds release-please configuration for automated releases.
playwright.config.ts Adds Playwright config extending WP Scripts defaults and routes artifacts.
phpunit.xml.dist Updates PHPUnit config for newer schema and coverage output paths.
phpstan.neon.dist Reworks PHPStan config structure and adds stub file wiring.
phpcs.xml.dist Removes legacy PHPCS ruleset file (replaced by new one).
package.json Updates scripts/deps for new tooling + WP Scripts workflow.
oneupdate.php Updates plugin header/scaffolding and changes bootstrap/init behavior.
jest.config.js Adds Jest config extending WP Scripts defaults with repo-specific settings.
inc/Modules/Settings/Settings.php Minor formatting adjustment in constants section.
inc/Modules/Settings/Admin.php Adds strict_types declaration near file top.
inc/Modules/Rest/Workflow_Controller.php Adds strict_types + minor PHP 8+ null-coalescing cleanup.
inc/Modules/Rest/S3_Controller.php Adds strict_types declaration near file top.
inc/Modules/Rest/Governing_Controller.php Adds strict_types declaration near file top.
inc/Modules/Rest/GH_Pull_Request_Controller.php Adds strict_types declaration near file top.
inc/Modules/Rest/Basic_Options_Controller.php Adds strict_types declaration near file top.
inc/Modules/Rest/Abstract_REST_Controller.php Minor whitespace/docblock cleanup.
inc/Modules/Plugin/VIP_Activation.php Docblock cleanup (removes redundant @return).
inc/Modules/Plugin/Settings.php Docblock cleanup (removes redundant @return).
inc/Modules/Plugin/S3.php Docblock/whitespace cleanup.
inc/Modules/Plugin/Cache.php Docblock cleanup (removes redundant @return).
inc/Modules/Plugin/Admin.php Docblock cleanup (removes redundant @return).
inc/Modules/Jobs/Scheduler.php Whitespace/docblock cleanup.
inc/Modules/Core/Rest.php Whitespace/docblock cleanup.
inc/Modules/Core/DB.php Adds strict_types declaration near file top.
inc/Modules/Core/Assets.php Adds strict_types declaration near file top.
inc/Contracts/Interfaces/Registrable.php Whitespace/docblock cleanup.
eslint.config.mjs Adds ESLint flat config with WP + TS/Jest overrides.
composer.json Updates Composer metadata, repos, dev tooling deps, and autoload config.
blueprint.json Adds WP Playground blueprint for demo/preview setup.
babel.config.js Minor formatting update to exported function signature.
assets/src/js/utils.ts Adds import grouping comment for external dependency.
assets/src/components/SiteTable.tsx Formatting/refactor for readability and lint compliance.
assets/src/components/SiteSettings.tsx Formatting/refactor for readability and lint compliance.
assets/src/components/SiteModal.tsx Formatting/refactor for readability and lint compliance.
assets/src/components/S3Credentials.tsx Formatting/refactor for readability and lint compliance.
assets/src/components/PluginGrid.js Formatting/refactor for readability and lint compliance.
assets/src/components/PluginCard.js Formatting/refactor for readability and lint compliance.
assets/src/components/icons/View.js JSX formatting for readability/lint compliance.
assets/src/components/icons/Merge.js JSX formatting for readability/lint compliance.
assets/src/components/icons/Close.js JSX formatting for readability/lint compliance.
assets/src/components/GitHubRepoToken.tsx Formatting/refactor for readability and lint compliance.
assets/src/admin/settings/page.tsx Formatting/refactor + minor typing cleanup.
assets/src/admin/settings/index.tsx Adds import grouping comment for external dependency.
assets/src/admin/pull-requests/index.js Formatting/refactor for readability and lint compliance.
assets/src/admin/onboarding/page.tsx Formatting/refactor for readability and lint compliance.
assets/src/admin/onboarding/index.tsx Adds import grouping comment for external dependency.
AGENTS.md Adds agent-facing pointers and common wp-env commands.
actions/oneupdate-pr-creation.yml Whitespace normalization in custom GH Action workflow script.
actions/oneupdate-pr-creation-private.yml Whitespace normalization in custom GH Action workflow script.
.wp-env.test.json Adds dedicated wp-env config for test runs.
.wp-env.json Simplifies/modernizes wp-env config + adds helper plugin.
.wp-env.child.json Adds secondary wp-env instance config.
.stylelintrc.json Removes legacy Stylelint JSON config (replaced by JS config).
.stylelint.config.js Adds Stylelint JS config extending WP defaults.
.release-please-manifest.json Adds release-please manifest for version tracking.
.prettierrc.js Adds Prettier config extending WP preset with overrides.
.prettierignore Adds ignore patterns for build/vendor/test output and lockfiles.
.phpcs.xml.dist Adds new PHPCS ruleset using rtCamp coding standards.
.lintstagedrc.mjs Adds lint-staged configuration for pre-commit autofixes.
.lefthook.yml Adds lefthook config stub (currently commented out).
.gitignore Replaces gitignore with a more complete WordPress/tooling-focused set.
.github/workflows/test.yml Removes legacy monolithic CI workflow.
.github/workflows/reusable-wp-playground-pr-preview.yml Adds reusable workflow for WP Playground PR previews.
.github/workflows/reusable-phpunit.yml Adds reusable PHPUnit workflow (matrix-ready, coverage-aware).
.github/workflows/reusable-phpstan.yml Adds reusable PHPStan workflow with caching and PR annotations.
.github/workflows/reusable-phpcs.yml Adds reusable PHPCS workflow with caching and PR annotations.
.github/workflows/reusable-lint-css-js.yml Adds reusable JS/CSS lint workflow (eslint/stylelint/prettier/tsc).
.github/workflows/reusable-jest.yml Adds reusable Jest workflow with Codecov upload.
.github/workflows/reusable-e2e.yml Adds reusable Playwright E2E workflow.
.github/workflows/reusable-build.yml Adds reusable build workflow producing a plugin zip artifact.
.github/workflows/release.yml Switches to release-please driven release + artifact upload flow.
.github/workflows/README.md Documents the new modular workflow architecture.
.github/workflows/pr-title.yml Adds PR title conventional-commit enforcement workflow.
.github/workflows/copilot-setup-steps.yml Adds/updates Copilot coding agent environment setup workflow.
.github/workflows/ci.yml Adds new modular CI entrypoint workflow that fans out to reusables.
.github/PULL_REQUEST_TEMPLATE.md Updates PR template structure and adds AI disclosure section.
.github/dependabot.yml Updates dependabot grouping and schedules across ecosystems.
.github/.codecov.yml Adds Codecov config for status checks + path fixes.
.gitattributes Adds export-ignore rules for distribution + linguist hints.
.eslintrc.json Removes legacy ESLint config (replaced by flat config).
.eslintignore Removes legacy ESLint ignore file (handled via flat config ignores).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/.codecov.yml Outdated
Comment thread .github/workflows/copilot-setup-steps.yml Outdated
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 inc/Modules/Settings/Admin.php Outdated
Comment thread inc/Modules/Rest/Workflow_Controller.php Outdated
Comment thread inc/Modules/Rest/Governing_Controller.php Outdated
Comment thread inc/Modules/Rest/GH_Pull_Request_Controller.php Outdated
Comment thread inc/Modules/Rest/Basic_Options_Controller.php Outdated
Comment thread inc/Modules/Core/DB.php Outdated
Comment thread inc/Modules/Core/Assets.php Outdated
Copilot AI review requested due to automatic review settings July 3, 2026 10:06
@milindmore22
milindmore22 removed the request for review from Copilot July 3, 2026 10:06
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