feat(boost_usage): resolve missing headers via catalog lookup (138)#140
feat(boost_usage): resolve missing headers via catalog lookup (138)#140snowfox1003 wants to merge 1 commit intocppalliance:developfrom
Conversation
📝 WalkthroughWalkthroughImplements a workflow for resolving missing Boost header placeholders through admin actions and service layer functions. Adds header catalog lookup with disambiguation, placeholder deletion logic, auto-resolution workflows, and batch processing with dry-run support. Integrates resolution into management command execution and admin interface. Changes
Sequence Diagram(s)sequenceDiagram
actor Admin as Admin User
participant AdminUI as Admin Interface
participant Services as Service Layer
participant DB as Database
Admin->>AdminUI: Select tmp records & click<br/>resolve_selected_if_in_catalog
AdminUI->>Services: resolve_missing_header_tmp_auto(tmp)<br/>[for each selected]
loop For each BoostMissingHeaderTmp
Services->>DB: Query BoostFile via<br/>find_boost_file_for_header_name
DB-->>Services: BoostFile or None/ambiguous
alt Found BoostFile
Services->>DB: Create/update BoostUsage
Services->>DB: Delete BoostMissingHeaderTmp
Services->>DB: Maybe delete placeholder usage
Services-->>AdminUI: "resolved"
else Ambiguous or Not Found
Services-->>AdminUI: "skipped_ambiguous"<br/>or "skipped_no_match"
end
end
AdminUI->>Admin: Display aggregated<br/>resolution counts
Estimated code review effort🎯 4 (Complex) | ⏱️ ~70 minutes Possibly related issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
boost_usage_tracker/post_process.py (1)
45-47: Docstring mentions "suffix fallback" but implementation uses exact matching only.The docstring says "unresolved paths are then handled by suffix fallback," but
find_boost_file_for_header_name_detailedexplicitly avoids substring/endswithmatching (per the service layer comment at lines 245-247 inservices.py). Consider updating the docstring to reflect the actual behavior:📝 Suggested docstring fix
"""Resolve a set of Boost include paths to BoostFile instances in one pass. Returns a dict ``{header_path: BoostFile | None}``. Deduplicates the - incoming paths and performs one bulk exact-match query on - ``include/<header_path>`` first; unresolved paths are then handled by - suffix fallback. + incoming paths and performs one bulk exact-match query on + ``include/<header_path>`` first; unresolved paths are then checked + individually (still exact-match only, no suffix fallback). """🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@boost_usage_tracker/post_process.py` around lines 45 - 47, The docstring for find_boost_file_for_header_name_detailed incorrectly claims that unresolved paths are handled by a "suffix fallback"; update the docstring to accurately describe the actual behavior (it performs only exact matches against "include/<header_path>" and does not perform substring/endswith matching per the service-layer restriction referenced in services.py), removing any mention of suffix fallback and clarifying that unmatched headers are not resolved via substring matching.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@boost_usage_tracker/post_process.py`:
- Around line 45-47: The docstring for find_boost_file_for_header_name_detailed
incorrectly claims that unresolved paths are handled by a "suffix fallback";
update the docstring to accurately describe the actual behavior (it performs
only exact matches against "include/<header_path>" and does not perform
substring/endswith matching per the service-layer restriction referenced in
services.py), removing any mention of suffix fallback and clarifying that
unmatched headers are not resolved via substring matching.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: e5c35fc0-4922-48a3-af77-7a0ef0b48200
📒 Files selected for processing (8)
boost_usage_tracker/admin.pyboost_usage_tracker/management/commands/run_boost_usage_tracker.pyboost_usage_tracker/post_process.pyboost_usage_tracker/services.pyboost_usage_tracker/tests/test_services.pydocs/service_api/boost_usage_tracker.mdgithub_activity_tracker/admin.pygithub_activity_tracker/models.py
batch before monitor_content in run_boost_usage_tracker
Summary by CodeRabbit
Release Notes
New Features
Documentation