Repository navigation
Use Utils\make_temp_file() only on translation cache hits - #190
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-authored-by: schlessera <83631+schlessera@users.noreply.github.com>
Utils\make_temp_file() only on translation cache hits
There was a problem hiding this comment.
🟢 Approval recommended
The changes are covered by focused tests and have no unresolved blocking issues.
Pull request overview
Updates language-pack downloads to create temporary files only when copying cached artifacts.
Changes:
- Replaces manual temp-path construction with
make_temp_file(). - Adds Behat coverage for cached language installation.
File summaries
| File | Description |
|---|---|
src/WP_CLI/LanguagePackUpgrader.php |
Defers temp-file creation to cache hits. |
features/language-core.feature |
Verifies cached language installation. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This updates language-pack download temp-path handling to use the WP-CLI temp-file helper and avoid creating unused empty temp files on cache misses. The temp file is now created only when a cached artifact is actually copied.
Download temp file lifecycle
get_temp_dir() . uniqid(...)).\WP_CLI\Utils\make_temp_file( 'wp_', '.' . $ext )beforecopy( $cache_file, $temp ).Behavioral coverage
Using cached file ...).