Skip to content

Commit

Permalink
Fix go_package in runnerv2alpha1
Browse files Browse the repository at this point in the history
It also contains typo fixes and additional tests.
  • Loading branch information
adambabik committed Feb 2, 2024
1 parent c55d629 commit fd8617d
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 32 deletions.
2 changes: 1 addition & 1 deletion internal/api/runme/runner/v1/runner.proto
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,6 @@ service RunnerService {
// using the provided sources, which can be a list of environment variables,
// a session, or a project.
// The result contains all found environment variables. If the env is in any source,
// it is considered resolved. Otherwise, it is makred as unresolved.
// it is considered resolved. Otherwise, it is marked as unresolved.
rpc ResolveEnv(ResolveEnvRequest) returns (ResolveEnvResponse) {}
}
2 changes: 1 addition & 1 deletion internal/api/runme/runner/v2alpha1/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package runme.runner.v2alpha1;

option go_package = "github.com/stateful/runme/internal/gen/proto/go/runme/runner/v1;runnerv1";
option go_package = "github.com/stateful/runme/internal/gen/proto/go/runme/runner/v2alpha1;runnerv2alpha1";

enum CommandMode {
COMMAND_MODE_UNSPECIFIED = 0;
Expand Down
4 changes: 2 additions & 2 deletions internal/api/runme/runner/v2alpha1/runner.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package runme.runner.v2alpha1;
import "google/protobuf/wrappers.proto";
import "runme/runner/v2alpha1/config.proto";

option go_package = "github.com/stateful/runme/internal/gen/proto/go/runme/runner/v1;runnerv1";
option go_package = "github.com/stateful/runme/internal/gen/proto/go/runme/runner/v2alpha1;runnerv2alpha1";

message Project {
// root is a root directory of the project.
Expand Down Expand Up @@ -232,6 +232,6 @@ service RunnerService {
// using the provided sources, which can be a list of environment variables,
// a session, or a project.
// The result contains all found environment variables. If the env is in any source,
// it is considered resolved. Otherwise, it is makred as unresolved.
// it is considered resolved. Otherwise, it is marked as unresolved.
rpc ResolveEnv(ResolveEnvRequest) returns (ResolveEnvResponse) {}
}
7 changes: 0 additions & 7 deletions internal/command/command_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,6 @@ func closeOnExec(fd uintptr) {
syscall.CloseOnExec(int(fd))
}

// func setSysProcAttrPgid(cmd *exec.Cmd) {
// if cmd.SysProcAttr == nil {
// cmd.SysProcAttr = &syscall.SysProcAttr{}
// }
// cmd.SysProcAttr.Setpgid = true
// }

func signalPgid(pid int, sig os.Signal) error {
pgid, err := syscall.Getpgid(pid)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/command/env_resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func EnvResolverSourceFunc(env []string) EnvResolverSource {

// EnvResolver uses a list of EnvResolverSource to resolve environment variables
// found in a shell program. The result contains all found environment variables.
// If the env is in any source, it is considered resolved. Otherwise, it is makred
// If the env is in any source, it is considered resolved. Otherwise, it is marked
// as unresolved.
type EnvResolver struct {
sources []EnvResolverSource
Expand Down
4 changes: 2 additions & 2 deletions internal/gen/proto/go/runme/runner/v1/runner_grpc.pb.go

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

10 changes: 5 additions & 5 deletions internal/gen/proto/go/runme/runner/v2alpha1/config.pb.go

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

9 changes: 5 additions & 4 deletions internal/gen/proto/go/runme/runner/v2alpha1/runner.pb.go

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

6 changes: 3 additions & 3 deletions internal/gen/proto/go/runme/runner/v2alpha1/runner_grpc.pb.go

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

4 changes: 2 additions & 2 deletions internal/gen/proto/ts/runme/runner/v1/runner_pb.client.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export interface IRunnerServiceClient {
* using the provided sources, which can be a list of environment variables,
* a session, or a project.
* The result contains all found environment variables. If the env is in any source,
* it is considered resolved. Otherwise, it is makred as unresolved.
* it is considered resolved. Otherwise, it is marked as unresolved.
*
* @generated from protobuf rpc: ResolveEnv(runme.runner.v1.ResolveEnvRequest) returns (runme.runner.v1.ResolveEnvResponse);
*/
Expand Down Expand Up @@ -105,7 +105,7 @@ export declare class RunnerServiceClient implements IRunnerServiceClient, Servic
* using the provided sources, which can be a list of environment variables,
* a session, or a project.
* The result contains all found environment variables. If the env is in any source,
* it is considered resolved. Otherwise, it is makred as unresolved.
* it is considered resolved. Otherwise, it is marked as unresolved.
*
* @generated from protobuf rpc: ResolveEnv(runme.runner.v1.ResolveEnvRequest) returns (runme.runner.v1.ResolveEnvResponse);
*/
Expand Down
2 changes: 1 addition & 1 deletion internal/gen/proto/ts/runme/runner/v1/runner_pb.client.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class RunnerServiceClient {
* using the provided sources, which can be a list of environment variables,
* a session, or a project.
* The result contains all found environment variables. If the env is in any source,
* it is considered resolved. Otherwise, it is makred as unresolved.
* it is considered resolved. Otherwise, it is marked as unresolved.
*
* @generated from protobuf rpc: ResolveEnv(runme.runner.v1.ResolveEnvRequest) returns (runme.runner.v1.ResolveEnvResponse);
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export interface IRunnerServiceClient {
* using the provided sources, which can be a list of environment variables,
* a session, or a project.
* The result contains all found environment variables. If the env is in any source,
* it is considered resolved. Otherwise, it is makred as unresolved.
* it is considered resolved. Otherwise, it is marked as unresolved.
*
* @generated from protobuf rpc: ResolveEnv(runme.runner.v2alpha1.ResolveEnvRequest) returns (runme.runner.v2alpha1.ResolveEnvResponse);
*/
Expand Down Expand Up @@ -115,7 +115,7 @@ export declare class RunnerServiceClient implements IRunnerServiceClient, Servic
* using the provided sources, which can be a list of environment variables,
* a session, or a project.
* The result contains all found environment variables. If the env is in any source,
* it is considered resolved. Otherwise, it is makred as unresolved.
* it is considered resolved. Otherwise, it is marked as unresolved.
*
* @generated from protobuf rpc: ResolveEnv(runme.runner.v2alpha1.ResolveEnvRequest) returns (runme.runner.v2alpha1.ResolveEnvResponse);
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class RunnerServiceClient {
* using the provided sources, which can be a list of environment variables,
* a session, or a project.
* The result contains all found environment variables. If the env is in any source,
* it is considered resolved. Otherwise, it is makred as unresolved.
* it is considered resolved. Otherwise, it is marked as unresolved.
*
* @generated from protobuf rpc: ResolveEnv(runme.runner.v2alpha1.ResolveEnvRequest) returns (runme.runner.v2alpha1.ResolveEnvResponse);
*/
Expand Down
11 changes: 11 additions & 0 deletions internal/runnerv2service/service_resolve_env_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@ func TestRunnerServiceResolveEnv(t *testing.T) {
},
},
},
{
name: "WithAdditionalEnv",
request: &runnerv2alpha1.ResolveEnvRequest{
Env: []string{"TEST_RESOLVED=value", "TEST_EXTRA=value"},
Source: &runnerv2alpha1.ResolveEnvRequest_Commands{
Commands: &runnerv2alpha1.ResolveEnvRequest_CommandList{
Items: []string{"export TEST_RESOLVED=default", "export TEST_UNRESOLVED"},
},
},
},
},
}

for _, tc := range testCases {
Expand Down

0 comments on commit fd8617d

Please sign in to comment.