Skip to content

Commit 292d157

Browse files
authored
docs(extensions): improve some wording (#192)
Signed-off-by: Miguel Martinez Trivino <[email protected]>
1 parent 2ca6151 commit 292d157

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

app/controlplane/extensions/README.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ $ chainloop integration available describe --id dependencytrack
6363
└─────────────┴────────┴──────────┴─────────────────────────────────────────────────────────┘
6464
```
6565

66-
In addition to the constructor 3 more handlers need to be implemented.
66+
In addition to the constructor, 3 more handlers need to be implemented.
6767

6868
![FanOut sdk](../../../docs/img/fanout-sdk.png)
6969

70-
### Registration Stage
70+
### Registration Handler
7171

7272
Registration is when a specific instance of the extension is configured on a Chainloop organization. A registered instance is then available to be attached to any workflow, more on that later.
7373

@@ -78,22 +78,22 @@ Examples:
7878
- Register a Dependency-Track instance by receiving its URL and API key. At this stage, the extension will make sure that the provided information is valid and store it for later use.
7979
- Register a Discord instance by receiving its webhook URL. The handler will store the webhook URL securely for later use.
8080

81-
### Attachment Stage
81+
### Attachment Handler
8282

8383
In order for an user to use a registered instance, it needs to be attached to a workflow. This stage can be also used to optionally customize the behavior of the extension for a specific workflow.
8484

8585
This handler **will receive not only the input from the user but also the output from the registration state**. Similarly to the registration handler, the handler returned output value will be stored in the state for later use.
8686

8787
Examples:
8888

89-
- Tell the already registered Dependency Track instance to send the SBOMs **to a specific project**.
90-
- Tell the already registered Discord instance to send all attestations to the configured channel
89+
- Tell the already registered Dependency Track extension to send the SBOMs **to a specific project**.
90+
- Tell the already registered Discord extension to send all attestations to the configured channel.
9191

92-
### Execution Stage
92+
### Execution Handler
9393

94-
This is the actual execution of the extension. This is where the extension will do its work. i.e call a workflow or send a notification.
94+
This is the actual execution of the extension. This is where the extension will do its work. i.e forward the attestation/material data to a third-party API, send a notification and so on.
9595

96-
This handler **will also have access to the outputs from the registration and attachment phases**.
96+
In addition to the attestation and material data, this handler **will also have access to the outputs from the registration and attachment phases**.
9797

9898
Examples:
9999

@@ -110,4 +110,13 @@ A Discord webhook extension will
110110

111111
## How to create a new extension
112112

113-
We offer a [starter template](./core/template). Just copy it to a new folder and follow the steps shown in its readme file.
113+
We offer a [starter template](./core/template) that can be used as baseline. Just copy it to a new folder i.e `core/my-extension/v1` to get started.
114+
115+
Next:
116+
117+
- Replace all the occurrences of `template` in the code with your extension name.
118+
- Add it to the list of available extensions [here](`./extensions.go`). This will make this extension available the next time the control plane starts.
119+
- Define the API request payloads for both Registration and Attachment.
120+
- Implement the [FanOutExtension interface](https://github.com/chainloop-dev/chainloop/blob/main/app/controlplane/extensions/sdk/v2/fanout.go#L55). The template comes prefilled with some commented out code as guideline.
121+
122+
Remember that you can find some examples of fully functional extensions in [here](./core/).

0 commit comments

Comments
 (0)