Conversation
…ay within 16,000 char limit Agent-Logs-Url: https://github.com/microsoft/fhir-server/sessions/20d0d51f-b8cc-4da8-9995-a01c7b432716 Co-authored-by: LTA-Thinking <17463554+LTA-Thinking@users.noreply.github.com>
…eateAffectedItemBatches Agent-Logs-Url: https://github.com/microsoft/fhir-server/sessions/20d0d51f-b8cc-4da8-9995-a01c7b432716 Co-authored-by: LTA-Thinking <17463554+LTA-Thinking@users.noreply.github.com>
|
|
||
| foreach (var item in items) | ||
| { | ||
| string itemString = $", {(item.included ? "[Include] " : string.Empty)}{item.resourceType}/{item.resourceId}"; |
There was a problem hiding this comment.
@copilot Please remove the comma from the first item added to a batch.
There was a problem hiding this comment.
Done in d145517. The first item in each batch no longer has a leading comma — commas are now only used as separators between items within a batch.
Agent-Logs-Url: https://github.com/microsoft/fhir-server/sessions/5263344e-c535-4e76-b6ea-94c6ffa85136 Co-authored-by: LTA-Thinking <17463554+LTA-Thinking@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5484 +/- ##
==========================================
+ Coverage 76.91% 76.95% +0.04%
==========================================
Files 978 978
Lines 35680 35694 +14
Branches 5356 5359 +3
==========================================
+ Hits 27443 27470 +27
+ Misses 6903 6892 -11
+ Partials 1334 1332 -2 🚀 New features to boost your workflow:
|
|
@LTA-Thinking do we need to do this for Bulk update as well? |
|
@copilot Please change the update service to use the same audit log method as bulk delete. The create audit log method can be moved to a new static class that the update service and delete service can reference. |
…ass; update BulkUpdateService to use batching Agent-Logs-Url: https://github.com/microsoft/fhir-server/sessions/a1a789ae-7398-4de7-89c9-188742ff4760 Co-authored-by: LTA-Thinking <17463554+LTA-Thinking@users.noreply.github.com>
Done in c1d4731. Extracted Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@copilot Please add unit tests for the deletion service that include a test showing the audit logging helper is being called. Also, update the bulk update service's unit tests to add one showing the audit logging helping is being called. |
…vice Agent-Logs-Url: https://github.com/microsoft/fhir-server/sessions/eb92acd7-9bb1-45a0-9e08-1a937fe7e92e Co-authored-by: LTA-Thinking <17463554+LTA-Thinking@users.noreply.github.com>
…rtions Agent-Logs-Url: https://github.com/microsoft/fhir-server/sessions/eb92acd7-9bb1-45a0-9e08-1a937fe7e92e Co-authored-by: LTA-Thinking <17463554+LTA-Thinking@users.noreply.github.com>
Done in dc278bd. Added Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Description
Bulk delete and bulk update audit logs concatenate all affected resource IDs into a single
"Affected Items"string, which can exceed the 16,000 character log limit. This change splits the items into size-bounded batches, emitting multipleLogAuditcalls as needed.BulkOperationAuditLogHelperstatic class inFeatures/Persistence/containing the batching logic and size constantsMaxAuditLogSize(16000) andAuditLogOverheadSize(1000) constantsCreateAffectedItemBatches()splits items into batches where each batch string stays under the limit; items are never split mid-entryDeletionService.CreateAuditLog()to use the shared helperBulkUpdateService.CreateAuditLog()to use the shared helper, replacing the previous unboundedAggregateapproach with size-safe batchingRelated issues
Bug 188287
Testing
Added 8 unit tests in
BulkOperationAuditLogHelperTests.cscovering: empty list, small list (single batch), large list (multi-batch), boundary sizing, include-tag preservation, no leading comma per batch, single oversized item, and no-data-loss across batches.Added integration tests verifying the audit logging helper is invoked by both services:
DeletionServiceAuditLogTests.cs:GivenBulkHardDelete_WhenResourcesAreDeleted_ThenAuditLoggerIsCalledWithBatchedAffectedItems— exercises the fullDeleteMultipleAsynchard-delete flow and asserts_auditLogger.LogAuditis called with"Affected Items"inadditionalProperties.BulkUpdateServiceTests.cs:UpdateMultipleAsync_WhenResultsReturned_ThenAuditLoggerIsCalledWithBatchedAffectedItems— exercises theUpdateMultipleAsyncflow and asserts the same.Both integration tests use a polling pattern (instead of hard-coded delays) to deterministically wait for
Task.Run-based audit logging to complete.FHIR Team Checklist
Semver Change (docs)
Patch