Skip to content

Conversation

@Piskoo
Copy link
Collaborator

@Piskoo Piskoo commented Oct 14, 2025

Overview

This PR adds comprehensive schema v2 support to the attestation process.
Contract schema v2 can now be used just like schema v1 in attestation process. For example contract with schema:

apiVersion: chainloop.dev/v1 kind: Contract metadata: name: newcontract description: Contract defining schema and requirements for Skynet build spec: materials: - type: CONTAINER_IMAGE name: skynet-control-plane output: true annotations: - name: component value: control-plane - name: asset value: test optional: true - type: ARTIFACT name: rootfs optional: true - type: ARTIFACT name: dockerfile optional: true - type: STRING name: build-ref optional: true - type: SBOM_CYCLONEDX_JSON name: skynet-sbom - type: OPENVEX name: disclosure optional: true - type: SARIF name: static-output optional: true envAllowList: - CUSTOM_VAR runner: type: GITHUB_ACTION policies: materials: - ref: sbom-freshness with: limit: 30 

when created with CLI changes from #2467 that is a part of a workflow will be enforced during attestation process:

2025-10-17.13-02-20.mov

Changes

  • Updated crafting state proto with versioned raw schema field
  • Updated attestation initialization to handle v2 contract schemas
  • Added schema v2 support throughout the attestation crafter
  • Improved attestation renderer to properly handle v2 schema
  • Maintained backward compatibility with existing v1 contracts while enabling new v2 contracts
@Piskoo Piskoo marked this pull request as ready for review October 15, 2025 21:40
@migmartri
Copy link
Member

can you please elaborate in the description what does this change mean in practice, show some snippets of running the command etc? The messages in the description sound AI generated and too low level.

func Evaluate(opts *EvalOptions, logger zerolog.Logger) (*EvalSummary, error) {
// 1. Create crafting schema
schema, err := createCraftingSchema(opts.PolicyPath, opts.Inputs)
policies, err := createPolicies(opts.PolicyPath, opts.Inputs)
Copy link
Member

Choose a reason for hiding this comment

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

please make sure to add comments in the PR about the non obvious things, this change is quite puzzling, thanks

Copy link
Collaborator Author

@Piskoo Piskoo Oct 17, 2025

Choose a reason for hiding this comment

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

Sorry, PolicyVerifier and PolicyGroupVerifier constructor was changed to take crafting schema policies and crafting schema policy groups and policies respectively, these were the only fields of crafting schema that were used. As consequence, the evaluation tool that previously was building the whole schema just to pass it to PolicyVerifier contructor, was changed as well. Rename in highlighted code is related to renaming function that was previously building the schema.

@Piskoo Piskoo marked this pull request as draft October 20, 2025 07:09
Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
@Piskoo Piskoo force-pushed the feat-handle-schema-v2-during-attestation-process branch from b0b652e to 681a5e9 Compare October 22, 2025 09:42
@Piskoo Piskoo marked this pull request as ready for review October 22, 2025 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants