Improve config format 8b7#16
Merged
Merged
Conversation
Profiles can now declare a shared AssemblyPath reused by every assembly-based sync item (Plugin, PluginAnalysis, Identity), and each sync item can override the profile-level SolutionName and AssemblyPath. Effective-value resolution precedence is CLI override -> sync-item value -> profile-level value, centralized in ProfileConfiguration's ResolveAssemblyPath/ResolveSolutionName helpers and used by the config builder, validator, root command and standalone commands. Validation now checks effective per-item values instead of requiring a profile-level solution name unconditionally. Co-Authored-By: Claude <[email protected]> via Conducktor <[email protected]>
# Conflicts: # Model/XrmSyncOptions.cs # XrmSync/Commands/PluginSyncCommand.cs # XrmSync/Commands/XrmSyncRootCommand.cs
Extract three shared helpers to remove copy-pasted logic across the plugin, webresource, analyze and identity commands: - XrmSyncCommandBase.ResolveCommandProfile: standalone-vs-profile detection, profile loading and error messaging. Collapses each command's two-branch merge into a single path (CLI value wins via GetValueOrDefault, with a null profile standing in for standalone). - XrmSyncCommandBase.ReadExecutionOverrides: reads the shared --dry-run/--ci-mode/--log-level/--profile values into a deconstructable record struct. - ServiceCollectionExtensions.AddOptions(dryRun, ciMode, logLevel): applies the standard execution-override block when registering config. No behavior change; all unit tests pass. Co-Authored-By: Claude <[email protected]> via Conducktor <[email protected]>
There was a problem hiding this comment.
Pull request overview
Enables profile-level defaults for AssemblyPath and per-sync-item overrides for SolutionName/AssemblyPath, with a unified “effective value” precedence (CLI override → item override → profile default) applied consistently across config building, validation, and command execution. Also refactors repeated CLI/profile merge logic into shared helpers in the command base and DI registration.
Changes:
- Add profile-level
AssemblyPathand per-itemSolutionNameoverride support; centralize effective-value resolution inProfileConfiguration. - Update configuration builder/validator and root + standalone commands to use effective values (including per-item overrides) and validate accordingly.
- Factor shared command scaffolding (profile resolution + execution overrides) and add a DI helper for applying execution-level overrides.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| XrmSync/Options/XrmSyncConfigurationValidator.cs | Validates per-item effective SolutionName/AssemblyPath instead of requiring profile-level solution unconditionally. |
| XrmSync/Options/XrmSyncConfigurationBuilder.cs | Reads profile-level AssemblyPath, allows null per-item assembly paths, and applies per-item SolutionName overrides. |
| XrmSync/Options/ConfigValidationOutput.cs | Displays/validates sync items using effective (resolved) assembly path and solution name. |
| XrmSync/Extensions/ServiceCollectionExtensions.cs | Adds AddOptions(dryRun, ciMode, logLevel) convenience overload for standard execution overrides. |
| XrmSync/Commands/XrmSyncRootCommand.cs | Resolves and bakes effective per-item values (CLI → item → profile) before validating/executing. |
| XrmSync/Commands/XrmSyncCommandBase.cs | Introduces shared helpers for reading execution overrides and resolving standalone vs profile execution. |
| XrmSync/Commands/WebresourceSyncCommand.cs | Refactors CLI/profile merge via shared helpers; uses effective solution name resolution. |
| XrmSync/Commands/PluginSyncCommand.cs | Refactors CLI/profile merge via shared helpers; uses effective assembly/solution resolution. |
| XrmSync/Commands/PluginAnalyzeCommand.cs | Refactors standalone vs profile logic; uses effective assembly path resolution. |
| XrmSync/Commands/IdentityCommand.cs | Refactors CLI/profile merge via shared helpers; uses effective assembly/solution resolution. |
| Model/XrmSyncOptions.cs | Adds profile-level AssemblyPath, per-item SolutionName, and resolution helpers. |
| Tests/Config/OptionsValidationTests.cs | Adds validator tests for profile-level assembly path and per-item solution name behavior. |
| Tests/Config/NamedConfigurationTests.cs | Adds config-builder tests covering shared profile assembly path and per-item overrides. |
| README.md | Documents new config format and override precedence, plus updated schema/examples. |
| CLAUDE.md | Updates internal documentation to describe new config resolution behavior. |
| XrmSync/appsettings.example.json | Updates example config to demonstrate shared profile AssemblyPath and per-item overrides. |
| appsettings.example.json | Updates root example config similarly. |
| CHANGELOG.md | Records the new config capabilities in the release notes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
* ResolveAssemblyPath now returns null when neither the sync item nor the profile provides a non-whitespace AssemblyPath, matching its documented contract (no more leaking empty/whitespace profile values) * Clarify in README/CLAUDE that the profile-level SolutionName is optional — required only when a solution-targeting item (Plugin, Webresource, Identity) needs it and doesn't override it; analysis-only profiles can omit it Co-Authored-By: Claude <[email protected]> via Conducktor <[email protected]>
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.
Allow profile-level AssemblyPath and per-item SolutionName
Profiles can now declare a shared AssemblyPath reused by every
assembly-based sync item (Plugin, PluginAnalysis, Identity), and each
sync item can override the profile-level SolutionName and AssemblyPath.
Effective-value resolution precedence is CLI override -> sync-item value
-> profile-level value, centralized in ProfileConfiguration's
ResolveAssemblyPath/ResolveSolutionName helpers and used by the config
builder, validator, root command and standalone commands. Validation now
checks effective per-item values instead of requiring a profile-level
solution name unconditionally.
Factor out duplicated CLI/profile merge scaffolding in commands
Extract three shared helpers to remove copy-pasted logic across the
plugin, webresource, analyze and identity commands:
detection, profile loading and error messaging. Collapses each
command's two-branch merge into a single path (CLI value wins via
GetValueOrDefault, with a null profile standing in for standalone).
--dry-run/--ci-mode/--log-level/--profile values into a deconstructable
record struct.
applies the standard execution-override block when registering config.
Co-Authored-By: Claude [email protected] via Conducktor [email protected]