Skip to main content

CI/CD Pipeline Quality Gates and Release Checks

ACF quality becomes scalable only when schema and hook checks run automatically in every release pipeline.

Learning Focus

You will design CI/CD gates that validate acf-json, run hook tests, and enforce smoke checks before and after deployment.

Concept Overview

CI/CD quality gates for ACF should validate three layers: schema integrity, behavior integrity, and release integrity. Schema integrity checks JSON syntax and expected field artifacts. Behavior integrity runs hook tests. Release integrity confirms critical editor and frontend workflows after deploy.

Core Idea

Ship ACF changes only when schema, hook behavior, and smoke checks all pass in the same pipeline.

Why It Matters

Manual release checks cannot keep pace with frequent field and hook changes in multi-developer teams.

ApproachWhat HappensBusiness Impact
Enforce automated pipeline gatesRegressions are caught before publish impactHigher release confidence
Rely on ad-hoc release verificationImportant checks are skipped under time pressureIncreased outage probability
Define rollback trigger thresholdsIncident response is fast and consistentReduced downtime window

Reference Table

TermMeaningWhere You Use ItFast Check
Schema GateAutomated check validating ACF JSON structure and expected filesCI pull-request stageInvalid or missing schema artifacts fail the build
Hook Test GateAutomated test job for ACF filters/actionsCI test stageAll critical hook tests must pass
Smoke CheckFast post-deploy verification of top workflowsStaging and production deploy jobsChecklist reports pass/fail status with timestamps
Rollback TriggerDefined condition requiring rollbackRelease operations playbookTrigger thresholds are documented and actionable

Practical Use Cases

Use Case 1: GitHub Actions pipeline for ACF schema and hook tests

A distributed team needs consistent quality gates across every pull request.

  1. Add a schema job that validates all acf-json/*.json files parse correctly.
  2. Add a test job that runs hook-focused PHPUnit suites.
  3. Block merge when any schema or hook gate fails.
  4. Publish artifact logs for failed checks to speed triage.
CLI Inspection

Validate this state through code and CLI checks: Show PR checks page with separate schema and hook-tests jobs.

.github/workflows/acf-quality.yml
name: acf-quality

on:
pull_request:
push:
branches: [main]

jobs:
schema:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate acf-json files
run: |
python3 - <<'PY'
import json
from pathlib import Path
for f in Path('acf-json').glob('*.json'):
json.loads(f.read_text())
print('acf-json schema files valid')
PY

hook-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run hook test suite
run: vendor/bin/phpunit --testsuite=acf-hooks
Expected output
acf-json schema files valid
OK (24 tests, 98 assertions)

Use Case 2: Post-deploy smoke gate with rollback threshold

Production releases must verify key edit flows and critical pages within 15 minutes.

  1. Run smoke script after deployment against one representative record per critical field group.
  2. Check admin save flow and frontend render response for each sample.
  3. Trigger rollback automatically when two or more critical checks fail.
  4. Notify release owner and content lead with failed checkpoint details.
CLI Inspection

Validate this state through code and CLI checks: Capture release dashboard showing smoke status and rollback decision.

scripts/acf-smoke-check.sh
#!/usr/bin/env bash
set -euo pipefail

echo "Checking critical page render"
curl -fsS "https://docs.example-site.com/landing/enterprise-onboarding" >/dev/null

echo "Checking API payload"
curl -fsS "https://docs.example-site.com/wp-json/wp/v2/pages/1204" >/dev/null

echo "ACF smoke checks passed"
Expected output
Checking critical page render
Checking API payload
ACF smoke checks passed

Common Mistakes

MistakeWhat HappensBetter Approach
Running CI checks without fixture seedingTests pass in CI but fail in staging realitySeed representative fixtures before hook tests
Treating smoke checks as optionalBroken flows reach editors and visitorsMake smoke failures block production promotion
No rollback trigger criteriaTeams debate during active incidentsDefine objective rollback thresholds in advance

Best Practices

  1. Keep CI gates fast enough to run on every pull request without developer bypasses.
  2. Separate schema validation and hook behavior tests for clearer failure triage.
  3. Use environment-specific smoke check targets and sample records.
  4. Store rollback triggers and owners in versioned release documentation.
  5. Review gate effectiveness monthly using incident and near-miss data.

Hands-On Practice

  1. Add one schema-validation gate for acf-json files in your CI pipeline.
  2. Configure one hook test suite gate and fail merge on test errors.
  3. Write a post-deploy smoke checklist with explicit rollback thresholds.

What's Next