Skip to content

fix: harden handlers API response#1999

Merged
chubes4 merged 1 commit into
mainfrom
fix-handlers-invalid-json
May 13, 2026
Merged

fix: harden handlers API response#1999
chubes4 merged 1 commit into
mainfrom
fix-handlers-invalid-json

Conversation

@chubes4
Copy link
Copy Markdown
Member

@chubes4 chubes4 commented May 13, 2026

Summary

  • Normalize handler definitions before enriching /datamachine/v1/handlers responses so missing optional keys do not emit PHP notices into REST output.
  • Drop malformed non-array handler registrations from the discovery response instead of letting them contaminate JSON output.
  • Add a smoke regression covering JSON-safe /handlers output with incomplete and malformed handler registrations.

Fixes #1959.

Testing

  • homeboy lint --path /Users/chubes/Developer/data-machine@fix-handlers-invalid-json --changed-since origin/main
  • homeboy test --path /Users/chubes/Developer/data-machine@fix-handlers-invalid-json --changed-since origin/main
  • php tests/handlers-api-json-safe-smoke.php
  • npm run build

AI assistance

  • AI assistance: Yes
  • Tool(s): OpenCode (GPT-5.5)
  • Used for: Investigated the /handlers invalid JSON evidence, drafted the focused REST response hardening and smoke coverage, and ran local verification. Chris remains responsible for review and merge.

@homeboy-ci
Copy link
Copy Markdown
Contributor

homeboy-ci Bot commented May 13, 2026

Homeboy Results — data-machine

Lint

lint — passed

ℹ️ Full options: homeboy docs commands/lint
Deep dive: homeboy lint data-machine --changed-since e0c4f30

Test

test — passed

ℹ️ Auto-fix lint issues: homeboy refactor data-machine --from lint --write
ℹ️ Collect coverage: homeboy test data-machine --coverage
ℹ️ Pass args to test runner: homeboy test -- [args]
ℹ️ Full options: homeboy docs commands/test
Deep dive: homeboy test data-machine --changed-since e0c4f30

Audit

audit — passed

  • requested_detectors — 5 finding(s)
  • intra-method-duplication — 1 finding(s)
  • Total: 6 finding(s)

Deep dive: homeboy audit data-machine --changed-since e0c4f30

Tooling versions
  • Homeboy CLI: homeboy 0.175.0+638659dd
  • Extension: wordpress from https://github.com/Extra-Chill/homeboy-extensions
  • Extension revision: 83a0f27
  • Action: unknown@unknown

@chubes4 chubes4 merged commit 76caa34 into main May 13, 2026
5 checks passed
@chubes4 chubes4 deleted the fix-handlers-invalid-json branch May 13, 2026 16:23
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.

Investigate invalid JSON response from Pipelines page /handlers request

1 participant