Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add artifact schema and tests #942

Closed
wants to merge 1 commit into from

Conversation

sajayantony
Copy link
Member

Signed-off-by: Sajay Antony sajaya@microsoft.com

sudo-bmitch
sudo-bmitch previously approved these changes Aug 27, 2022
Copy link
Contributor

@sudo-bmitch sudo-bmitch left a comment

Choose a reason for hiding this comment

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

Approving even with the sugested change in case we want to fix that in a separate PR.

schema/validator.go Outdated Show resolved Hide resolved
This was referenced Aug 30, 2022
@sudo-bmitch
Copy link
Contributor

@sajayantony #944 is merged. This should be ready to rebase and clean up the ioutil references. Thanks!

@sajayantony
Copy link
Member Author

I need to resubmit this with the field name changes now :)

Copy link
Contributor

@sudo-bmitch sudo-bmitch left a comment

Choose a reason for hiding this comment

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

LGTM with a couple minor changes. I think it would be helpful to include some valid minimal artifacts here too. The three examples I'm thinking of are

  1. mediaType only (kinda useless but valid)
  2. mediaType + artifactType + blobs
  3. mediaType + artifactType + annotations

I'm happy to do that as a separate PR if that's easier.

@@ -0,0 +1,29 @@
{
"description": "OpenContainer Artifact Manifest Specification",
"$schema": "https://json-schema.org/draft-04/schema#",
Copy link
Contributor

Choose a reason for hiding this comment

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

From the spec, this needs to be the exact string and we weren't supposed to have changed it to https: https://json-schema.org/understanding-json-schema/reference/schema.html

Suggested change
"$schema": "https://json-schema.org/draft-04/schema#",
"$schema": "http://json-schema.org/draft-04/schema#",

Copy link
Member Author

Choose a reason for hiding this comment

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

I've opened - #961 to fix up the remaining draft 4 identifier strings.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for pointing me to #931 @sudo-bmitch. I’ve closed #961

Comment on lines 90 to 97
"subject": {
"mediaType": "application/vnd.oci.image.manifest.v1+json",
"digest": "sha256:c86f7763873b6c0aae22d963bab59b4f5debbed6685761b5951584f6efb0633b"
},
"annotations": {
"key1": "value1",
"key2": "value2"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit, indentation needs an extra space

Copy link
Member Author

@sajayantony sajayantony Sep 29, 2022

Choose a reason for hiding this comment

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

I went ahead and reformatted all the examples. It seems that certain properties had spaces after the property names and some didn't and I think those that have spaces were incorrectly formatted.

Copy link
Member Author

Choose a reason for hiding this comment

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

Please feel to add more examples. I'm hoping to get the baseline framework and schema in first.

Copy link
Member Author

Choose a reason for hiding this comment

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

@sudo-bmitch hope I've addressed the issues.

@sajayantony
Copy link
Member Author

Need to validate that that the tests catch example issues like
#960

@sajayantony sajayantony force-pushed the artifact-schema branch 2 times, most recently from bbb501a to 2b2e760 Compare September 29, 2022 22:47
Signed-off-by: Sajay Antony <sajaya@microsoft.com>
@sajayantony
Copy link
Member Author

@shizhMSFT thanks for fixing #960 - artifact examples were not validated in this PR and your PR helped :)

Copy link
Contributor

@sudo-bmitch sudo-bmitch left a comment

Choose a reason for hiding this comment

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

LGTM

@sajayantony
Copy link
Member Author

Bumping this issue to get feedback from other maintainers @opencontainers/image-spec-maintainers

@sajayantony sajayantony added this to the v1.1 milestone Oct 20, 2022
@opencontainers opencontainers deleted a comment from sackodiego Dec 26, 2022
@sudo-bmitch
Copy link
Contributor

Closing this one because of #999.

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