Notification channels and their delivery history replace webhook subscriptions in storage, and existing subscriptions and permissions migrate #151
Labels
No labels
agent
api-regen
agent
architect
agent
coder
agent
console-coder
agent
docs-writer
agent
mechanic
agent
protocol-coder
agent
storage-coder
area/api
area/ci
area/console
area/dhcp
area/dns
area/docs
area/packaging
area/process
area/storage
area/windows
kind
bug
kind
chore
kind
docs
kind
epic
kind
feature
kind
performance
kind
security
kind
test
priority
high
priority
low
priority
medium
resolution
duplicate
resolution
not-a-bug
resolution
wontfix
status
blocked
status
in-progress
status
needs-decision
status
needs-design
status
ready
theme
ad-samba-dns
theme
alternatives-benchmark
theme
console-toolchain
theme
later
theme
parity-devices
theme
parity-query
theme
post-release-fixes
theme
tracker-setup
theme
valkey
theme
windows-installer
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
Depends on
#152 The notification delivery settings, their variables and route, the retry-sweep service and the health check carry notification names, with no aliases
lantea-one/ninlil
Reference
lantea-one/ninlil#151
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
#149 fixes the model. The upgrade must keep every webhook subscription working with its id and delivery history, on all five engines, and an older build must refuse the upgraded database.
What changes
src/dotnet/src/Ninlil.Dns.Common/Enum/: newNotificationChannelKindEnum(Webhook = 0,Email = 1,[EnumMember]strings). RenameWebhookDeliveryAttemptStatusEnumtoNotificationDeliveryStatusEnum; the stored strings do not change.src/dotnet/src/Ninlil.Dns.Data.Abstractions/Entity/:NotificationChannelEntityandNotificationDeliveryEntityreplaceWebhookSubscriptionEntityandWebhookDeliveryAttemptEntity, with the fields listed in #149. Repository interfacesINotificationChannelRepository(the methods ofIWebhookSubscriptionRepositoryplus an optionalKindfilter onSearchAsync/CountAsync) andINotificationDeliveryRepository(the methods ofIWebhookDeliveryAttemptRepository, renamed).Ninlil.Dns.Data.EntityFrameworkCore/Configuration/: tablesNinlilDnsNotificationChannelsandNinlilDnsNotificationDeliveries. Keep the indexes and the UTC-ticks conversions ofWebhookDeliveryAttemptConfiguration.cs:31-78; give the composite index an explicit name of at most 64 characters (MySQL).KindandChannelKindare strings of at most 32;EmailRecipientsusesJsonStringListValueConverterlikeEventTypeNames(WebhookSubscriptionConfiguration.cs:31-33).file-scoped-namespaces.sh:AddNotificationChannels, generated while the model holds both the old and the new entities. Add toUp:INSERT ... SELECTcopying every subscription into the channels table (sameId,Kind = 'Webhook') and every attempt into the deliveries table (SubscriptionIdtoChannelId,SubscriptionNametoChannelName,PayloadJsontoPayload,ChannelKind = 'Webhook');UPDATEofClaimValueinNinlilDnsRoleClaimsandNinlilDnsUserClaims:webhooks:read/webhooks:writetonotifications:read/notifications:write, andwebhookdeliverysettings:read/webhookdeliverysettings:writetonotificationdeliverysettings:read/notificationdeliverysettings:write.Downreverses the claim updates.RemoveWebhookSubscriptions, generated after the old entities are deleted. Add toDown: copy theWebhookchannels and their deliveries back into the recreated tables.NinlilDnsNotificationChannelsandNinlilDnsNotificationDeliveriesinNinlilDnsMongoContext(replacing lines 273-280), class maps inMongoClassMapRegistrar.cs:95-96, repositories,MongoIndexCatalog.cs:258-277. New stepNotificationChannelsReplaceWebhookSubscriptionsinMongoSchemaSteps.Knownwith a backfill (shaped likeDnsClientAddressLegacyBackfill) that upserts each old document by_idinto the new collection with the renamed fields andKind: "Webhook", renames the four claim values in the user and role claim collections, then drops the old collections. Upserts by_idmake a rerun after a crash safe.WebhookDeliveryService,NotificationDeliveryRetrySweepService,NotificationDeliverySubscriber,WebhookDeliveryHealthCheck.cs,WebhooksController.cs(acts only onWebhookrows until #156 removes it), DI registrations in both storage extensions,NinlilDnsContextDbSets, andBackupEntityCatalog.cs:103-105(entry nameNotificationChannels; the exclusion note at line 35 names the deliveries entity). The[RequirePermission]strings ofWebhooksControllerbecomenotifications:read/notifications:writeand those ofWebhookDeliverySettingsController(:49,:68) becomenotificationdeliverysettings:read/notificationdeliverysettings:write, so the renamed claims keep granting access. Existing tests are renamed and updated, includingPermissionsEndpointTests.cs:72.nav-item.model.ts, so a non-admin user loses those menu entries between this issue and #158; the wildcard admin role (PermissionAuthorizationHandler.cs:20) is unaffected. All of PN-14 to #158 ship in one milestone.Acceptance
src/dotnet/tests/Ninlil.Dns.Data.Integration.Tests/Migrations/, a new base class shaped likeWebhookAttemptMigrationTestsBase(migrate to the migration beforeAddNotificationChannels, insert a subscription, an attempt and role claimswebhooks:writeandwebhookdeliverysettings:readwith raw SQL, migrate to the end) assertsNotificationChannelEntitywith the sameId,Kind == Webhookand the sameTargetUrl, one delivery withChannelIdequal to thatId, and the claim valuesnotifications:writeandnotificationdeliverysettings:read. One subclass per relational engine; non-SQLite ones carry[Trait("Category", "RequiresDocker")].Emailchannel with two recipients.dotnet build Ninlil.slnx -p:NinlilSkipAngularBuild=truereports 0 warnings.dotnet test src/dotnet/tests/Ninlil.Dns.Data.Integration.Tests,dotnet test src/dotnet/tests/Ninlil.Dns.Server.Notifications.Tests,dotnet test src/dotnet/tests/Ninlil.Dns.Server.Backup.Tests,dotnet test src/dotnet/tests/Ninlil.Web.Tests, then the whole solution (Ninlil.Dns.Commonchanged).Source
audit-feature-parity.md§2A #12; AGENTS.md "Storage".Owner decision 2026-10-31: "ONE UNIFIED notification-channel entity (replaces webhook subscriptions)" (Q-PN-7).
Owner decision 2026-10-31, round 2 (R2-RENAME): the delivery settings permissions move to notification names too.