Split single-solution validation into SolutionValidator - #76
Merged
TomProkop merged 2 commits intoAug 19, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Extracts single-solution checks into SolutionValidator while retaining workspace-wide validation in WorkspaceValidator.
Changes:
- Adds standalone solution validation and shared file scanning.
- Moves relationship and cross-solution checks to workspace scope.
- Adds TXM005 and multi-solution validation tests.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/TALXIS.Platform.Metadata.Validation/SolutionValidator.cs |
Implements single-solution validation. |
src/TALXIS.Platform.Metadata.Validation/WorkspaceValidator.cs |
Composes solution and workspace-wide checks. |
src/TALXIS.Platform.Metadata.Validation/WorkspaceFiles.cs |
Centralizes file enumeration rules. |
src/TALXIS.Platform.Metadata.Validation/ValidationDiagnostics.cs |
Adds TXM005. |
tests/TALXIS.Platform.Metadata.Tests/SolutionValidatorTests.cs |
Tests the new validator. |
tests/TALXIS.Platform.Metadata.Tests/WorkspaceValidatorTests.cs |
Tests multi-solution behavior. |
Suppressed comments (2)
src/TALXIS.Platform.Metadata.Validation/WorkspaceValidator.cs:122
- Each relationship validator still receives one solution model; only a set of column names is workspace-wide. If a relationship is in solution A and its entity exists only in solution B,
RelationshipValidator.ValidateColumnExistsreturns immediately because the entity is absent from A, so existence/type checks are skipped; conversely, B can report its lookup as orphaned because A's relationships are invisible. This defeats the cross-solution case that motivated moving this pass. Validate against a combined entity/relationship context (or pass workspace-wide entity and relationship indexes).
results.AddRange(SolutionValidator.WithStage(
new RelationshipValidator().Validate(solution, workspaceColumns), ValidationStage.Relationship));
src/TALXIS.Platform.Metadata.Validation/WorkspaceValidator.cs:129
- This catch handles exceptions thrown by relationship validation after the workspace has already loaded, so reporting “Failed to load workspace into model” misidentifies the failed operation and stage. Report a relationship-validation failure at the Relationship stage instead.
catch (Exception ex)
{
results.Add(new ValidationResult(
ValidationSeverity.Error,
$"Failed to load workspace into model: {ex.Message}",
root, null, null) { Stage = ValidationStage.ModelLoad });
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+31
to
+34
| var solutionRoots = DiscoverSolutionRoots(workspacePath); | ||
| var workspaceIsSingleRoot = solutionRoots.Count == 0; | ||
| if (workspaceIsSingleRoot) | ||
| solutionRoots = new[] { workspacePath }; |
zekelinAlex
deleted the
users/alexander.zekelin/solution-validator-split
branch
September 9, 2026 08:07
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.
Pulls the single-solution rules out of WorkspaceValidator into a standalone SolutionValidator, so a build pipeline can call one method on one solution folder instead of wiring validators individually. WorkspaceValidator now composes it per discovered solution and keeps the cross-solution parts for itself: the global GUID scan, files outside any solution root, and the relationship rules, which moved to workspace scope since a relationship and the entity it references may ship in different solutions. There's also a ValidateRelationships method for running just that pass on a multi-solution workspace.
CLI output stays as it was, with two small deltas: a solution that fails to load no longer aborts model validation of its siblings, and finding order shifted slightly. A missing Other/Solution.xml now reports as TXM005.