Skip to content

Conversation

migmartri
Copy link
Member

Global annotations support.

Similarly to the annotations attached to a material #278, now you can a) define a list of optionally set of annotations at the attestation level. These annotations then will be injected into the resulting attestation and in another patch, exposed to plugins such as the notification ones.

  • Annotations that don't have a value, will require the user performing the attestation to inject them during att push command.

So for example, having the following schema with an annotation called asset already pre-populated and another one called version without value.

{
        "schemaVersion":  "v1",
        "annotations":  [
                {
                        "name":  "asset",
                        "value":  "chainloop-oss"
                },
                {
                        "name":  "version"
                }
        ],
        "materials":  [
                {
                        "type":  "SBOM_CYCLONEDX_JSON",
                        "name":  "controlplane-sbom",

During the attestation process, when we init we'll see

$ chainloop att init
INF Attestation initialized! now you can check its status or add materials to it
┌───────────────────┬──────────────────────────────────────┐
│ Initialized At    │ 31 Jul 23 09:16 UTC                  │
├───────────────────┼──────────────────────────────────────┤
│ Workflow          │ 3e4ef02c-0f33-4248-84be-8a55ea2e3cb0 │
│ Name              │ only-sbom                            │
│ Team              │                                      │
│ Project           │ foo                                  │
│ Contract Revision │ 20                                   │
│ Annotations       │ ------                               │
│                   │ asset: chainloop-oss                 │
│                   │ version: [NOT SET]                   │
└───────────────────┴──────────────────────────────────────┘

then the annotation can be provided using the attestation push command

chainloop att push --annotation version=123

Refs #252

Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
@migmartri migmartri requested a review from danlishka July 31, 2023 11:07
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Copy link
Member

@danlishka danlishka left a comment

Choose a reason for hiding this comment

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

Perfect! Looking forward to seeing annotations in production.

@migmartri migmartri merged commit d625c2f into chainloop-dev:main Jul 31, 2023
@migmartri migmartri deleted the global-annotations branch July 31, 2023 11:35
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