UPDATE
This effort has evolved into creating a custom SDK for extensions that can be found here https://github.com/chainloop-dev/chainloop/tree/main/app/controlplane/extensions
NOTE: We should make sure that whatever design we make here meets also this #28 other effort.
Currently, adding a third party integration requires changes in many places in the control-plane codebase as described here #37 (comment). In short it requires changes is pretty much every layer of the application, a) api proto changes, b) biz/use-cases changes and of course c) actual integration code.
c) is the only part that's clearly defined with interfaces
|
type Checker interface { |
|
// Validate that the integration can be registered for future calls |
|
Validate(ctx context.Context) error |
|
} |
|
|
|
type Doer interface { |
|
Do(ctx context.Context) error |
|
// Validate that the integration can be performed with the parameters provided |
|
Validate(ctx context.Context) error |
|
} |
The other two changes are currently custom and per-integration.
The goal of this effort is to design an architecture where adding a new integration just requires such custom code to implement some interfaces, custom code that should probably live in https://github.com/chainloop-dev/chainloop/tree/e770faeeed854cfcff45a06100f9a2eef57d779a/app/controlplane/internal/integrations
Some goals
- These new interfaces should cover the "registration" and "attachment" use cases
- We should aim to no code changes required for a new attestation in the biz, service or API layer
### Action Plan
- [x] Analyze problem and detect coupling points
- [ ] Integrations Overview
- [ ] Document Create a new integration

- [x] Make `registration` and `attachment` generic <https://github.com/chainloop-dev/chainloop/pull/114>
- [x] generic integrations loader <https://github.com/chainloop-dev/chainloop/pull/141>
- [x] generic actuation stage <https://github.com/chainloop-dev/chainloop/pull/141>
- [x] generic dispatcher <https://github.com/chainloop-dev/chainloop/pull/142>
- [ ] document framework\`\`\`
UPDATE
This effort has evolved into creating a custom SDK for extensions that can be found here https://github.com/chainloop-dev/chainloop/tree/main/app/controlplane/extensions
NOTE: We should make sure that whatever design we make here meets also this #28 other effort.
Currently, adding a third party integration requires changes in many places in the control-plane codebase as described here #37 (comment). In short it requires changes is pretty much every layer of the application, a) api proto changes, b) biz/use-cases changes and of course c) actual integration code.
c) is the only part that's clearly defined with interfaces
chainloop/app/controlplane/internal/integrations/integration.go
Lines 20 to 29 in e770fae
The other two changes are currently custom and per-integration.
The goal of this effort is to design an architecture where adding a new integration just requires such custom code to implement some interfaces, custom code that should probably live in https://github.com/chainloop-dev/chainloop/tree/e770faeeed854cfcff45a06100f9a2eef57d779a/app/controlplane/internal/integrations
Some goals