Skip to content

Commit 873d84d

Browse files
authored
chore(api): rename integration.Kind with integration.ExtensionID (#150)
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
1 parent 918a90b commit 873d84d

8 files changed

Lines changed: 202 additions & 196 deletions

File tree

app/cli/cmd/integration_add.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ import (
2323
"github.com/spf13/cobra"
2424
)
2525

26-
var integrationDescription string
27-
2826
func newConfigIntegrationAddCmd() *cobra.Command {
2927
var options []string
28+
var integrationDescription string
3029

3130
cmd := &cobra.Command{
3231
Use: "add INTEGRATION_ID --options key=value,key=value",

app/cli/cmd/integration_add_deptrack.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
)
2626

2727
func newIntegrationAddDepTrackCmd() *cobra.Command {
28-
var instance string
28+
var instance, integrationDescription string
2929
var allowAutoCreate bool
3030

3131
cmd := &cobra.Command{

app/cli/internal/action/integration_add.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func NewIntegrationAdd(cfg *ActionsOpts) *IntegrationAdd {
3131
return &IntegrationAdd{cfg}
3232
}
3333

34-
func (action *IntegrationAdd) Run(kind, description string, options map[string]any) (*IntegrationItem, error) {
34+
func (action *IntegrationAdd) Run(extensionID, description string, options map[string]any) (*IntegrationItem, error) {
3535
client := pb.NewIntegrationsServiceClient(action.cfg.CPConnection)
3636

3737
// Transform to structpb for transport
@@ -41,7 +41,7 @@ func (action *IntegrationAdd) Run(kind, description string, options map[string]a
4141
}
4242

4343
i, err := client.Register(context.Background(), &pb.IntegrationsServiceRegisterRequest{
44-
Kind: kind,
44+
ExtensionId: extensionID,
4545
Config: requestConfig,
4646
DisplayName: description,
4747
})

app/controlplane/api/controlplane/v1/integrations.pb.go

Lines changed: 180 additions & 177 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/controlplane/api/controlplane/v1/integrations.pb.validate.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/controlplane/api/controlplane/v1/integrations.proto

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ service IntegrationsService {
4646

4747
message IntegrationsServiceRegisterRequest {
4848
// Kind of integration to register
49-
// This should match the ID of an existing integration
50-
string kind = 1 [(validate.rules).string.min_len = 1];
49+
// This should match the ID of an existing extension
50+
string extension_id = 1 [(validate.rules).string.min_len = 1];
5151
// Arbitrary configuration for the integration
5252
google.protobuf.Struct config = 3 [(validate.rules).message.required = true];
5353
// Description of the registration, used for display purposes
@@ -59,7 +59,9 @@ message IntegrationsServiceRegisterResponse {
5959
}
6060

6161
message IntegrationsServiceAttachRequest{
62+
// UUID of the workflow to attach
6263
string workflow_id = 1 [(validate.rules).string.uuid = true];
64+
// UUID of the integration registration to attach
6365
string integration_id = 2 [(validate.rules).string.uuid = true];
6466
// Arbitrary configuration for the integration
6567
google.protobuf.Struct config = 4 [(validate.rules).message.required = true];

app/controlplane/api/gen/frontend/controlplane/v1/integrations.ts

Lines changed: 11 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/controlplane/internal/service/integration.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func (s *IntegrationsService) Register(ctx context.Context, req *pb.Integrations
7676
}
7777

7878
// lookup the integration
79-
integration, err := s.integrations.FindByID(req.Kind)
79+
integration, err := s.integrations.FindByID(req.ExtensionId)
8080
if err != nil {
8181
return nil, errors.NotFound("not found", err.Error())
8282
}

0 commit comments

Comments
 (0)