Repository navigation
Split AlertNotebookEndpoint's authored templates into per-family files (#4223) - #4410
Merged
Merged
Conversation
#4223) Pure move: BuildBlockingCells/BuildDeadlockCells and their template-version constants move into AlertNotebookEndpoint.Templates.Blocking.cs and AlertNotebookEndpoint.Templates.Deadlocks.cs. The core file becomes a partial class and its metric-name if-chain becomes one sorted registration table. No behaviour change; verified byte-identical output before/after. Refs #4223.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #4223.
Why
AlertNotebookEndpointheld every authored notebook template (Blocking, Deadlocks) in one 842-line file, with a metric-name if-chain choosing between them. Splitting each family into its own file, and turning the if-chain into a single sorted registration table, means future template families can be built in parallel, each touching only its own file plus one new line in the table.What changes
AlertNotebookEndpoint.cs(core):internal static classbecomesinternal static partial class. The metric-name if-chain inAuthoredTemplateis replaced by astatic readonlyarrays_authoredTemplatesof(string[] Metrics, AuthoredTemplateEntry Entry), one row per family, sorted case-insensitively by each row's first metric name.AuthoredTemplatenow looks up the table instead of branching. Madeinternal(wasprivate) so a test pin can check the table directly.AlertNotebookEndpoint.Templates.Blocking.cs:BlockingTemplateVersionandBuildBlockingCells, moved verbatim.AlertNotebookEndpoint.Templates.Deadlocks.cs:DeadlocksTemplateVersionandBuildDeadlockCells, moved verbatim.HeaderCell,StatusCell,ReadCell,AuthoredReadCell,TimelinePanel,RankedPanel, etc.) stay in the core file, since both families use them.No behaviour change. Line endings (CRLF) and file header match the original.
Test plan
diffbetween the two captures reports no differences.AlertNotebookAuthoredTemplateTests.cs):RegistrationTable_EveryFamilyResolvesAndValidateswalks every row ofs_authoredTemplates, checks every metric name resolves to a non-null entry with a unique id, and runs each entry's built cells throughDarlingWebEndpoints.ValidateNotebookDefinition.RegistrationTable_IsSortedByFirstMetricNamepins the table's sort order.s_authoredTemplatesdoesn't exist there, so this is a compile failure againstorigin/dev, not a runtime failure.Darling.Tests.dll,Microsoft.WindowsDesktop.Appremoved from its runtimeconfig for this run only):AlertNotebookAuthoredTemplateTests,AlertNotebookEndpointTests,DocCommentHygieneTests. All 126 tests pass, 0 failed.Darling.Tests.csprojandLite.Tests.csprojboth build 0 errors with-p:EnableWindowsTargeting=true. Neither test project runs live PostgreSQL classes (no live-DB pins touched by this change).CHANGELOG entry
None: a structural move with no behaviour change.