PowerShell / PowerShell/PSResourceGet

OCI: Define MediaTypes and decompression logic for nupkg/zip

Open
#1,967 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature_request Issue-Discussion
Dominant language
C#
Stars
576
Forks
114
Avg merge
1d 2h
Merged PRs (30d)
7

Description

Summary of the new feature / enhancement

As a publisher, I want to publish PowerShell Modules packaged in nupkg as ORAS artifacts to consume in their native zip format rather than having to convert them to tar+gzip.

If I am hosting a large registry (e.g. https://pwsh.gallery), I can reference the same storage/packages for both nugetv2/v3 and oras packages, otherwise I have to hold and maintain duplicate copies/storage of every package.

Proposed technical implementation details (optional)

OCI allows definitions of both a media type and an image type. Rather then be generic, we should define types for both of these and implement them for nupkg/zip:

Nupkg MediaType: application/vnd.dotnet.nupkg.v1+zip

Zip Layer MediaType: application/vnd.oci.image.layer.v1.zip

When pulling packages, apply proper unzip to these layers and then handle the same as the tar+gzip. Potentially support a strict option to only accept items that were strictly published with the dotnet.nupkg mediatype.

This behavior would only occur on the specified image type, so it would not break any compatibility.

Registries could choose to then host powershell modules in either native zip, tar, tar+gzip, or tar+zstd.

This implementation would not require any registry-side changes, as they are designed for this and do not need to know or understand the zip format to work for both publishing and retrieval, unless a registry does some sort of non-standard validation of the artifact.

It may make sense to define these formats or the transfer mechanism in general in a PowerShell RFC so that all OCI-based PowerShell tools have a standard set of instructions to work from.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the existing OCI artifact pull path and how tar and tar+gzip layers are handled. Define the nupkg and zip media types, apply unzip handling for those layers, and verify that native zip packages are consumed without affecting existing formats.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.