Skip to content

feat(codereview): validate DEE references and deployment versions - #5

Open
padrinoski wants to merge 4 commits into
mainfrom
feature/53349-dee-references-package-versions
Open

padrinoski wants to merge 4 commits into
mainfrom
feature/53349-dee-references-package-versions

Conversation

@padrinoski

@padrinoski padrinoski commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Adds DEE reference validation and package-version folder checks to cmf-codereview. A DEE that relies on project-level imports can now report a missing deployed import; a new Process Rule or MasterData file under 2.45.99 is flagged when its owning Data manifest declares 2.45.16.

  • Resolve DEE types and extension methods with Roslyn, read compiler defaults from restored Product DLL metadata, and report missing, invalid or unresolved references. Namespace imports and assembly references are evaluated independently.
  • Add --added-files-list to validate added/renamed deployment content against its owning cmfpackage.json, while excluding historical edits and unversioned Services.
  • Deduplicate overlapping scan roots and use existing filtering, configuration, suppression/baseline, severity gates and report formats.
  • Add regression tests, an opt-in tools/DeeCompilerCheck using the actual restored Product compiler, and documentation for the minimal Bash task integration. Consuming pipeline YAML and package publication are outside this change.

Validation

  • dotnet restore cmf-codereview.sln
  • dotnet build cmf-codereview.sln --configuration Release --no-restore: no warnings or errors.
  • dotnet test cmf-codereview.sln --configuration Release --no-build: 319 passed.
  • Actual compiler check against restored Product package 11.2.3: five expected outcomes verified, without executing DEEs.
  • Local customization-project demo produced four new High findings: two missing references and two folder-version mismatches. Demo edits and reports are not included in this PR.

Documented limitations accepted for this scope

  • Product parsing parity is deferred: complete method bodies are analyzed rather than deployed-code marker regions, and accepted C# declaration syntax can differ from Product's regex extraction.
  • Host alsoInclude rules, custom reference paths and keyword configuration are not reproduced; host-supplied assemblies can cause false-positive missing-reference findings.
  • Current defaults handling targets MES/.NET 8. A restored workspace is required; unknown metadata layouts produce validation limitations. This is static analysis, not full deployed-host compilation equivalence.

The implementation and deferred follow-up work are documented in cmf-codereview/docs/pr-validation.md.

@wasdfra wasdfra self-assigned this Nov 6, 2026
@wasdfra
wasdfra self-requested a review November 6, 2026 12:06
@wasdfra wasdfra removed their assignment Nov 6, 2026
var symbol = model.GetSymbolInfo(node).Symbol;
var usedType = symbol as INamedTypeSymbol;
var extension = symbol as IMethodSymbol;
if (usedType?.TypeKind == TypeKind.Error || usedType?.IsAnonymousType == true || usedType?.ContainingNamespace?.IsGlobalNamespace == true) continue;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UsedType is only the namespace and assembly from type symbols and reduced extension methods. An unqualified call brought into scope with using static resolves to a regular IMethodSymbol (ReducedFrom is null), so it is skipped here. That can let a missing UseReference declaration pass unnoticed. Please also inspect the containing type for non-extension member usages, or explicitly detect and validate static imports.

Roslyn to bind type/extension usages and reads the referenced CMF compiler's default namespace and
assembly arrays from metadata. No product assemblies or type initializers are executed.

- `DeeInvalidReference` (High): a declared namespace is known in the available metadata but is

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing showed as it being triggered as medium (attached file as reference)

cm-framework-scan-standard-20261110-155711.md

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This same finding is also a false positive. Sent in private message the scenario

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants