Repository navigation
Add dll deploy support - #21
Merged
Merged
Conversation
Tasks 1-3 of the bare DLL deployment plan: - Add PluginBuildMode enum, AppConfig.pluginBuildMode, ConfigLoader.ResolvePluginBuildMode, and the --plugin-build-mode CLI option (deploy/sync). - ProjectBuilder: add BuildAssembly which tolerates projects that emit no .nupkg and make BuildResult.NupkgPath nullable; extract a virtual RunBuild seam for testing. - Introduce IPluginDeployer + PluginArtifact and PluginDeployerBase shared skeleton; refactor PackageDeployer onto the base while keeping its existing public Deploy overload. - Add ConfigLoaderTests and ProjectBuilderTests.
Tasks 4-7 of the bare DLL deployment plan: - AssemblyDeployer: create or update a pluginassembly from the built .dll, resolve by name (throw on duplicates), dry-run reports "would create". - SolutionService.AddAssemblyToSolution (component type 91). - PluginDeploymentPlan: maps requested mode + build output to the artifact deployed, warning when they disagree (E18). - Wire plugin deploy/sync: resolve mode, select deployer, warn on mismatch, add the assembly to the target solution; add --dry-run to plugin deploy. - README: document --plugin-build-mode, pluginBuildMode, assembly-mode semantics and solution membership. - Tests: AssemblyDeployerTests, PluginDeploymentPlanTests, AddAssemblyToSolution.
Package mode now fails when the build emits no .nupkg instead of falling back to the DLL. Assembly mode keeps the E18 warning when a .nupkg was also produced. PluginDeploymentPlan no longer carries a (never-changing) mode, and commands select the deployer from the resolved mode. Update README and the plan's E18 resolution note.
Review-driven changes: - Extract PluginDeployRunner.BuildAndDeploy; both commands share one build+deploy path. - Compute the assembly Version only in assembly mode (package path no longer opens the DLL). - Add PluginDeploymentPlan.ShouldAddAssemblyToSolution and unit-test the guard truth table. - Rename ProjectBuilder.BuildAssembly -> BuildAllowingMissingPackage (the real distinction is package-optional, not assembly-specific). - Remove the production-dead PackageDeployer.Deploy(string,string) overload; point its tests at the PluginArtifact API. - Assert version + exact base64 content in AssemblyDeployerTests; drop the over-claiming name. - Docs: deploy description, pluginassembly table row, test header, plan doc drift.
A bare pluginassembly upload does not make Dataverse create the child plugintype rows (unlike a pluginpackage, which Dataverse extracts itself), so sync could not register steps - "No plugintype records found for assembly". Mirror the Plugin Registration Tool / spkl: reflect the built DLL for every concrete IPlugin class and create the missing plugintype records. - PluginDiscovery.DiscoverPluginTypeNames + shared metadata-load path (ForEachPluginType). - New PluginTypeRegistrar.EnsureRegistered (create missing, skip existing). - PluginDeployRunner registers types after an assembly-mode deploy (not on dry run). - Tests: PluginTypeRegistrarTests, PluginDiscoveryTests; README + plan notes.
A removed/renamed plugin class left its plugintype row behind forever. In assembly mode dvx creates those rows itself, so it must also reconcile them. - PluginTypeRegistrar.DeleteOrphans: deletes types absent from the built DLL, scoped to the deployed assembly; deletes each orphan's steps first; never touches types backing a Custom API (SdkMetadata.CustomApiPluginTypeIds) or Custom Action (new CustomActionPluginTypeIds, which required adding workflow.plugintypeid to the SdkMetadata query); no writes on dry-run; refuses to delete when the desired set is empty (reflection-failure safety rail). - PluginDeployRunner: in assembly mode reflect the DLL once, EnsureRegistered then, when --delete-orphaned, DeleteOrphans. Package mode unchanged (Dataverse prunes on package update). - plugin deploy gains --delete-orphaned (reusing the existing option; no new flag). - Tests: 8 new PluginTypeRegistrar cases. README + plan updated.
Dataverse validates every registered plugintype against the incoming assembly during the
pluginassembly content update and rejects it ("PluginType [...] not found in PluginAssembly
[...]") when a removed class's type still exists. The previous code pruned orphans AFTER the
update, so the update failed first.
- Move type reconciliation before the update, unconditionally (spkl-style) — a stale type makes
the update impossible, so it is not an optional cleanup.
- New PluginDeployRunner.DeployAssembly seam (internal): find existing id -> DeleteOrphans ->
deploy content -> EnsureRegistered. Unit-tested (PluginDeployRunnerTests) for the ordering.
- AssemblyDeployer.FindExistingId(name) exposed.
- deploy no longer takes --delete-orphaned (types reconcile automatically); --delete-orphaned
stays steps-only for sync/register.
- README + plan updated.
Verified red-first: PluginDeployRunnerTests failed to compile before DeployAssembly existed.
|
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.



Adds an assembly build mode to plugin deploy/sync (config: pluginBuildMode; default stays package)
309 tests pass; verified fresh deploy, rename, and removal against a dev org.