Skip to content

feat(shallow-scan): track and display Failed DL Count in UI and reports - #189

Merged
NityamPareek merged 1 commit into
files-shallow-scanfrom
feat/shallow-scan-failed-dl-tracking
Sep 23, 2026
Merged

NityamPareek merged 1 commit into
files-shallow-scanfrom
feat/shallow-scan-failed-dl-tracking

Conversation

@NityamPareek

Copy link
Copy Markdown
Collaborator

Summary

Tracks failed Document Libraries (Failed DL Count) per site and at the tenant level during Shallow Scan when SharePoint REST StorageMetrics or ItemCount API calls fail, and surfaces those counts across the UI, reports, and CSV report upload flow. Also wraps long stat card titles across two lines on the final dashboard to provide better visual spacing.

Key Changes

  1. Per-Site & Tenant-Wide Failed DL Tracking (estimators/files_shallow/shallow_file_estimator.py):
    • Initialize "failedDlCount": 0 at the tenant level (_initialize_metrics_structure) and per site (_prepare_root_sites).
    • Increment metrics["siteMetrics"][top_level_site_id]["failedDlCount"] in _record_failure inside _scan_document_libraries when a DL fails (PermissionError / Exception), while keeping "dlCount" as the total discovered DLs.
    • Populate metrics["failedDlCount"] in _finalize_tenant_totals.
  2. Final Dashboard UI, Reports & CSV Upload Recalculate ETA (ui/files_ui.py):
    • Final Dashboard (show_results_content): Display a "Failed Document\nLibrary Count" stat card right next to "Document\nLibrary Count" in Shallow Scan mode, and wrap multi-word card titles (Folder count beyond\ndepth limit 100, File count beyond\ndepth limit 100, Large Resource Count\n(Entities with >500k items), Warning Resource Count\n(Entities with >200k items), Site Collection\nCount) onto two lines so all cards fit with comfortable spacing.
    • site_report_<ts>.csv (execute_migration_scan): Add "Failed DL Count" immediately after "DL Count" for each site row in Shallow Scan mode and include Failed DLs in the summary log output.
    • Exported Full Report (export_current_report): Include ("Failed DL Count", ...) in Summary Metrics and "Failed DL Count" right after "DL Count" in Site Details when in Shallow Scan mode.
    • CSV Report Upload (_validate_csv & _try_get_metrics_from_csv_report): Support Shallow Scan site_report.csv uploads both with the new "Failed DL Count" column and without it (backward-compatible).
  3. Unit Tests (tests/files/shallow_estimator_test.py):
    • Added test_failed_dl_count_tracked_per_site_and_tenant_level and test_shallow_scan_site_report_csv_upload_with_failed_dl_count.
@NityamPareek
NityamPareek merged commit f66811c into files-shallow-scan Sep 23, 2026
1 check passed
@NityamPareek
NityamPareek deleted the feat/shallow-scan-failed-dl-tracking branch September 23, 2026 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant