Overview
NuGet.SupportRequests.Notifications is a .NET Framework 4.7.2 console executable that runs as a scheduled backend job within the NuGet Gallery infrastructure. Its sole responsibility is to read open and recently-closed support tickets from the Gallery’s SQL-based support-request database, build HTML email reports, and route them to the appropriate recipients through the shared NuGet.Services.Messaging Service Bus pipeline.
Two distinct notification types are supported:
- OnCall Daily Summary — sent each day to the on-call engineer, listing all currently unresolved issues with their assigned admin and status.
- Weekly Summary — sent once a week to a configured distribution address, comparing last week’s issue counts, closure rates, SLA metrics, and top request reasons against the prior week.
Role in System
Support Operations
Keeps on-call engineers and support leads informed about ticket volume and SLA trends without requiring manual database queries.
Email Pipeline
Produces email messages as Service Bus messages consumed by the
EmailPublisher job, keeping email dispatch decoupled from report generation.Jobs Infrastructure
Extends
JsonConfigurationJob from NuGet.Jobs.Common, inheriting standard argument parsing, DI container setup, SQL connection management, and Application Insights telemetry.Support Request DB
Queries the
[dbo].[Issues], [dbo].[History], and [dbo].[Admins] tables in the Gallery support-request SQL database. No ORM is used — all queries are raw ADO.NET via SqlCommand.Key Files and Classes
Dependencies
NuGet Packages (direct, via NuGet.Jobs.Common)
Internal Project References
Notable Patterns and Implementation Details
Task dispatch by reflection.
ScheduledTaskFactory resolves the concrete task class entirely at runtime using Type.GetType($"NuGet.SupportRequests.Notifications.Tasks.{taskName}") and Activator.CreateInstance. Adding a new task requires no factory changes — only a new class in the Tasks namespace implementing IScheduledTask with the three-argument constructor (InitializationConfiguration, Func<Task<SqlConnection>>, ILoggerFactory).Embedded resource templates with CSS inlining. HTML email templates (
OnCallSummary.html, WeeklySummary.html) and the shared EmailStyles.css are all compiled as embedded resources. NotificationTemplateProvider inlines the CSS into each HTML template on first load and caches the result statically for the process lifetime. Placeholder substitution is done via simple string.Replace on named tokens defined in HtmlPlaceholders.