Skip to content

Danielaolive/fix sharedmappers packaging bug#10

Merged
DanielaOlive merged 17 commits into
masterfrom
danielaolive/fix-sharedmappers-packaging-bug
Jul 21, 2026
Merged

Danielaolive/fix sharedmappers packaging bug#10
DanielaOlive merged 17 commits into
masterfrom
danielaolive/fix-sharedmappers-packaging-bug

Conversation

@DanielaOlive

Copy link
Copy Markdown
Member

fix double referencing of shared objects

DanielaOlive and others added 8 commits July 15, 2026 16:41
…es internal

Fixes CS0433 compiler errors when consumers reference multiple SDM NuGet
packages simultaneously.

Root causes fixed:
1. DomIds.cs compiled into every package that imported SharedMappers.projitems
2. SharedValidation types compiled into both InfraOpsProperties.Common and
   FacilityManagement.Common as public types

Changes:
- Split SharedMappers/DomIds.cs (5151 lines) into 4 per-module files:
  InfraopsPropertiesDomIds.cs, SlcAsset_ManagementDomIds.cs,
  SlcFacility_ManagementDomIds.cs, SlcPlan_And_BuildDomIds.cs
- Created 5 new .projitems files (one per module DomIds + SharedFacilityMappers)
- Each of the 4 Common projects now imports only its own module's DomIds projitems
- SDM.AssetManagement.Common and SDM.PlanAndBuild.Common now import
  SharedValidation.projitems directly (previously relied on transitive access
  to public types through project-reference chain)
- Made all SharedValidation types internal (21 types across 21 files) except
  ChangeTrackingBase (public base class - CS0060) and ValidationResult (public
  return type of validators)
- ChangeTrackingBase.FieldHandler changed from protected to private protected
  to satisfy CS0053 with internal ChangeTrackingFieldHandler return type

Fixes #9 (partial) - remaining public type CS0433 tracked in GitHub issue #9

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
SharedValidation types are now internal. Test projects need access to
internal extension methods (e.g. SdmFilterExtensions.Equal with nullable
enum support) that would otherwise fall back to the SDK's ExposerExtensions
which has stricter IEquatable constraints.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
SdmFilterExtensions, BulkRepositoryQueryExtensions and SDMObjectReferenceExtensions
are now public so consumers can use them directly. InternalsVisibleTo no longer needed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…tream projects

AssetManagement.Common and PlanAndBuild.Common reference FacilityManagement.Common
(which compiles the public extension classes). Importing the full SharedValidation.projitems
in those projects caused CS0121 ambiguity for SdmFilterExtensions, SDMObjectReferenceExtensions
and BulkRepositoryQueryExtensions.

New SharedValidationNoExtensions.projitems excludes those 3 files. Downstream projects
import that variant instead and consume the extension classes via the project-reference chain.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…zation public

Consumers need these types directly. CS0433 risk for projects referencing multiple
SDM packages is accepted; those consumers will use extern alias as a workaround
until SDM.InfraOps.Core (issue #9) provides a single shared assembly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…dation in downstream projects

Compiling SharedValidationNoExtensions.projitems into AssetManagement.Common and
PlanAndBuild.Common caused CS0433 for ValidationException (and other types) when
consumers referenced both AssetManagement.Common and FacilityManagement.Common.

Fix: FacilityManagement.Common grants internal type access to AssetManagement.Common
and PlanAndBuild.Common via InternalsVisibleTo. Those projects no longer import any
SharedValidation projitems — they consume all SharedValidation types (internal and
public) exclusively through the FacilityManagement.Common reference.

SharedValidationNoExtensions.projitems deleted (no longer needed).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

DanielaOlive and others added 3 commits July 20, 2026 15:37
… public types

Adds a new test project that references all 4 Common assemblies and uses
reflection to assert no public type exists in more than one assembly.

Currently FAILS with 9 duplicate types (ValidationException, ValidationResult,
ChangeTrackingBase, InfraOpsSerialization, SdmFilterExtensions, etc.) — this is
the acceptance criterion for SDM.InfraOps.Core (issue #9).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… packages

Implements GitHub issue #9. Moves all SharedValidation source into a new
dedicated assembly (Skyline.DataMiner.SDM.InfraOps.Core) so each shared public
type lives in exactly one compiled assembly.

Changes:
- New project SDM.InfraOps.Core (v1.0.0) with all 25 SharedValidation .cs files
  Public types: ChangeTrackingBase, ValidationResult, ValidationException,
  InfraOpsException, InfraOpsSerialization, SdmFilterExtensions,
  SDMObjectReferenceExtensions, BulkRepositoryQueryExtensions
  Internal types: Validator, ValidatorContext, ChangeTrackingField hierarchy,
  converters, middleware — exposed via InternalsVisibleTo to all 4 domain packages
- All 4 Common csproj: removed SharedValidation.projitems import, added
  ProjectReference to SDM.InfraOps.Core
- Deleted FacilityManagement.Common/Properties/InternalsVisibleTo.cs (superseded)
- SDM.InfraOps.PackagingTests: NuGetPackagingTests now passes (both tests green)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sources have been moved to SDM.InfraOps.Core. No project imports
SharedValidation.projitems anymore. Deleting avoids confusion and
prevents accidental re-use of the old source-sharing approach.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
DanielaOlive and others added 6 commits July 21, 2026 10:26
- Deleted SharedMappers.projitems (original pre-split combined file, no longer imported)
- Updated SharedMappers.shproj to import the 4 active per-module projitems directly
  (previously imported the deleted SharedMappers.projitems which also referenced
  the non-existent SharedFacilityMappers.projitems, causing VS broken-reference icon)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
VS shared projects require the imported .projitems to have a SharedGUID
matching the .shproj ProjectGuid (4a22402e...). Recreate SharedMappers.projitems
as a browsing-only index of all DomIds + Facility mapper files.
Revert shproj to import just that one file — fixes 'SharedMappers (unloaded)'.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
SharedMappers.shproj and SharedMappers.projitems served as a VS browsing
convenience for the old combined DomIds file. Now that DomIds are split
per-module, each file is already visible under its own Common project.
The shared project added more confusion than value.

The 4 active .projitems files (SharedAssetDomIds, SharedFacilityDomIds,
SharedInfraopsDomIds, SharedPlanAndBuildDomIds) remain on disk and are
still imported by their respective csproj files for compilation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Eliminates the SharedMappers\ source-sharing folder entirely. Each file
now lives inside its own project directory and is visible in VS naturally
without needing a shared project or .projitems files.

- InfraopsPropertiesDomIds.cs -> SDM.InfraOpsProperties.Common\
- SlcAsset_ManagementDomIds.cs -> SDM.AssetManagement.Common\
- SlcFacility_ManagementDomIds.cs -> SDM.FacilityManagement.Common\
- SlcPlan_And_BuildDomIds.cs -> SDM.PlanAndBuild.Common\
- Facility Management\Mappers\*.g.cs (9 files) -> SDM.FacilityManagement.Common\Mappers\
- Removed SharedMappers\ folder and all 4 .projitems files
- Removed <Import> projitems lines from all 4 domain csproj files

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@DanielaOlive
DanielaOlive merged commit 83548c4 into master Jul 21, 2026
12 checks passed
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.

3 participants