-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Summary
Currently, AUR security scans are limited to processing only the first package when multiple packages are selected. Add support for scanning multiple packages sequentially rather than all at once, which would be useful for users who want to scan packages one by one to avoid overwhelming system resources.
Files to modify
src/events/modals/scan.rs(around line 238)src/state/modal.rs(potentially extend PreflightExec to track multi-package progress)
Expected behavior
When multiple AUR packages are selected for scanning:
- Create scan items for all packages, not just the first one
- Process packages sequentially through the PreflightExec modal
- Show progress indication for multi-package scans (e.g., "Package 2 of 5")
- Display individual results for each scanned package
- Allow users to see results of completed scans while subsequent packages are being processed
- Provide clear indication when all packages have been scanned
Implementation approach
-
Modify scan initiation:
- Instead of creating only one scan item, create scan items for all packages
- Add package index tracking to show "Package X of Y" progress
-
Update PreflightExec modal:
- Extend to handle sequential processing of multiple scan items
- Add progress tracking across packages
- Show individual results for each completed scan
-
Sequential execution:
- Process one package at a time to avoid resource contention
- Queue subsequent packages after the current one completes
- Maintain scan results for all packages
-
UI enhancements:
- Display progress indicator ("Scanning package 2 of 5: firefox")
- Show results summary for completed packages
- Allow navigation between individual package results
Testing
-
cargo checkpasses -
cargo clippy --all-targets --all-features -- -D warningspasses -
cargo test -- --test-threads=1passes - Test scanning single package (existing behavior unchanged)
- Test scanning multiple packages sequentially
- Test progress indication shows correct package numbers
- Test results display for each individual package
- Test error handling when individual scans fail
- Test resource usage doesn't spike with multiple packages
- Test cancellation works properly during multi-package scans
Additional context
Current implementation only scans the first package and logs a warning for additional packages:
// Handle each package sequentially (for now, just first package)
// TODO: Add support for sequential multi-package scans
let first_pkg = &names[0];The PreflightExec modal already supports multiple items via the items: Vec<PackageItem> field, so the infrastructure is in place. The key changes needed are:
- Create scan items for all packages instead of just the first
- Implement sequential processing logic in the scan handler
- Add progress tracking and result aggregation
- Update UI to show multi-package progress
This enhancement would significantly improve the user experience for bulk package scanning while maintaining resource efficiency through sequential processing.