Repository navigation
Tie an '@' profile name and a non-text address to the right configuration field (O02) - #329
Merged
siebe41 merged 2 commits intoOct 23, 2026
Conversation
The profile path came from the first quoted text in the validator's message, which is '@', not the name. And Type.GetType("System.Uri") returns null because Uri is not in CoreLib, so a bad BaseAddress got the generic hint.
This was referenced Oct 21, 2026
siebe41
commented
Oct 22, 2026
siebe41
left a comment
Owner
Author
There was a problem hiding this comment.
Looks right. Both fixes are correct and their tests go through the real validator and Locate, so they would fail on the old code (the PR says it checked that; the test shapes agree). Two small points.
- Low: the
'case left in "Not done" is a one-line fix.ConfigurationIssues.cs:131-135takes the last'…'match, so a name containing an apostrophe (it's@home) yieldsProfiles.it. The validator's message always ends in('<name>').(SemanticRouterOptions.cs:234). Anchoring to that, e.g.\('(?<name>.*)'\)\.$, gets the whole name whatever it contains, and the "last match" rule isn't needed. - nit: whitespace-only names. The validator also rejects whitespace-only names (
IsNullOrWhiteSpace,SemanticRouterOptions.cs:232), and those still giveProfiles.<spaces>, while the comment atConfigurationIssues.cs:133says an empty name has no field of its own. A whitespace-only key does exist in the dictionary, so pointing at it is defensible. Either make the comment say "empty" on purpose, or usestring.IsNullOrWhiteSpaceto send both toProfiles.
Checked: the Uri lookup. Type.GetType("System.Uri") without an assembly name searches only the calling assembly and CoreLib, and typeof(Uri).Assembly (System.Private.Uri) is the same assembly on all three OSes, so the typeof(Uri) case at :325 can now match. The CHANGELOG line is under Unreleased → Fixed. Nothing here is path-, process- or shell-specific.
…O02-config-issue-paths
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.
What changed
Two fixes in
ConfigurationIssues, the dashboard code that ties a configuration problem to the field it's about. The coverage tests in #328 found both. This PR is stacked on #328 because the regression tests go in the test file that PR adds to.@pointed at the wrong field. The validator's message isProfile names must not be empty or contain '@' ('work@home').The path came from the first quoted text, which is'@', so the problem was tied toProfiles.@, a profile that doesn't exist. The name is now taken from the last quoted text, sowork@homegivesProfiles.work@home. An empty name (('')) givesProfiles, because an empty name has no field of its own."BaseAddress": 5, the problem should say5 is not an address; use one like http://localhost:1234. It saidis not valid hereinstead. The type named in the JSON error (System.Uri) was resolved withType.GetType(name), and without an assembly name that only looks in the calling assembly and CoreLib.Urilives inSystem.Private.Uri, so the lookup returned null and theUricase never matched. The lookup now also triestypeof(Uri).Assembly.Regression tests in
ConfigurationIssuesTests:A_bad_profile_name_points_at_that_profile_not_at_the_quoted_at_sign(both the@and the empty name), and a newBaseAddressrow inA_value_that_does_not_fit_its_field_says_the_format_it_needs. CHANGELOG has a line under Unreleased → Fixed.Why
Overflow task O02 of the usage sprint says behaviour changes found while adding coverage go in separate PRs. Both bugs leave the dashboard's configuration editor pointing at the wrong field, or at no field, for a problem the validator reports correctly.
How it was verified
A_bad_profile_name_points_at_that_profile_not_at_the_quoted_at_signand theBaseAddressrow ofA_value_that_does_not_fit_its_field_says_the_format_it_needs. With it:dotnet test -c Release --filter FullyQualifiedName~ConfigurationIssuesTestsgave 15/15.dotnet build -c Release: 0 warnings, 0 errors.dotnet test -c Release: 1,564 / 1,564 passed.dotnet format --verify-no-changes: clean.dotnet pack -c Release src/SemanticRouter.AspNetCore: no warnings, package validation passes (only internal code changed).Linux and macOS: neither fix touches paths, processes or shells.
Uriis inSystem.Private.Urion every platform the runtime supports, sotypeof(Uri).Assemblyis the right assembly on all three.Not done
'in it. With one (it's@home), the last match is a fragment of the name. That only affects which field gets highlighted, so I left it.Refs: usage-sprint overflow task O02 (no issue), stacked on #328.