Skip to content

Commit

Permalink
Add UpdateSession() to runnerv2alpha1
Browse files Browse the repository at this point in the history
  • Loading branch information
adambabik committed Feb 2, 2024
1 parent c9607c2 commit da00f43
Show file tree
Hide file tree
Showing 20 changed files with 788 additions and 332 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ wasm:

.PHONY: test/execute
test/execute: PKGS ?= "./..."
test/execute: RUN ?= .*
test/execute: build test/prep-git-project
TZ=UTC go test -ldflags="$(LDTESTFLAGS)" -timeout=60s -covermode=atomic -coverprofile=cover.out -coverpkg=./... $(PKGS)
TZ=UTC go test -ldflags="$(LDTESTFLAGS)" -run="$(RUN)" -timeout=60s -covermode=atomic -coverprofile=cover.out -coverpkg=./... $(PKGS)

.PHONY: test/prep-git-project
test/prep-git-project:
Expand Down
21 changes: 21 additions & 0 deletions internal/api/runme/runner/v2alpha1/runner.proto
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,26 @@ message ListSessionsResponse {
repeated Session sessions = 1;
}

message UpdateSessionRequest {
string id = 1;

// metadata is a map of client specific metadata.
map<string, string> metadata = 2;

// env field provides an initial set of environment variables
// for a newly created session.
repeated string env = 3;

// project from which to load environment variables.
// They will be appended to the list from the env field.
// The env field has a higher priority.
optional Project project = 4;
}

message UpdateSessionResponse {
Session session = 1;
}

message DeleteSessionRequest {
string id = 1;
}
Expand Down Expand Up @@ -207,6 +227,7 @@ service RunnerService {
rpc CreateSession(CreateSessionRequest) returns (CreateSessionResponse) {}
rpc GetSession(GetSessionRequest) returns (GetSessionResponse) {}
rpc ListSessions(ListSessionsRequest) returns (ListSessionsResponse) {}
rpc UpdateSession(UpdateSessionRequest) returns (UpdateSessionResponse) {}
rpc DeleteSession(DeleteSessionRequest) returns (DeleteSessionResponse) {}

// Execute executes a program. Examine "ExecuteRequest" to explore
Expand Down
4 changes: 0 additions & 4 deletions internal/command/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ func TestExecutionCommandFromCodeBlocks(t *testing.T) {
t.Run("NativeCommand", func(t *testing.T) {
t.Parallel()

tc := tc

t.Run(tc.name, func(t *testing.T) {
t.Parallel()

Expand All @@ -130,8 +128,6 @@ func TestExecutionCommandFromCodeBlocks(t *testing.T) {
})

t.Run("VirtualCommand", func(t *testing.T) {
t.Parallel()

tc := tc

t.Run(tc.name, func(t *testing.T) {
Expand Down
2 changes: 0 additions & 2 deletions internal/command/env_resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ func TestEnvResolver_Parsing(t *testing.T) {
}

for _, tc := range testCases {
tc := tc

t.Run(tc.name, func(t *testing.T) {
r := NewEnvResolver(tc.source...)
result, err := r.Resolve(strings.NewReader(tc.data))
Expand Down
Loading

0 comments on commit da00f43

Please sign in to comment.