Skip to content

feat: flag Interactivity API usages that WordPress 7.2 removes - #67

Open
aryanjasala wants to merge 3 commits into
feat/coverage-reportfrom
feat/iapi-check
Open

aryanjasala wants to merge 3 commits into
feat/coverage-reportfrom
feat/iapi-check

Conversation

@aryanjasala

@aryanjasala aryanjasala commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

What this PR does

WordPress 7.2 (due 2026-12-09) ships WordPress/gutenberg#84098, which removes three deprecated Interactivity API behaviours: data-wp-ignore, two-hyphen unique IDs (data-wp-watch--x, data-wp-on--click--x) and ! applied to a function. Code that still uses them stops working without an error. This adds a CI job that scans each plugin and theme for them and reports them on the PR, as warnings by default.

Closes

N/A

Changes

  • New ci-check-iapi.yml. Installs @rtcamp/wp-tooling (default ^2) and runs wp-tooling iapi-check --working-dir <dir> --output github from the repository root, so annotations attach to the PR diff. Inputs: fail-on-findings (default false, findings are warnings), ignore-paths, working-dir, wp-tooling-ref, runs-on.

  • New iapi job in wp-ci.yml, in the plugin and theme presets. It scans the whole unit, not only changed files (the code that breaks is usually old), runs when JS, PHP or a workflow changed, is dropped by skip: iapi, fails only with the new iapi-check-fail: true, and is listed in ci-result.

  • Safe before the wp-tooling release. If the installed wp-tooling has no iapi-check command, the step prints a warning and passes, so this can merge before wp-tooling 2.1.0 is published without failing any caller. The exception: a caller that set iapi-check-fail: true gets a failing job instead, since it asked for a failing check (754c95b).

  • Example, README row.

  • iapi-ignore-paths in wp-ci.yml (754c95b), forwarded to the job's ignore-paths, so a caller of wp-ci.yml can leave a file such as a block's deprecated.js out of the scan without skipping the whole check. It is separate from ignore-paths, which filters detect-changes.

How I verified

$ actionlint .github/workflows/*.yml examples/*.yml
$ bin/check-workflows.sh
Workflow/example contract check passed.
$ pipx run yamllint .   # only the existing warning on main
  • validate-inputs: skip: 'iapi, a11y' on a theme drops both jobs; iapi is accepted as a known id.
  • The CLI from the wp-tooling branch on its fixture project: annotation paths are repo-relative (node-packages/wp-tooling/tests/ci/fixtures/...), --soft-fail turns every finding into a ::warning and exits 0, without it the run exits 1; findings, errors and warnings step outputs and the summary table are written.
  • On real code: ICIMOD has no findings.

Acceptance criteria

Runtime behavior

  • Findings show as PR annotations and a summary table
  • Warnings by default; iapi-check-fail: true fails the job
  • An older wp-tooling without the command warns and passes, or fails when iapi-check-fail is set (checked 2026-11-06 against the published 2.0.0: iapi-check --help exits 2, the step prints the warning and exits 0)
  • Seen on a real PR once wp-tooling 2.1.0 is out

Code quality

  • Lint: zero errors
  • Static analysis: zero errors
  • Tests pass (the CLI's own suite lives in wp-tooling)

Housekeeping

  • No CHANGELOG.md edit: release-please writes it from the PR title
  • examples/<workflow>.yml added or updated to match any input change
  • yamllint, actionlint and bin/check-workflows.sh pass locally

Reviewer notes

  • Publish wp-tooling 2.1.0 (feat(iapi-check): flag Interactivity API usages that WordPress 7.2 removes wp-tooling#91) before the release that carries this moves v1. Until then the job does nothing for callers and adds a warning to each JS or PHP pull request.

  • Default-on, warn-only is the call to check. Every plugin and theme caller gets a new job and, where it applies, warnings, without opting in. Failing by default would break callers on their next run; off by default would mean nobody sees it before December 9.

  • package-manager-cache: false on the setup-node step, as fix(ci): stop setup-node 7 caching in steps that install no dependencies #62 adds to the other steps that install nothing. On main's setup-node 4.1.0 it only logs an "Unexpected input" warning; it matters once Dependabot feat(deps): bump actions/setup-node from 4.1.0 to 7.1.0 #54 (setup-node 7) lands.

  • A block that keeps the old names on purpose in a deprecated.js (so stored blocks still validate) is reported too. ignore-paths on the leaf, or iapi-ignore-paths on wp-ci.yml, handles it for now; an inline ignore comment in the CLI would be nicer and is not built.

ci-check-iapi.yml runs @rtcamp/wp-tooling's iapi-check over the
project and annotates each usage of an Interactivity API that
WordPress 7.2 removes. wp-ci.yml runs it as the iapi job when JS, PHP
or workflow files change, soft-fail unless iapi-check-fail is true, and
ci-result counts it.

The check ships in @rtcamp/wp-tooling 2.1.0. With an older wp-tooling
the step warns that the command is missing and passes, so callers on
the default ^2 install get the scan as soon as 2.1.0 is on npm.
wp-ci.yml gains an iapi-ignore-paths input, forwarded to the iapi job's
ignore-paths, so a block that keeps an old directive in deprecated.js on
purpose can leave that file out without skipping the whole check. It is
separate from ignore-paths, which filters detect-changes.

When the installed wp-tooling has no iapi-check command, the job still
warns and passes, unless the caller set iapi-check-fail: then it fails,
since the caller asked for a failing check.
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.

1 participant