Studio: Filter out deprecated warnings from fatal errors#3018
Studio: Filter out deprecated warnings from fatal errors#3018katinthehatsite merged 7 commits intotrunkfrom
Conversation
📊 Performance Test ResultsComparing 9dec3c2 vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
fredrikekelund
left a comment
There was a problem hiding this comment.
We now have two importer/exporter implementations: one in apps/cli and another in apps/studio.
In apps/cli, we only throw if WP-CLI returned a non-zero exit code, which I believe is the correct way to handle errors there.
I say let's do the same thing here.
Checking now 👀 |
|
@fredrikekelund the issue should now be addressed, let me know if you have any further comments. |
fredrikekelund
left a comment
There was a problem hiding this comment.
LGTM 👍 I'd probably make the equivalent change in apps/studio/src/lib/import-export/export/exporters/default-exporter.ts, too. Full-site exports already work when I test it with a PHP 8.5 site, but this change would ensure correctness.
Should now be done 👍 |
…dio into fix/pushing-site-with-8.5
* Filter out deprecated warnings from fatal errors * Ensure our error filtering approach is consistent with CLI * Apply changes to default exporter * Fix unit tests --------- Co-authored-by: Kateryna Kodonenko <kateryna@automattic.com>
Related issues
Related to STU-1529
How AI was used in this PR
It was used to identify the solution after the fix raised in Automattic/wp-cli-sqlite-command#24 uncovered the issue.
Proposed Changes
PHP 8.5 triggers a deprecation notice from
react/promiseinsidewp-cli.phar. Studio treats any stderr output as a fatal export failure, so the notice was causing the export to fail even though the actual export succeeded. This PR ensures that we filter out the deprecation warning from the actual fatal error:This would ideally need to be fixed upstream but I think this fix should be sufficient for now.
Testing Instructions
SynctabPre-merge Checklist