diff --git a/backend/protos/xyz/block/ftl/v1beta1/provisioner/plugin.pb.go b/backend/protos/xyz/block/ftl/v1beta1/provisioner/plugin.pb.go index cadc3a021..7f8be3819 100644 --- a/backend/protos/xyz/block/ftl/v1beta1/provisioner/plugin.pb.go +++ b/backend/protos/xyz/block/ftl/v1beta1/provisioner/plugin.pb.go @@ -24,9 +24,8 @@ const ( type ProvisionResponse_ProvisionResponseStatus int32 const ( - ProvisionResponse_UNKNOWN ProvisionResponse_ProvisionResponseStatus = 0 - ProvisionResponse_SUBMITTED ProvisionResponse_ProvisionResponseStatus = 1 - ProvisionResponse_NO_CHANGES ProvisionResponse_ProvisionResponseStatus = 2 + ProvisionResponse_UNKNOWN ProvisionResponse_ProvisionResponseStatus = 0 + ProvisionResponse_SUBMITTED ProvisionResponse_ProvisionResponseStatus = 1 ) // Enum value maps for ProvisionResponse_ProvisionResponseStatus. @@ -34,12 +33,10 @@ var ( ProvisionResponse_ProvisionResponseStatus_name = map[int32]string{ 0: "UNKNOWN", 1: "SUBMITTED", - 2: "NO_CHANGES", } ProvisionResponse_ProvisionResponseStatus_value = map[string]int32{ - "UNKNOWN": 0, - "SUBMITTED": 1, - "NO_CHANGES": 2, + "UNKNOWN": 0, + "SUBMITTED": 1, } ) @@ -646,7 +643,7 @@ var file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_rawDesc = []byte{ 0x31, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x10, 0x64, 0x65, 0x73, 0x69, 0x72, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, - 0xef, 0x01, 0x0a, 0x11, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0xdf, 0x01, 0x0a, 0x11, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x54, @@ -656,12 +653,11 @@ var file_xyz_block_ftl_v1beta1_provisioner_plugin_proto_rawDesc = []byte{ 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x45, 0x0a, 0x17, 0x50, 0x72, + 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x35, 0x0a, 0x17, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x55, 0x42, 0x4d, 0x49, 0x54, 0x54, 0x45, 0x44, 0x10, - 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x4e, 0x4f, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x53, 0x10, - 0x02, 0x22, 0x98, 0x01, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x01, 0x22, 0x98, 0x01, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x6b, diff --git a/backend/protos/xyz/block/ftl/v1beta1/provisioner/plugin.proto b/backend/protos/xyz/block/ftl/v1beta1/provisioner/plugin.proto index be86007e2..f3653dc1c 100644 --- a/backend/protos/xyz/block/ftl/v1beta1/provisioner/plugin.proto +++ b/backend/protos/xyz/block/ftl/v1beta1/provisioner/plugin.proto @@ -32,7 +32,6 @@ message ProvisionResponse { enum ProvisionResponseStatus { UNKNOWN = 0; SUBMITTED = 1; - NO_CHANGES = 2; } string provisioning_token = 1; diff --git a/backend/provisioner/deployment.go b/backend/provisioner/deployment.go index feca849a3..91476f49e 100644 --- a/backend/provisioner/deployment.go +++ b/backend/provisioner/deployment.go @@ -53,10 +53,6 @@ func (t *Task) Start(ctx context.Context) error { t.state = TaskStateFailed return fmt.Errorf("error provisioning resources: %w", err) } - if resp.Msg.Status == provisioner.ProvisionResponse_NO_CHANGES { - t.state = TaskStateDone - t.output = t.desired.Resources() - } t.runningToken = resp.Msg.ProvisioningToken return nil } diff --git a/backend/provisioner/inmem_provisioner.go b/backend/provisioner/inmem_provisioner.go index 0922af03b..544247758 100644 --- a/backend/provisioner/inmem_provisioner.go +++ b/backend/provisioner/inmem_provisioner.go @@ -97,12 +97,6 @@ func (d *InMemProvisioner) Provision(ctx context.Context, req *connect.Request[p } } - if len(task.steps) == 0 { - return connect.NewResponse(&provisioner.ProvisionResponse{ - Status: provisioner.ProvisionResponse_NO_CHANGES, - }), nil - } - token := uuid.New().String() logger.Debugf("started a task with token %s", token) d.running.Store(token, task) diff --git a/backend/provisioner/noop_provisioner.go b/backend/provisioner/noop_provisioner.go index d0a7e4113..6f3af9854 100644 --- a/backend/provisioner/noop_provisioner.go +++ b/backend/provisioner/noop_provisioner.go @@ -25,11 +25,13 @@ func (d *NoopProvisioner) Plan(context.Context, *connect.Request[provisioner.Pla func (d *NoopProvisioner) Provision(context.Context, *connect.Request[provisioner.ProvisionRequest]) (*connect.Response[provisioner.ProvisionResponse], error) { return connect.NewResponse(&provisioner.ProvisionResponse{ - Status: provisioner.ProvisionResponse_NO_CHANGES, - ProvisioningToken: "", + Status: provisioner.ProvisionResponse_SUBMITTED, + ProvisioningToken: "token", }), nil } func (d *NoopProvisioner) Status(context.Context, *connect.Request[provisioner.StatusRequest]) (*connect.Response[provisioner.StatusResponse], error) { - panic("should not be called") + return connect.NewResponse(&provisioner.StatusResponse{ + Status: &provisioner.StatusResponse_Success{}, + }), nil } diff --git a/cmd/devel-provisioner/main.go b/cmd/devel-provisioner/main.go index b593f6735..5b12f5fff 100644 --- a/cmd/devel-provisioner/main.go +++ b/cmd/devel-provisioner/main.go @@ -67,10 +67,6 @@ func main() { if err != nil { panic(err) } - if resp.Msg.Status == provisioner.ProvisionResponse_NO_CHANGES { - println("no changes") - return - } retry := backoff.Backoff{ Min: 100 * time.Millisecond, diff --git a/cmd/ftl-provisioner-cloudformation/provisioner.go b/cmd/ftl-provisioner-cloudformation/provisioner.go index acf077295..79e3f4c3f 100644 --- a/cmd/ftl-provisioner-cloudformation/provisioner.go +++ b/cmd/ftl-provisioner-cloudformation/provisioner.go @@ -58,7 +58,9 @@ func (c *CloudformationProvisioner) Provision(ctx context.Context, req *connect. } if !updated { return connect.NewResponse(&provisioner.ProvisionResponse{ - Status: provisioner.ProvisionResponse_NO_CHANGES, + // even if there are no changes, return the stack id so that any resource outputs can be populated + Status: provisioner.ProvisionResponse_SUBMITTED, + ProvisioningToken: *res.StackId, }), nil } _, err = c.client.ExecuteChangeSet(ctx, &cloudformation.ExecuteChangeSetInput{ diff --git a/frontend/console/src/protos/xyz/block/ftl/v1beta1/provisioner/plugin_pb.ts b/frontend/console/src/protos/xyz/block/ftl/v1beta1/provisioner/plugin_pb.ts index e1c392183..2572903d1 100644 --- a/frontend/console/src/protos/xyz/block/ftl/v1beta1/provisioner/plugin_pb.ts +++ b/frontend/console/src/protos/xyz/block/ftl/v1beta1/provisioner/plugin_pb.ts @@ -170,17 +170,11 @@ export enum ProvisionResponse_ProvisionResponseStatus { * @generated from enum value: SUBMITTED = 1; */ SUBMITTED = 1, - - /** - * @generated from enum value: NO_CHANGES = 2; - */ - NO_CHANGES = 2, } // Retrieve enum metadata with: proto3.getEnumType(ProvisionResponse_ProvisionResponseStatus) proto3.util.setEnumType(ProvisionResponse_ProvisionResponseStatus, "xyz.block.ftl.v1beta1.provisioner.ProvisionResponse.ProvisionResponseStatus", [ { no: 0, name: "UNKNOWN" }, { no: 1, name: "SUBMITTED" }, - { no: 2, name: "NO_CHANGES" }, ]); /**