Refactor workload manifest model and add per-package metadata#4937
Merged
liliankasem merged 9 commits intovnextfrom May 6, 2026
Merged
Refactor workload manifest model and add per-package metadata#4937liliankasem merged 9 commits intovnextfrom
liliankasem merged 9 commits intovnextfrom
Conversation
fabiocav
reviewed
May 6, 2026
- IWorkload (interface) -> Workload (abstract class) in Abstractions. - Add per-package WorkloadMetadata + shared EntryPointSpec in Abstractions. - GlobalManifest (nested dict) -> WorkloadRegistry (flat IList<WorkloadEntry>); each entry self-describes PackageId, PackageVersion, Aliases, EntryPoint. - Rename GlobalManifestStore/IGlobalManifestStore -> WorkloadStore/IWorkloadStore and IWorkloadPaths.GlobalManifestPath -> WorkloadRegistryPath. - WorkloadLoader now resolves install dir via IWorkloadPaths. - WorkloadInfo carries the loaded Workload instance; WorkloadListCommand reads display name/description from it. - Update tests and fixtures accordingly.
Document in AGENTS.md and dotnet.instructions.md: use var only when the type is obvious from the right-hand side. Apply to WorkloadListCommand where var hid IReadOnlyList<WorkloadEntry> / IReadOnlyList<WorkloadInfo>.
Materialize IReadOnlyList<WorkloadInfo> once at storage registration (store + loader resolved on first access) so WorkloadListCommand and future consumers (alias routing, command contribution) share the same in-memory list rather than re-parsing the registry per invocation.
Each fixture project now ships a per-package WorkloadMetadata manifest (workload.json) at the package root, copied to the fixture output so the install pipeline / loader can read it instead of scanning assemblies for an attribute.
Brings install-time workload discovery over from feat/workload-discovery in its post-refactor shape: instead of scanning package assemblies for an [assembly: CliWorkload<T>] attribute, the install pipeline reads workload.json from the package root and the resulting WorkloadMetadata is recorded into the global registry. - InvalidWorkloadException: domain exception for malformed metadata. - IWorkloadMetadataReader / WorkloadMetadataReader: deserialize via the source-generated WorkloadJsonContext. - Wire reader into DI alongside the store and loader.
Workload packages now follow this on-disk shape:
<packageRoot>/
workload.json
tools/
<assembly>.dll (+ deps.json, runtimeconfig.json, pdb)
WorkloadMetadataReader.ContentDirectoryName documents the convention
('tools'); WorkloadLoader resolves the entry assembly under that
sub-directory. Func.Tests reshapes the fixture binaries it consumes
to mirror the install layout so loader tests exercise the real path
combination.
…ider, path-traversal guard
7dbb78f to
eb639f8
Compare
fabiocav
approved these changes
May 6, 2026
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.
each entry self-describes PackageId, PackageVersion, Aliases, EntryPoint.
and IWorkloadPaths.GlobalManifestPath -> WorkloadRegistryPath.
reads display name/description from it.