Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use proto to communicate with Hot Reload process #4076

Merged
merged 11 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
765 changes: 765 additions & 0 deletions backend/protos/xyz/block/ftl/hotreload/v1/hotreload.pb.go

Large diffs are not rendered by default.

77 changes: 77 additions & 0 deletions backend/protos/xyz/block/ftl/hotreload/v1/hotreload.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
syntax = "proto3";

package xyz.block.ftl.hotreload.v1;

import "xyz/block/ftl/language/v1/language.proto";
import "xyz/block/ftl/schema/v1/schema.proto";
import "xyz/block/ftl/v1/ftl.proto";

option go_package = "github.com/block/ftl/backend/protos/xyz/block/ftl/hotreload/v1;hotreloadpb";
option java_multiple_files = true;

message ReloadRequest {
bool force = 1;
}

message ReloadResponse {
oneof event {
ReloadNotRequired reload_not_required = 1;
ReloadSuccess reload_success = 2;
ReloadFailed reload_failed = 3;
}
}

message WatchRequest {}

message WatchResponse {
oneof event {
ReloadSuccess reload_success = 1;
ReloadFailed reload_failed = 2;
}
}

message RunnerInfoRequest {
string address = 1;
string deployment = 2;
repeated Database databases = 3;
}

message Database {
string name = 1;
string address = 2;
}

message RunnerInfoResponse {}

message ReloadNotRequired {}

message ReloadSuccess {
// Module schema for the built module
ftl.schema.v1.Module module = 1;
// Module schema for the built module
ftl.language.v1.ErrorList errors = 2;
}

message ReloadFailed {
// Module schema for the built module
ftl.language.v1.ErrorList errors = 1;
}

// HotReloadService is for communication between a language plugin a language runtime that can perform a hot reload
service HotReloadService {
// Ping service for readiness.
rpc Ping(xyz.block.ftl.v1.PingRequest) returns (xyz.block.ftl.v1.PingResponse) {
option idempotency_level = NO_SIDE_EFFECTS;
}

// Forces an explicit Reload from the plugin. This is useful for when the plugin needs to trigger a Reload,
// such as when the Reload context changes.
//
rpc Reload(ReloadRequest) returns (ReloadResponse);

// Watch for hot reloads not initiated by an explicit Reload call.
rpc Watch(WatchRequest) returns (stream WatchResponse);

// Invoked by the runner to provide runner information to the plugin.
rpc RunnerInfo(RunnerInfoRequest) returns (RunnerInfoResponse);
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading