feat: oras manifest index: artifactType for index and child manifest descriptors#1700
Merged
Wwwsylvia merged 3 commits intoJun 24, 2025
Merged
Conversation
Contributor
Author
|
(I'm going to leave this as a draft for now because #1696 is not finalized yet.) |
eb39bf0 to
88237eb
Compare
Closed
35 tasks
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1700 +/- ##
==========================================
+ Coverage 85.20% 85.24% +0.03%
==========================================
Files 129 129
Lines 5780 5815 +35
==========================================
+ Hits 4925 4957 +32
- Misses 609 611 +2
- Partials 246 247 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
apparentlymart
commented
Apr 30, 2025
This was referenced May 5, 2025
6329d81 to
b84868b
Compare
Wwwsylvia
reviewed
Jun 18, 2025
The "index create" and "index update" subcommands now accept --artifact-type options to set or change the "artifactType" property of the index manifest. Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
For each manifest in the generated index manifest that is of a recognized media type and has an artifactType value, we'll copy that value into the associated descriptor so that software consuming the index can optionally ignore or reject descriptors of the wrong artifactType without having to retrieve the full manifest first. The behavior does not change for manifests of any other media type or those which do not have an artifactType property. Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
b84868b to
a753d5f
Compare
Wwwsylvia
reviewed
Jun 19, 2025
Previously the --artifact-type option would accept any non-empty string and copy it into the artifactType property of the index. Now we'll require that it matches the regular expression pattern given in the OCI image spec, so that we can avoid creating manifests with syntactically-invalid artifact type values. Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds support for specifying and propagating artifactType in OCI index creation and updates, including validation and E2E/unit tests.
- Introduce
--artifact-typeflag tooras manifest index createandupdate - Validate media type syntax and apply it to the created/updated index and child descriptors
- Expand E2E and unit tests to cover
artifactTypebehavior in both registry and OCI layout modes
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| test/e2e/suite/command/manifest_index.go | Added E2E tests for artifactType propagation, creation, update, removal, and validation |
| cmd/oras/root/manifest/index/update.go | Registered --artifact-type flag, added validation and update logic for index artifact type |
| cmd/oras/root/manifest/index/create_test.go | New unit tests for enrichDescriptor and validateMediaType |
| cmd/oras/root/manifest/index/create.go | Registered --artifact-type flag, added validation and initialization of index artifact type |
This was referenced Aug 7, 2025
6 tasks
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.
What this PR does / why we need it:
This implements the new behavior proposed in #1696.
I am contributing this change on behalf of the OpenTofu project.
Which issue(s) this PR fixes:
Fixes #1670
Please check the following list: