Files
prautoblogger/.github/workflows/ci.yml
peptiderepo 0bac82be52 fix: array_merge P0 + restore check-constants self-test P1 (v0.22.0)
P0: replace `+` array union with array_merge() in
Settings_Fields_Extended::get_fields(). PHP `+` keeps left-side keys
when both arrays are integer-indexed — silently drops all 11 image fields
(indexes 0–10 collide with indexes 0–10 of the local array). array_merge()
is already the operator used by the parent class at class-settings-fields.php:84.

P1: restore `php scripts/check-constants.php --self-test` step in the
check-constants CI job. Step was present in v0.21.0 and accidentally dropped
in the CI rewrite. Script logic is intact; CI now exercises it again.

Also adds SettingsFieldsExtendedTest (3 assertions) as a regression guard:
cardinality (29 = 18 local + 11 image), presence check, and per-field
id/section contract. If a + union ever re-appears, test_get_fields_returns_29_fields
fails with a message naming the root cause.

Agent-Session: engineer-infra-prab-p0fix-20260616
2026-06-16 14:38:46 +00:00

54 lines
1.9 KiB
YAML

##
# CI caller — PRAutoBlogger
#
# Thin caller that delegates to the reusable estate CI workflow in peptide-e2e.
# workflow_call is required so deploy.yml can gate on this workflow via
# `uses: ./.github/workflows/ci.yml` (the workflow_call trigger enables that).
#
# Permissions: contents: write is required at the caller level so the reusable
# workflow's phpcbf auto-commit job can push fixes back to the PR branch.
# (GitHub enforces that callers cannot be escalated beyond their declared scope.)
#
# tests: brain-monkey — no WP install or DB required; Brain Monkey mocking only.
# line_limit_paths: includes — estate hard 300-line rule applied to includes/.
##
name: CI
on:
pull_request: {}
push:
branches: [main]
workflow_call: {}
permissions:
contents: write
jobs:
ci:
uses: peptiderepo/peptide-e2e/.github/workflows/ci.yml@main
with:
tests: brain-monkey
secrets: inherit
check-constants:
name: Check PRAUTOBLOGGER_* constants
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PHP 8.1
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: none
- name: Check PRAUTOBLOGGER_* constants
# Fails if any PRAUTOBLOGGER_* constant referenced in the shipped
# plugin PHP is neither defined in prautoblogger.php nor guarded
# by defined() at the reference site. Prevents the v0.19.0 incident
# class (constant deleted from bootstrap, test fallback masks the gap).
run: php scripts/check-constants.php
- name: Self-test check-constants scanner
# Verifies the scanner itself can detect the failure cases it was
# designed to catch. If the scanner regresses, this step fails CI.
# Added v0.21.0; restored in v0.22.0 (was accidentally dropped in rewrite).
run: php scripts/check-constants.php --self-test