From 40cc5dfe63feaae097d4191167130264a11d3648 Mon Sep 17 00:00:00 2001 From: Jacob Smith Date: Fri, 8 May 2026 09:42:12 -0700 Subject: [PATCH 001/111] WIP add AI generation log context --- .../BackgroundJobs/AIGenerationLogScope.cs | 28 +++++++++++++++++++ .../GenerateApplicationAnalysisJob.cs | 9 ++++++ .../GenerateApplicationScoringJob.cs | 9 ++++++ .../GenerateAttachmentSummaryJob.cs | 9 ++++++ .../RunApplicationAIPipelineJob.cs | 9 ++++++ 5 files changed, 64 insertions(+) create mode 100644 applications/Unity.GrantManager/src/Unity.GrantManager.Application/GrantApplications/Automation/BackgroundJobs/AIGenerationLogScope.cs diff --git a/applications/Unity.GrantManager/src/Unity.GrantManager.Application/GrantApplications/Automation/BackgroundJobs/AIGenerationLogScope.cs b/applications/Unity.GrantManager/src/Unity.GrantManager.Application/GrantApplications/Automation/BackgroundJobs/AIGenerationLogScope.cs new file mode 100644 index 0000000000..e5c3f5a97f --- /dev/null +++ b/applications/Unity.GrantManager/src/Unity.GrantManager.Application/GrantApplications/Automation/BackgroundJobs/AIGenerationLogScope.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using Microsoft.Extensions.Logging; + +namespace Unity.GrantManager.GrantApplications.Automation.BackgroundJobs; + +internal static class AIGenerationLogScope +{ + public static IDisposable? Begin( + ILogger logger, + string operationType, + Guid applicationId, + Guid? tenantId, + string requestKey, + string? promptVersion, + Guid? requestedByUserId) + { + return logger.BeginScope(new Dictionary + { + ["AIOperationType"] = operationType, + ["AIApplicationId"] = applicationId, + ["AITenantId"] = tenantId, + ["AIGenerationRequestKey"] = requestKey, + ["AIPromptVersion"] = promptVersion, + ["AIRequestedByUserId"] = requestedByUserId + }); + } +} diff --git a/applications/Unity.GrantManager/src/Unity.GrantManager.Application/GrantApplications/Automation/BackgroundJobs/GenerateApplicationAnalysisJob.cs b/applications/Unity.GrantManager/src/Unity.GrantManager.Application/GrantApplications/Automation/BackgroundJobs/GenerateApplicationAnalysisJob.cs index 35d3f554c5..e072da2f02 100644 --- a/applications/Unity.GrantManager/src/Unity.GrantManager.Application/GrantApplications/Automation/BackgroundJobs/GenerateApplicationAnalysisJob.cs +++ b/applications/Unity.GrantManager/src/Unity.GrantManager.Application/GrantApplications/Automation/BackgroundJobs/GenerateApplicationAnalysisJob.cs @@ -22,6 +22,15 @@ public class GenerateApplicationAnalysisJob( { public override async Task ExecuteAsync(GenerateApplicationAnalysisBackgroundJobArgs args) { + using var logScope = AIGenerationLogScope.Begin( + logger, + AIGenerationRequestKeyHelper.ApplicationAnalysisOperationType, + args.ApplicationId, + args.TenantId, + args.RequestKey, + args.PromptVersion, + args.RequestedByUserId); + using (currentTenant.Change(args.TenantId)) { await AIGenerationRequestJobHelper.MarkRunningInNewUowAsync(unitOfWorkManager, generationRequestRepository, args.RequestKey); diff --git a/applications/Unity.GrantManager/src/Unity.GrantManager.Application/GrantApplications/Automation/BackgroundJobs/GenerateApplicationScoringJob.cs b/applications/Unity.GrantManager/src/Unity.GrantManager.Application/GrantApplications/Automation/BackgroundJobs/GenerateApplicationScoringJob.cs index 2292324a5e..8a1393ea19 100644 --- a/applications/Unity.GrantManager/src/Unity.GrantManager.Application/GrantApplications/Automation/BackgroundJobs/GenerateApplicationScoringJob.cs +++ b/applications/Unity.GrantManager/src/Unity.GrantManager.Application/GrantApplications/Automation/BackgroundJobs/GenerateApplicationScoringJob.cs @@ -24,6 +24,15 @@ public class GenerateApplicationScoringJob( { public override async Task ExecuteAsync(GenerateApplicationScoringBackgroundJobArgs args) { + using var logScope = AIGenerationLogScope.Begin( + logger, + AIGenerationRequestKeyHelper.ApplicationScoringOperationType, + args.ApplicationId, + args.TenantId, + args.RequestKey, + args.PromptVersion, + args.RequestedByUserId); + using (currentTenant.Change(args.TenantId)) { await AIGenerationRequestJobHelper.MarkRunningInNewUowAsync(unitOfWorkManager, generationRequestRepository, args.RequestKey); diff --git a/applications/Unity.GrantManager/src/Unity.GrantManager.Application/GrantApplications/Automation/BackgroundJobs/GenerateAttachmentSummaryJob.cs b/applications/Unity.GrantManager/src/Unity.GrantManager.Application/GrantApplications/Automation/BackgroundJobs/GenerateAttachmentSummaryJob.cs index 63507cd588..91b17e38a2 100644 --- a/applications/Unity.GrantManager/src/Unity.GrantManager.Application/GrantApplications/Automation/BackgroundJobs/GenerateAttachmentSummaryJob.cs +++ b/applications/Unity.GrantManager/src/Unity.GrantManager.Application/GrantApplications/Automation/BackgroundJobs/GenerateAttachmentSummaryJob.cs @@ -22,6 +22,15 @@ public class GenerateAttachmentSummaryJob( { public override async Task ExecuteAsync(GenerateAttachmentSummaryBackgroundJobArgs args) { + using var logScope = AIGenerationLogScope.Begin( + logger, + AIGenerationRequestKeyHelper.AttachmentSummaryOperationType, + args.ApplicationId, + args.TenantId, + args.RequestKey, + args.PromptVersion, + args.RequestedByUserId); + using (currentTenant.Change(args.TenantId)) { await AIGenerationRequestJobHelper.MarkRunningInNewUowAsync(unitOfWorkManager, generationRequestRepository, args.RequestKey); diff --git a/applications/Unity.GrantManager/src/Unity.GrantManager.Application/GrantApplications/Automation/BackgroundJobs/RunApplicationAIPipelineJob.cs b/applications/Unity.GrantManager/src/Unity.GrantManager.Application/GrantApplications/Automation/BackgroundJobs/RunApplicationAIPipelineJob.cs index 2a46fc3530..20c4c1cc3a 100644 --- a/applications/Unity.GrantManager/src/Unity.GrantManager.Application/GrantApplications/Automation/BackgroundJobs/RunApplicationAIPipelineJob.cs +++ b/applications/Unity.GrantManager/src/Unity.GrantManager.Application/GrantApplications/Automation/BackgroundJobs/RunApplicationAIPipelineJob.cs @@ -33,6 +33,15 @@ public class RunApplicationAIPipelineJob( { public override async Task ExecuteAsync(RunApplicationAIPipelineJobArgs args) { + using var logScope = AIGenerationLogScope.Begin( + logger, + AIGenerationRequestKeyHelper.PipelineOperationType, + args.ApplicationId, + args.TenantId, + args.RequestKey, + args.PromptVersion, + args.RequestedByUserId); + if (string.IsNullOrWhiteSpace(args.RequestKey)) { throw new ArgumentException("RequestKey is required.", nameof(args)); From 0ae0f3d2ce9d8f907ec508bfd68eed8efc69c8e8 Mon Sep 17 00:00:00 2001 From: aurelio-aot Date: Sat, 30 May 2026 15:37:58 -0700 Subject: [PATCH 002/111] AB#32531: Fix Styling of Email Attachments Table and Button --- .../Views/Shared/Components/EmailsWidget/Default.cshtml | 2 +- .../Views/Shared/Components/EmailsWidget/Default.css | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/applications/Unity.GrantManager/src/Unity.GrantManager.Web/Views/Shared/Components/EmailsWidget/Default.cshtml b/applications/Unity.GrantManager/src/Unity.GrantManager.Web/Views/Shared/Components/EmailsWidget/Default.cshtml index 3cd452a9c6..3762c96b59 100644 --- a/applications/Unity.GrantManager/src/Unity.GrantManager.Web/Views/Shared/Components/EmailsWidget/Default.cshtml +++ b/applications/Unity.GrantManager/src/Unity.GrantManager.Web/Views/Shared/Components/EmailsWidget/Default.cshtml @@ -120,7 +120,7 @@