Automattic / Automattic/blocks-engine
Make transform-duration contract failures diagnostic
- Dominant language
- PHP
- Stars
- 14
- Forks
- 2
- Avg merge
- 2h 10m
- Merged PRs (30d)
- 561
Description
## Context
PR [#774](https://github.com/Automattic/blocks-engine/pull/774) has one failed job: [Actions run 30728968900](https://github.com/Automattic/blocks-engine/actions/runs/30728968900), [Composer validate and test job 91445697666](https://github.com/Automattic/blocks-engine/actions/runs/30728968900/job/91445697666). The same run's unrelated [Generic visual parity tools](https://github.com/Automattic/blocks-engine/actions/runs/30728968900/job/91445697677) and [WordPress site plan integration](https://github.com/Automattic/blocks-engine/actions/runs/30728968900/job/91445697699) gates passed.
## Observed failure
The failed job installed PHP 8.1.34 and reported only:
```
FAIL: HTML metrics expose transform duration
Script php tests/contract/run.php handling the test:canonical event returned with error code 1
```
The assertion is `php-transformer/tests/contract/run.php:3649`:
```php
$assert(is_float($result['metrics']['transform_duration_ms'] ?? null), 'HTML metrics expose transform duration');
```
The producer is `php-transformer/src/HtmlToBlocks/HtmlTransformer.php:835`. Both the assertion and producer lines are unchanged from `origin/trunk` (the PR changes exist elsewhere in those files).
At the exact PR head `e39372f7160f6c519d2ebe9891fca1ec4d063993`, the local value is `3.821458` and its type is `float`; local `composer test` passes. The `simple-html` fixture used by this assertion does not exercise the PR's button path.
## Requested diagnostic work
Before changing behavior, make this canonical-contract failure print the observed metric value and type, including `get_debug_type()` and `var_export()` output, so CI failures are actionable. Reproduce under the CI PHP version (8.1.34) and capture the diagnostic result before deciding whether any behavior change is warranted.
## AI assistance disclosure
gpt-5.6-sol using OpenCode prepared this diagnostic report and coordinated the targeted CI rerun. Chris Huber remains responsible for every line and decision.
Contributor guide
Research direction
Start at php-transformer/tests/contract/run.php:3649 and reproduce the canonical contract failure under PHP 8.1.34. Add diagnostic output for the observed metric using get_debug_type() and var_export(), then run the targeted contract test and capture whether the behavior change is still warranted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 82/100