-
-
Notifications
You must be signed in to change notification settings - Fork 362
Add checksum to diagnostics #3775
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughA new diagnostic pipe Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Poem
Pre-merge checks✅ Passed checks (1 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (2)**/*.php📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
{composer.json,**/*.php}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
🧬 Code graph analysis (1)app/Actions/Diagnostics/Pipes/Checks/HashCheck.php (1)
🔇 Additional comments (5)
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (3)
app/Actions/Diagnostics/Pipes/Checks/HashCheck.php (2)
25-37: Stability: exclude ephemeral cache artifacts from the scan (bootstrap/cache).Including bootstrap/cache makes the digest vary with compiled/config caches, reducing utility across environments. Recommend skipping that subdirectory.
- $paths_to_scan = [ + $paths_to_scan = [ app_path(), - base_path('bootstrap'), + // Note: exclude bootstrap/cache to avoid environment‑specific cache artifacts + base_path('bootstrap'), config_path(), base_path('database/migrations'), lang_path(), resource_path(), public_path('build'), base_path('routes'), base_path('version.md'), base_path('composer.json'), base_path('composer.lock'), ];And filter inside collection:
- foreach ($iterator as $file_info) { + foreach ($iterator as $file_info) { if ($file_info instanceof \SplFileInfo && $file_info->isFile()) { - $file_list[] = $file_info->getPathname(); + $path = $file_info->getPathname(); + $rel = $this->normalizePath($path); + if (str_starts_with($rel, 'bootstrap/cache/')) { + continue; + } + $file_list[] = $path; } }
39-47: Nice separation of core vs vendor hashes.Good UX to display “files—vendor” and include counts. Consider appending the algo used in details for clarity when fallbacks occur.
app/Actions/Diagnostics/Errors.php (1)
50-50: Pipeline order: consider running HashCheck later to keep diagnostics responsive.Hashing the entire tree (incl. vendor) can be I/O heavy. Suggest moving HashCheck towards the end or making it opt-in via a feature flag/param to avoid slowing routine diagnostics. The skip-by-shortname mechanism helps, but default order still affects first-run UX.
If you’d like, I can propose a small change to accept a “skip heavy checks” flag and default HashCheck to run only when explicitly requested.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
app/Actions/Diagnostics/Errors.php(2 hunks)app/Actions/Diagnostics/Pipes/Checks/HashCheck.php(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.php
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.php: New PHP files must include the project license header and have a single blank line after the opening <?php tag
Use snake_case for PHP variable names
Always call in_array() with true as the third parameter for strict checking
Only booleans should be used as conditions in if statements (avoid integers/strings)
Use strict comparisons (===, !==) instead of loose comparisons (==, !=)
Avoid duplicating logic in both if and else branches; refactor common code
Do not use empty(); use explicit checks instead
Do not use float/double for money; store amounts as integers in the smallest currency unit (e.g., cents)
Files:
app/Actions/Diagnostics/Pipes/Checks/HashCheck.phpapp/Actions/Diagnostics/Errors.php
{composer.json,**/*.php}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Apply PSR-4: configure autoload in composer.json and ensure PHP namespaces align with directory structure
Files:
app/Actions/Diagnostics/Pipes/Checks/HashCheck.phpapp/Actions/Diagnostics/Errors.php
🧬 Code graph analysis (2)
app/Actions/Diagnostics/Pipes/Checks/HashCheck.php (1)
app/DTO/DiagnosticData.php (1)
DiagnosticData(13-72)
app/Actions/Diagnostics/Errors.php (1)
app/Actions/Diagnostics/Pipes/Checks/HashCheck.php (1)
HashCheck(18-121)
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: 3️⃣ PHP dist / 8.3 - mariadb
- GitHub Check: 3️⃣ PHP dist / 8.3 - postgresql
- GitHub Check: 2️⃣ PHP tests / 8.4 - postgresql -- Install
- GitHub Check: 2️⃣ PHP tests / 8.3 - postgresql -- Feature_v2
- GitHub Check: 2️⃣ PHP tests / 8.3 - postgresql -- Unit
- GitHub Check: 2️⃣ PHP tests / 8.3 - mariadb -- Unit
🔇 Additional comments (2)
app/Actions/Diagnostics/Pipes/Checks/HashCheck.php (1)
1-8: License header and file preamble look good.Header present and single blank line after opening tag. Naming and namespace align with PSR-4.
app/Actions/Diagnostics/Errors.php (1)
23-23: Import is correct and aligned with namespace.No issues.
Codecov Report❌ Patch coverage is 🚀 New features to boost your workflow:
|
So it is easier to diagnose if we are EXACTLY on the same file versions...
We could consider later making it a proper merkle tree.
Summary by CodeRabbit