Skip to content

Refactor workload manifest model and add per-package metadata#4937

Merged
liliankasem merged 9 commits intovnextfrom
liliankasem/refactor/manifest-workload-props
May 6, 2026
Merged

Refactor workload manifest model and add per-package metadata#4937
liliankasem merged 9 commits intovnextfrom
liliankasem/refactor/manifest-workload-props

Conversation

@liliankasem
Copy link
Copy Markdown
Member

  • IWorkload (interface) -> Workload (abstract class) in Abstractions.
  • Add per-package WorkloadMetadata + shared EntryPointSpec in Abstractions.
  • GlobalManifest (nested dict) -> WorkloadRegistry (flat IList);
    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.

@liliankasem liliankasem requested a review from a team as a code owner May 6, 2026 00:38
Comment thread src/Abstractions/Workloads/EntryPointSpec.cs Outdated
Comment thread src/Abstractions/Workloads/Workload.cs Outdated
Comment thread src/Func/Hosting/WorkloadStorageRegistration.cs Outdated
Comment thread src/Func/Workloads/Loading/WorkloadLoader.cs Outdated
- 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.
@liliankasem liliankasem force-pushed the liliankasem/refactor/manifest-workload-props branch from 7dbb78f to eb639f8 Compare May 6, 2026 15:47
@liliankasem liliankasem merged commit 0140535 into vnext May 6, 2026
6 checks passed
@liliankasem liliankasem deleted the liliankasem/refactor/manifest-workload-props branch May 6, 2026 16:14
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