Skip to content

Add plugin sync via pac plugin push#324

Merged
Power-Maverick merged 1 commit into
Power-Maverick:mainfrom
Mosh-K:feat/plugin-sync
May 24, 2026
Merged

Add plugin sync via pac plugin push#324
Power-Maverick merged 1 commit into
Power-Maverick:mainfrom
Mosh-K:feat/plugin-sync

Conversation

@Mosh-K
Copy link
Copy Markdown
Contributor

@Mosh-K Mosh-K commented May 24, 2026

Summary

Adds plugin sync to DVDT — a parallel workflow to web resource sync, but for Dataverse plugin assemblies and packages. Lets developers link a local .csproj to an existing PluginAssembly/PluginPackage record and push changes via pac plugin push directly from VS Code, without leaving the editor.

What's new

  • Two new right-click commands on .csproj files: Link to Existing Dataverse Plugin and Push Plugin to Dataverse.
  • The dvdt.linker.xml schema gains a <Plugins> section (sibling to <WebResources> / <Settings>), with one <Plugin> element per linked project storing Id, dvName, type (Assembly/Nuget), localProjectPath, and environment.

Design choices worth highlighting

  • Delegates to pac plugin push rather than re-implementing plugin registration.
  • One linker section, type attribute discriminator — matches how pac plugin push --type Nuget|Assembly itself models the choice.
  • environment is stored per entry. This lets push run without requiring an active DVDT connection — pac handles its own auth.

Test plan

  • Connect to a Dataverse env that has unmanaged plugin assemblies and packages — verify both load.
  • Right-click a .csproj → Link → quick-pick shows both kinds with type as the description.
  • Link an already-linked project → re-link prompt fires.
  • Cancel the quick-pick → no linker mutation.
  • Push a linked project → pac runs, output channel shows pac's stdout, success toast on exit 0.
  • Push without linking → inline "Link & push" option offered.
  • Push when pac isn't installed → pac-not-found error with "Open install docs" action.
  • Push when pac has no profile for the linker's env → "Authenticate" notification opens a terminal pre-filled with pac auth create --environment "<url>".

Out of scope for this PR

  • Smart Match for plugins (csproj↔record auto-detection).
  • A dedicated Plugins tree view in the sidebar.

Extends the dvdt.linker.xml schema with a <Plugins> section and adds
two right-click commands on .csproj files: Link to Existing Dataverse
Plugin and Push Plugin to Dataverse. Link presents a merged quick-pick
of unmanaged PluginAssembly and PluginPackage records (package-backed
assemblies filtered out via _packageid_value eq null) and stores the
chosen record's id, name, type, project path, and env URL in the
linker. Push reads the entry, runs a pac auth pre-flight (installed +
profile-for-env), and spawns pac plugin push with output piped to a
dedicated OutputChannel and a progress notification.
@Mosh-K Mosh-K requested a review from Power-Maverick as a code owner May 24, 2026 20:26
Copy link
Copy Markdown
Owner

@Power-Maverick Power-Maverick left a comment

Choose a reason for hiding this comment

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

Approving with one change for future.

}
}

private async addInLinkerFile(entry: ILinkerPlugin): Promise<ILinkerPlugin | undefined> {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

All linker file methods would be good to move into single utility helper class instead duplicating the code.

@Power-Maverick Power-Maverick merged commit 294fcdc into Power-Maverick:main May 24, 2026
1 of 2 checks passed
Power-Maverick added a commit that referenced this pull request May 25, 2026
* Add tool icons and implement command registration for tools

- Added SVG icon for generic tool and PNG icons for PRT and PD tools.
- Implemented `registerToolsCommands` function to register commands for opening the Dataverse REST Builder (DRB), launching PRT, CMT, and PD tools.
- Created `ToolsHelper` class to manage tool interactions, including opening the DRB and launching tools based on user selection.
- Included error handling for command execution failures.

* Remove ERD generator function and its import from ToolsHelper

* Add "DVDT" to keywords in package.json

* Add plugin sync via pac plugin push (#324)

* Fix garbled non-ASCII text in Compare with Server (#322)

* Docs: Add @Mosh-K as a contributor

* Bump version to 2.2.7 in package.json

* Update CHANGELOG for v2.2.7 release with merged features and commits

---------

Co-authored-by: Mosh-K <158998622+Mosh-K@users.noreply.github.com>
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