Skip to content

Add OCI registry discovery and RegistryList resource - #1828

Open
Steve Lee (SteveL-MSFT) wants to merge 8 commits into
mainfrom
stevel-msft-psychic-succotash
Open

Steve Lee (SteveL-MSFT) wants to merge 8 commits into
mainfrom
stevel-msft-psychic-succotash

Conversation

@SteveL-MSFT

@SteveL-MSFT Steve Lee (SteveL-MSFT) commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Enable dsc resource list to discover DSC resources published in OCI registries without installing their implementations. This implements the discovery portion of the resource packaging RFC (#1826), using the JSON-RPC extension and reverse-secret support from #1827.

Approach

  • Add Microsoft.Registry.OpenContainerInitiative/Discover and the separate Microsoft.Registry.OpenContainerInitiative/RegistryList settings resource.
  • Enumerate registry catalogs and tags, select platform-compatible resource versions, and download digest-pinned JSON manifests with SHA-256 and size verification. Enforce the 8 MiB metadata limit while streaming tag-addressed indexes and digest-addressed platform manifests, including responses without Content-Length. Implementation ZIPs are not downloaded; uninstalled remote resources cannot be invoked, but embedded schemas remain available.
  • Import ordinary and adapted remote resource manifests as metadata using recognized schema URIs. Preserve adapted capabilities, required adapter, content, and schema without evaluating remote conditions, executing schema commands, resolving executable paths, or trusting remote installation paths. Embedded adapted schemas remain readable without invoking an adapter. Action and manifest-list payloads remain unsupported for remote metadata.
  • Warn and skip invalid discovery records without discarding valid results before or after them. Isolate metadata, integrity, repository, and pagination failures: retain previously enumerated repositories and tags, continue other repositories and registries, and emit sanitized diagnostics.
  • Use oci-client plus bounded HTTP metadata reads, since the published oras crate lacks the required enumeration APIs. Support anonymous bearer-token negotiation and retrieve configured bearer credentials through reverse JSON-RPC secret.get; persist only secret references.
  • Merge settings by friendly name with machine policy taking precedence over user preferences and machine preferences. Support atomic replacement, currentUser/allUsers scope, administrator-only machine writes, and a specific error for the reserved name local in any casing. Explicit test compares the complete selected list so removing authentication or secretVault triggers replacement.
  • Expose registry provenance in resource-list JSON and in a Registry table column immediately after RequireAdapter. Preserve the first type/version identity so installed local resources take precedence consistently for listing and invocation. Export RegistryList with top-level _name: "OCI Registries" so DSC assigns that configuration instance name.
  • Include release packaging, Windows executable version metadata, reference documentation, and updated discovery/resource-list schemas. Update extension-discovery expectations for the additional built-in extension.

Settings filenames intentionally preserve the requested Microsoft.Registry.OpenContainerInitaitive.settings.json spelling; machine policy uses the corresponding .policy.json filename.

Validation

On Windows ARM64, using the repository-root build.ps1:

  • Targeted DSC and OCI builds with Clippy.
  • 15 OCI Rust unit tests and 49 JSON-RPC discovery/table/schema Pester tests passed. Existing local adapted-resource and extension-discovery suites passed 28 tests, with one console-dependent test skipped.
  • Earlier RegistryList validation passed 16 Pester tests. The previously failing extension-discovery and executable-version test files also passed locally.
  • Isolated anonymous end-to-end dsc resource list against orasdscartifacts.azurecr.io returned all eight resources, including adapted Microsoft.Windows/Personalization with its required adapter. Its embedded schema was retrieved successfully without invoking the adapter. Unavailable registries configured before and after the healthy registry produced warnings without hiding its results.
  • Regression coverage verifies bounded reads before EOF for tag and digest manifests, exact-limit acceptance, healthy versions retained around malformed entries, partial catalog/tag pagination and repository failure isolation, metadata-only adapted import with existing or missing remote paths, safe schema access, local duplicate precedence, removal of optional credential references, and rejection of uninstalled remote invocation.

Copilot AI balanced review requested due to automatic review settings November 22, 2026 23:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Downloaded registry manifests are not restricted to ordinary resources, allowing action schema commands to execute during listing and adapted-resource paths to bypass availability checks.

4 open issues
What changed in this PR

Adds OCI registry discovery to DSC’s extension system, implementing the discovery portion of #1826 using the JSON-RPC and reverse-secret support from #1827. Resources can be listed without downloading their implementation packages.

Changes:

  • Adds registry enumeration, platform selection, digest verification, and secret-backed authentication.
  • Introduces RegistryList for user preferences, machine preferences, and machine policy.
  • Adds registry provenance, remote-resource invocation checks, packaging, schemas, documentation, and tests.
File Description
tools/​test_group_resource/​src/​main.rs Adds local provenance to test resources.
schemas/​v3/​outputs/​resource/​list.json Adds registry provenance and nullable paths.
schemas/​v3/​extension/​stdout/​discover.json Supports manifest content and registry provenance.
schemas/​v3/​bundled/​outputs/​resource/​list.vscode.json Updates the editor resource-list schema.
schemas/​v3/​bundled/​outputs/​resource/​list.json Updates the bundled resource-list schema.
schemas/​v3/​bundled/​extension/​stdout/​discover.vscode.json Updates discovery validation and editor descriptions.
schemas/​v3/​bundled/​extension/​stdout/​discover.json Updates the bundled discovery schema.
schemas/​src/​outputs/​resource/​list.yaml Defines provenance and nullable-path schema changes.
schemas/​src/​extension/​stdout/​discover.yaml Defines discovery output alternatives and provenance.
resources/​oci_registry/​tests/​oci_registry_set.tests.ps1 Tests persistence, replacement, and invalid settings.
resources/​oci_registry/​tests/​oci_registry_get.tests.ps1 Tests selected settings and scope validation.
resources/​oci_registry/​tests/​oci_registry_export.tests.ps1 Tests export naming and instance shape.
resources/​oci_registry/​src/​settings.rs Implements settings validation, precedence, and atomic writes.
resources/​oci_registry/​src/​rpc.rs Implements discovery lifecycle and reverse-secret requests.
resources/​oci_registry/​src/​oci.rs Implements OCI enumeration and verified manifest retrieval.
resources/​oci_registry/​src/​main.rs Provides discovery and RegistryList command entry points.
resources/​oci_registry/​registrylist.dsc.resource.json Declares RegistryList operations and schema command.
resources/​oci_registry/​oci_registry.dsc.extension.json Registers the JSON-RPC Discover extension.
resources/​oci_registry/​locales/​en-us.toml Adds localized resource and discovery messages.
resources/​oci_registry/​Cargo.toml Declares OCI resource dependencies and platform TLS features.
resources/​oci_registry/​.project.data.json Registers build artifacts and manifests.
lib/​dsc-lib/​src/​extensions/​discover.rs Carries registry provenance into discovered resources.
lib/​dsc-lib/​src/​dscresources/​dscresource.rs Adds provenance, availability checks, and embedded-schema access.
lib/​dsc-lib/​locales/​en-us.toml Adds the uninstalled-resource diagnostic.
extensions/​test/​jsonrpc/​discover/​discover.ps1 Supports provenance in the discovery fixture.
dsc/​tests/​discovery/​dsc_extension_jsonrpc.tests.ps1 Tests provenance, table output, invocation checks, and schemas.
dsc/​src/​subcommand.rs Adds the Registry resource-list column.
dsc/​locales/​en-us.toml Adds the Registry column label.
docs/​reference/​schemas/​extension/​stdout/​discover.md Documents provenance and remote-resource behavior.
docs/​reference/​resources/​Microsoft/​Registry/​OpenContainerInitiative/​RegistryList/​index.md Documents RegistryList settings, operations, and discovery.
docs/​reference/​resources/​Microsoft/​Registry/​OpenContainerInitiative/​RegistryList/​examples/​configure-registries.md Adds preference and policy configuration examples.
docs/​reference/​cli/​resource/​list.md Documents the Registry column.
data.build.json Includes OCI components in platform release packages.
Cargo.toml Adds the workspace member and shared dependencies.
Cargo.lock Records OCI and transport dependency resolution.

Review effort: Balanced

Comment thread resources/oci_registry/src/oci.rs Resolved
Comment thread lib/dsc-lib/src/extensions/discover.rs Resolved
Comment thread resources/oci_registry/src/rpc.rs Resolved
@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

❌ Code Coverage Report

Coverage report could not be generated. The build or test run failed before
producing coverage data. Check the workflow logs for details.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Manifest downloads can consume unbounded memory before the size limit is enforced, and malformed metadata can abort registry-wide discovery, discarding otherwise valid entries.

1 open issue
1 previously missed issue

In code that hasn't changed since last review

Medium severity Continue discovery after malformed registry metadata

resources/​oci_registry/​src/​oci.rs:441

A corrupt JSON layer or malformed index/platform descriptor aborts discovery for the entire registry, discarding valid manifests already collected and skipping later tags. Catch metadata and integrity failures within the tag loop, emit sanitized warnings, and continue so healthy entries from the same registry remain discoverable.

4 resolved since last review

Review effort: Balanced

Comment thread resources/oci_registry/src/oci.rs Resolved
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Import remote manifests as resource-only metadata, preserve local precedence, compare complete registry settings, and isolate registry failures.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Fix extension discovery expectations and add Windows executable version metadata.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Import adapted content without trusting remote paths, expose embedded schemas, and isolate invalid records and catalog or repository pagination failures.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep discovery progress incomplete until extension discovery finishes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Active defects let remote metadata override installed resources or disappear from adapter-filtered lists, while registry set can report success without validating missing registry input.

3 open issues
1 resolved since last review

Review effort: Balanced

Comment thread lib/dsc-lib/src/extensions/discover.rs Resolved
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Discovery can select an uninstalled remote candidate over an eligible installed resource, and schema retrieval unnecessarily executes installed adapters’ list commands.

2 open issues
3 resolved since last review

Review effort: Balanced

Search eligible installed adapters for unpinned registry resources, preserve per-adapter candidates, and avoid adapter enumeration when schema metadata is already available.

Co-authored-by: Copilot App <223556219+Copilot@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