Quick exceptions#2529
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a faster recurring-meeting exception collection path for Get-CalendarDiagnosticObjectsSummary.ps1 by parsing AppointmentRecurrenceBlob to identify exception dates up-front, plus related improvements to exports/timeline and Subject-search behavior.
Changes:
- Add
-FastExceptions/-AllExceptionsand implement blob-based exception-date discovery with legacy fallback. - Improve Subject-search flow to optionally collect exceptions when exactly one
MeetingIDis resolved. - Adjust Enhanced/Raw export behavior (sorting, deduping, additional run/exception telemetry) and update timeline exception handling.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/Calendar/Get-CalendarDiagnosticObjectsSummary.md | Documents the new fast exception-collection mode and updated Subject-search caveats. |
| Calendar/Get-CalendarDiagnosticObjectsSummary.ps1 | Adds new parameters, state tracking, and wires in the new exception-collection helper module. |
| Calendar/CalLogHelpers/ExceptionCollectionFunctions.ps1 | New helper implementing fast exception-date parsing and exception-log collection (plus dedupe/merge helpers). |
| Calendar/CalLogHelpers/Invoke-GetCalLogs.ps1 | Adds per-exception-date override support and updates Subject-search to conditionally collect exceptions. |
| Calendar/CalLogHelpers/ExportToExcelFunctions.ps1 | Updates Enhanced/Raw/Timeline Excel export behavior and adds collection telemetry. |
| Calendar/CalLogHelpers/CalLogCSVFunctions.ps1 | Adds exception-type helpers, improved sorting utilities, dedupe integration, and organizer identity mapping. |
| Calendar/CalLogHelpers/TimelineFunctions.ps1 | Uses new exception-type helper and adds timeline ordering validation. |
| Calendar/CalLogHelpers/CreateTimelineRow.ps1 | Broadens exception matching to Exception* and uses the new exception-log helper. |
| Calendar/CalLogHelpers/CalLogExportFunctions.ps1 | Exports Enhanced output from $script:EnhancedCalLogs rather than a local projection. |
| Calendar/CalLogHelpers/FindChangedPropFunctions.ps1 | Refines “meaningful change” checks and suppresses organizer “changes” when identity representations differ. |
Comments suppressed due to low confidence (1)
Calendar/CalLogHelpers/ExportToExcelFunctions.ps1:449
GetExcelParamsno longer sets-Append, and the call sites useExport-Excel -Path $FileName ...without-Append/-ExcelPackage. With multiple identities (or when adding tabs later), this will overwrite the existing workbook instead of adding/updating worksheets. AddAppend = $true(and keepClearSheetif you want to replace an existing sheet) or refactor to reuse a single-ExcelPackagefor the whole export.
return @{
Path = $path
FreezeTopRow = $true
# BoldTopRow = $true
Verbose = $false
TableStyle = $TableStyle
WorksheetName = $tabName
TableName = $tabName
FreezeTopRowFirstColumn = $true
AutoFilter = $true
ClearSheet = $true
Title = "Enhanced Calendar Logs for $Identity" + $TitleExtra + " for MeetingID [$($script:GCDO[0].CleanGlobalObjectId)]."
TitleSize = 14
ConditionalText = $ConditionalFormatting
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot apply changes based on the comments in this thread |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| $script:GCDO = RemoveDuplicateCalendarDiagnosticObjects -CalLogs $script:GCDO | ||
| $rawNullCount = @($script:GCDO).Count - @($script:GCDO | Where-Object { $null -ne $_ }).Count | ||
| if ($rawNullCount -gt 0) { | ||
| Write-Host -ForegroundColor Yellow "Removed [$rawNullCount] null raw calendar log row(s) before processing." | ||
| } | ||
| $script:GCDO = @($script:GCDO | Where-Object { $null -ne $_ }) |
There was a problem hiding this comment.
BuildCSV calls RemoveDuplicateCalendarDiagnosticObjects on $script:GCDO before creating the RAW export. That helper currently sorts the returned logs by LogTimestamp, which changes the original collection order. This conflicts with the later intent/comments that RAW output should remain in collected order; consider de-duping while preserving original order (no sort) and only sorting the Enhanced projection.
| $script:GCDO = RemoveDuplicateCalendarDiagnosticObjects -CalLogs $script:GCDO | |
| $rawNullCount = @($script:GCDO).Count - @($script:GCDO | Where-Object { $null -ne $_ }).Count | |
| if ($rawNullCount -gt 0) { | |
| Write-Host -ForegroundColor Yellow "Removed [$rawNullCount] null raw calendar log row(s) before processing." | |
| } | |
| $script:GCDO = @($script:GCDO | Where-Object { $null -ne $_ }) | |
| # De-duplicate while preserving the original collection order for RAW output. | |
| $rawNullCount = @($script:GCDO).Count - @($script:GCDO | Where-Object { $null -ne $_ }).Count | |
| if ($rawNullCount -gt 0) { | |
| Write-Host -ForegroundColor Yellow "Removed [$rawNullCount] null raw calendar log row(s) before processing." | |
| } | |
| $dedupedCalLogs = New-Object 'System.Collections.Generic.List[object]' | |
| $seenCalLogKeys = New-Object 'System.Collections.Generic.HashSet[string]' | |
| foreach ($calLog in @($script:GCDO | Where-Object { $null -ne $_ })) { | |
| $calLogKey = $calLog | ConvertTo-Json -Compress -Depth 10 | |
| if ($seenCalLogKeys.Add($calLogKey)) { | |
| [void]$dedupedCalLogs.Add($calLog) | |
| } | |
| } | |
| $script:GCDO = @($dedupedCalLogs) |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…erve RAW order in BuildCSV dedup Agent-Logs-Url: https://github.com/microsoft/CSS-Exchange/sessions/a475f1cd-4da3-4c2b-866d-22353ec0a42a Co-authored-by: Shanefe <6235087+Shanefe@users.noreply.github.com>
Applied all feedback from the review thread in commit 6741d8f:
|
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collection CalLogs Exceptions used to use a N matrix with the number of logs.
New functionality is for N x number of dates, much quicker.
Other minor fixes.
Getting the dates requires cracking the Recurrence blob, which is in the new file.