Skip to content

Conversation

@jiparis
Copy link
Member

@jiparis jiparis commented Nov 19, 2025

With the introduction of contracts schema V2, the description field now resides in the raw metadata section in the contract header. This PR makes the API and CLI show the description from the right revision.

Example: two revisions of the same contract, with different descriptions

✗ chainloop workflow contract describe --name test-create --revision 2
INF To download the contract, run the command with the "--output schema" option
┌─────────────────────────────────────────────────────────────┐
│ Contract                                                    │
├──────────────────────┬──────────────────────────────────────┤
│ Name                 │ test-create                          │
├──────────────────────┼──────────────────────────────────────┤
│ Scope                │ project/test-create                  │
├──────────────────────┼──────────────────────────────────────┤
│ Description          │ Another description for the contract │
├──────────────────────┼──────────────────────────────────────┤
│ Associated Workflows │                                      │
├──────────────────────┼──────────────────────────────────────┤
│ Revision number      │ 2                                    │
├──────────────────────┼──────────────────────────────────────┤
│ Revision Created At  │ 19 Nov 25 10:17 UTC                  │
└──────────────────────┴──────────────────────────────────────┘
┌─────────────────────────────────────────────────────┐
│ apiVersion: chainloop.dev/v1                        │
│ kind: Contract                                      │
│ metadata:                                           │
│   name: test-create                                 │
│   description: Another description for the contract │
│ spec:                                               │
│   materials:                                        │
│     - name: hello-material                          │
│       type: ARTIFACT                                │
│   runner:                                           │
│     type: GITHUB_ACTION                             │
└─────────────────────────────────────────────────────┘
➜  cldev workflow contract describe --name test-create --revision 1
INF To download the contract, run the command with the "--output schema" option
┌────────────────────────────────────────────────────────┐
│ Contract                                               │
├──────────────────────┬─────────────────────────────────┤
│ Name                 │ test-create                     │
├──────────────────────┼─────────────────────────────────┤
│ Scope                │ project/test-create             │
├──────────────────────┼─────────────────────────────────┤
│ Description          │ Description of default contract │
├──────────────────────┼─────────────────────────────────┤
│ Associated Workflows │                                 │
├──────────────────────┼─────────────────────────────────┤
│ Revision number      │ 1                               │
├──────────────────────┼─────────────────────────────────┤
│ Revision Created At  │ 19 Nov 25 10:07 UTC             │
└──────────────────────┴─────────────────────────────────┘
┌────────────────────────────────────────────────┐
│ apiVersion: chainloop.dev/v1                   │
│ kind: Contract                                 │
│ metadata:                                      │
│   name: test-create                            │
│   description: Description of default contract │
│ spec:                                          │
│   runner:                                      │
│     type: GITHUB_ACTION                        │
└────────────────────────────────────────────────┘

Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
@jiparis jiparis merged commit bbb8cab into chainloop-dev:main Nov 20, 2025
13 checks passed
@jiparis jiparis deleted the PFM-3955-desc branch November 20, 2025 09:49
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