Skip to content

[fan-out integration] new SDK #38

Closed

Description

@migmartri

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

![Untitled-2023-05-15-0935](https://github.com/chainloop-dev/chainloop/assets/24523/d51480e6-1b52-4e4b-8572-b53274b5225b)

- [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\`\`\`

Activity

  1. changed the title [-]abstract / define third party integration interface[/-] [+][fan-out integrations] abstract / define third party integration interface[/+] on Mar 16, 2023
  2. changed the title [-][fan-out integrations] abstract / define third party integration interface[/-] [+][fan-out integration] abstract / define third party integration interface[/+] on Mar 16, 2023
  3. changed the title [-][fan-out integration] abstract / define third party integration interface[/-] [+][fan-out integration] abstract / define integration interface[/+] on Mar 16, 2023
  4. self-assigned this
    on May 10, 2023
  5. migmartri commented on Jun 4, 2023

    @migmartri
    MemberAuthor

    A WIP code for the dispatcher codo can be found here https://github.com/migmartri/chainloop/pull/1/files

  6. changed the title [-][fan-out integration] abstract / define integration interface[/-] [+][fan-out integration] new SDK[/+] on Jun 15, 2023
  7. migmartri commented on Jun 21, 2023

    @migmartri
    MemberAuthor

    Our latest release contains all the sdk changes and new plugins https://github.com/chainloop-dev/chainloop/releases/tag/v0.11.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions