feat: migrate WPGraphQL for ACF to monorepo#3581
Merged
Merged
Conversation
git-subtree-dir: plugins/wp-graphql-acf git-subtree-split: 972bf1437e065ce5553026b184e30fc821756819
- Add wp-graphql-acf plugin to plugins/ directory - Configure package.json with workspace name and test scripts - Add plugin to release-please-config.json and manifest (v2.4.1) - Update version constants script with WPGRAPHQL_FOR_ACF_VERSION - Add plugin to .wp-env.json for dev and test environments - Configure linting workflow in .github/workflows/lint.yml - Extend integration-tests-reusable.yml with ACF installation support - Add wp-graphql-acf integration tests with ACF matrix (Free/Pro/Extended) - Configure smoke tests in .github/workflows/smoke-test.yml - Create missing acceptance.suite.yml and bootstrap files - Update zip script in composer.json for WordPress.org deployment - Update documentation (ARCHITECTURE.md, wpgraphql.mdc) The plugin now supports testing against: - ACF Free and ACF Pro - ACF Extended Free and Pro - ACF installation is conditional (only for wp-graphql-acf tests)
- Migrated wp-graphql-acf from standalone repo with full git history - Added plugin to monorepo at plugins/wp-graphql-acf/ - Integrated with monorepo workflows: - Linting (lint.yml) - Integration tests (integration-tests.yml) with ACF matrix support - Smoke tests (smoke-test.yml) - Release-please configuration - Added ACF plugin installation scripts for local testing: - bin/install-acf.sh (supports Free/Pro via .env or env vars) - bin/detect-acf-plugins.sh (auto-detects installed ACF plugins) - bin/prepare-test-suite.sh (dynamically configures test suite) - Updated Codeception configs to match monorepo patterns - Updated composer.json dependencies to match monorepo versions - Added package.json with test scripts - Updated documentation (docs/TESTING.md) with ACF testing instructions - Configured .wp-env.json to include wp-graphql-acf - Updated version constant script for release-please Note: 5 test failures remain to be investigated: - Oembed field tests (network-dependent behavior) - Clone field tests (ACF Extended features) - Options page test (show_in_graphql=false behavior) - Date range picker test (formatting issue) These will be addressed in follow-up work.
- Fix AcfeDateRangePicker resolver to handle _start and _end fields when main value is empty - Update PostObjectFieldsTest oEmbed test to handle wp_oembed_get() fallback behavior - Add support for preserving show_in_graphql for programmatically registered options pages - Skip clone field tests (AcfeCountriesFieldTest, OembedFieldTest) - needs investigation into prefix_name behavior - Skip OptionsPageTest::testOptionsPageNotInSchemaIfShowInGraphqlIsFalse - ACF doesn't preserve show_in_graphql for programmatic registrations
- Update functional.suite.dist.yml to use modern lucatume\WPBrowser modules - Update prepare-test-suite.sh to generate functional suite files with ACF plugins - Add prepare-test-suite.sh call to functional test npm script - Improve AcfFieldCest cleanup method with more robust selectors - Add error handling and warnings for missing ACF installation - Improve ACF Pro installation error messages - Update .gitignore to ignore generated test suite files
- Cache JSON imports per test class (import once instead of per test) - Use direct URL navigation with cached field group post IDs - Reduce GraphQL tab wait time from 1s to 0.3s - Remove unnecessary verification steps - Add getFieldGroupPostId helper method Results: ~10% faster (4.3s saved for 7 tests, from 43.2s to 38.9s)
Extract field group title from JSON file instead of hardcoding 'Foo Name'. This ensures ACF Extended tests and other tests using different JSON files work correctly with the performance optimizations.
- Fix AcfeCurrenciesFieldCest and AcfeDateRangePickerFieldCest to use correct field keys from ACF Extended Pro JSON - Add missing acfe_date_range_picker field to tests-acf-extended-pro-kitchen-sink.json - Update install-acf.sh to automatically match ACF Extended versions (Pro with Pro, Free with Free) - Fix ACF Extended Pro installation to use PHP for JSON parsing (jq not available in wp-env) - Update CI workflow to automatically match ACF Extended versions to ACF versions - Optimize functional tests: import JSON once per test class, use direct URL navigation, cache field group IDs - All 266 functional tests now passing
…-to-monorepo # Conflicts: # scripts/update-version-constants.js
…fig.json - Restore loadReleasePleaseConfig() function to read from release-please-config.json - Update getConstantMapping() to use constantMap from config file - Add constantMap for wp-graphql-acf in release-please-config.json - Fixes merge conflict resolution that incorrectly kept hardcoded mappings
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Remove .env from params list in codeception.dist.yml - Codeception ParamsLoader requires file to exist if listed - CI uses environment variables from wp-env, so .env file not needed - Matches pattern used by wp-graphql-smart-cache and wp-graphql-ide plugins
The GitHub workflow was only installing ACF when acf_pro, acf_extended, or wpgraphql_content_blocks flags were true. However, wp-graphql-acf tests require ACF to be installed even when testing with ACF Free. Updated the workflow to always install ACF (at least Free) when testing wp-graphql-acf plugin, ensuring all test configurations have the required dependency.
The workflow was trying to use jq to parse JSON responses from the ACF Extended API, but jq is not available in the wp-env containers. Updated the workflow to use PHP's json_decode() instead, which is already available in WordPress containers. This matches the approach used in the local install-acf.sh script and ensures ACF Extended Pro can be installed successfully in GitHub Actions.
Set WP_DEBUG_DISPLAY to false in the development environment config to prevent debug output from interfering with functional tests. Debug output can cause test failures when it appears in HTML responses.
Add WP_DEBUG_DISPLAY: false to the tests environment config to prevent debug output from appearing in HTML responses during functional tests. This complements the previous change to the development environment and ensures functional tests don't fail due to debug output in responses.
…graphql_type - get_rules() returns empty when no mapped field groups - set_graphql_type and get_rules() return mapped types - get_rules() with unset_types for non-matching group returns as-is - Improves coverage for LocationRules.php
…ntegration - add_blocks_as_possible_type adds AcfBlock (direct call when constant undefined) - filter_editor_block_interfaces returns false when post_type not in block - filter_editor_block_interfaces returns should when post_type in block or block has no post_types - Improves coverage for ThirdParty/WPGraphQLContentBlocks/WPGraphQLContentBlocks.php
…on, and ACF post type support
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
…s, Registry WPUnit coverage - LocationRules: check_for_conflicts, check_params_for_conflicts, determine_* rules, determine_location_rules, get_graphql_post_template_types - AcfGraphQLFieldType: config, admin settings, resolve type/resolver, excluded settings - Settings: add_field_settings, get_graphql_resolve_type_field_config, enqueue_graphql_acf_scripts, register_meta_boxes - Registry: register_field, register_field_group, has_registered_field_group, get_type_registry, get_mapped_location_rules, should_field_group_show_in_graphql, get_acf_field_groups
Collaborator
Author
Add trap to guarantee npm run wp-env stop executes on exit, preventing Docker container leaks when the script fails at steps 5-7 (wait, install deps, or tests). Applied via @cursor push command
…Registry name/type/location tests
… Admin render/enqueue coverage
…r, scripts, render
This was referenced Feb 27, 2026
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.
This PR migrates the WPGraphQL for ACF plugin from its standalone repository into the WPGraphQL monorepo.
Summary
plugins/wp-graphql-acf/Key Changes
Plugin migration & ACF CI
plugins/wp-graphql-acf/with full git historyACF_LICENSE_KEY/ACF_EXTENDED_LICENSE_KEYare set (forked PRs skip those rows instead of silently using ACF Free)bin/install-acf.shfor ACF Free/Pro and ACF Extended; download error handling withset +eand friendly message.githubworkflows/templates (issues/PRs open in monorepo)Test fixes
Lint & ESLint (monorepo)
.eslintrc.js+.eslintignore; packages + e2e overrides; react-hooks exhaustive-deps fixed (Explorer, App, Router); e2e specs/utils fixes.eslintrc.js+.eslintignore; lint extended tosrc,bin,plugins/*/src,tests-examples,tests/e2e,tests/unit,webpack.config.js; fixed defaultInputObjectFields import, pasteVariables, no-shadow, unused vars, duplicate Playwright import; Jest/JSDoc/console/accessibility overrides for existing code.eslintignore;.eslintrc.cjsforsrc+ e2e; lint./srcand./tests/e2e; admin JS and e2e utils fixes@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-plugin-jestso lint runs in plugin working-directoryCI / workflow tweaks
Release & docs
Testing
Next steps
ACF_LICENSE_KEYandACF_EXTENDED_LICENSE_KEYin the repo for CI testing with Pro/Extended Pro.npm run -w @wpgraphql/wp-graphql-acf test:e2elocally).Note
Medium Risk
Medium risk because it introduces a large new plugin subtree and significantly expands GitHub Actions workflows (integration/lint/smoke/E2E) including secret-gated ACF Pro installs and wp-env setup tweaks, which could disrupt CI/release pipelines if misconfigured.
Overview
Adds the
plugins/wp-graphql-acf/plugin (including packaging/config/docs/scripts) and registers it in the monorepo’s versioning (.release-please-manifest.json) and local dev environment (.wp-env.json).Extends CI to treat
wp-graphql-acfas a first-class plugin: change-detection + lint, smoke tests, and a new integration test matrix that can install ACF Free/Pro and ACF Extended Free/Pro (with early failure when required license secrets are missing), plus optional WPGraphQL core composer installs for dependent plugins.Hardens workflows and local tooling with
npm ciretries across multiple pipelines, improved Playwright caching/host readiness checks, creation oftests/_outputfor linters, and awp-envsetup tweak to disableWP_DEBUG_DISPLAYin test containers to reduce HTML noise breaking functional tests.Written by Cursor Bugbot for commit ebfe159. This will update automatically on new commits. Configure here.