From 569a9f895a28b94f2dd92b0cc2a49d2c9dc61830 Mon Sep 17 00:00:00 2001 From: Sebastian Tiedtke Date: Fri, 12 Apr 2024 12:30:22 -0400 Subject: [PATCH] Refactor config into kernel, project, etc --- experimental/runme.yaml | 77 +- .../api/runme/config/v1alpha1/config.proto | 94 ++- internal/cmd/beta/beta_cmd.go | 2 +- internal/cmd/beta/server/grpcurl_utils.go | 4 +- internal/cmd/beta/server/server_cmd.go | 2 +- internal/cmd/beta/server/server_start_cmd.go | 12 +- internal/cmd/beta/server/server_stop_cmd.go | 2 +- internal/config/autoconfig/autoconfig.go | 36 +- internal/config/autoconfig/autoconfig_test.go | 4 +- internal/config/config.go | 34 +- internal/config/config_test.go | 45 +- .../go/runme/config/v1alpha1/config.pb.go | 720 ++++++++---------- .../ts/runme/config/v1alpha1/config_pb.d.ts | 252 +++--- .../ts/runme/config/v1alpha1/config_pb.js | 124 ++- testdata/beta/base.txtar | 6 +- testdata/beta/categories.txtar | 3 +- testdata/beta/failure.txtar | 2 +- testdata/beta/find_repo_upward.txtar | 7 +- testdata/beta/project_dir_nested.txtar | 5 +- testdata/beta/server.txtar | 3 +- 20 files changed, 665 insertions(+), 769 deletions(-) diff --git a/experimental/runme.yaml b/experimental/runme.yaml index ccf5a36a..b616a697 100644 --- a/experimental/runme.yaml +++ b/experimental/runme.yaml @@ -6,8 +6,45 @@ # You can test it with the "runme beta" commands. version: v1alpha1 +# config settings that often use default or a set at points of integration +kernel: + server: + # Also unix:///path/to/file.sock is supported. + address: localhost:7890 + tls: + enabled: true + # If not specified, default paths will be used. + # cert_file: "/path/to/cert.pem" + # key_file: "/path/to/key.pem" + + log: + enabled: true + path: "/var/tmp/runme.log" + verbose: true + # config settings that apply at the repo-level -repo: +project: + # Indicate the root of the runme project. "." means that + # the project root directory will be used. + root: "." + # If true, the project root will be searched upwards starting from "dir". + # If found, the repo root will be used as the project root. + find_repo_upward: true + ignore: + - "node_modules" + - ".venv" + disable_gitignore: false + + # It's possible to point at a single file as well. + # filename: "README.md" + + # List of dotenv files to load. + env: + use_system_env: true + sources: + - ".env" + - ".env.local" + # The list of filters to apply to blocks. # "condition" must return a boolean value. # You can learn about the syntax at https://expr-lang.org/docs/language-definition. @@ -22,41 +59,3 @@ repo: # Do not allow code blocks starting with "test". - type: "FILTER_TYPE_BLOCK" condition: "!hasPrefix(name, 'test')" - -# config settings that often use default or a set at points of integration -core: - # Indicate the root of the runme project. "." means that - # the project root directory will be used. - project: - dir: "." - # If true, the project root will be searched upwards starting from "dir". - # If found, the repo root will be used as the project root. - find_repo_upward: true - ignore: - - "node_modules" - - ".venv" - disable_gitignore: false - - # It's possible to point at a single file as well. - # filename: "README.md" - - # List of dotenv files to load. - env: - use_system_env: true - sources: - - ".env" - - ".env.local" - - server: - # Also unix:///path/to/file.sock is supported. - address: localhost:7890 - tls: - enabled: true - # If not specified, default paths will be used. - # cert_file: "/path/to/cert.pem" - # key_file: "/path/to/key.pem" - - log: - enabled: true - path: "/var/tmp/runme.log" - verbose: true diff --git a/internal/api/runme/config/v1alpha1/config.proto b/internal/api/runme/config/v1alpha1/config.proto index c7db428c..be8ddca7 100644 --- a/internal/api/runme/config/v1alpha1/config.proto +++ b/internal/api/runme/config/v1alpha1/config.proto @@ -6,49 +6,12 @@ import "buf/validate/validate.proto"; option go_package = "github.com/stateful/runme/internal/gen/proto/go/runme/config/v1alpha1;configv1alpha1"; -// ConfigCore describes system-level configuration of the runme toolchain. -message ConfigCore { - // source is a source of Markdown files to look into. - oneof source { - option (buf.validate.oneof).required = true; - - // project indicates a dir-based source typically including multiple Markdown files. - Project project = 1; - - // filename indicates a single Markdown file. - string filename = 2; - } - - // env is the environment variables configuration. - Env env = 3; - +// Kernel describes system-level configuration of the runme toolchain. +message Kernel { // log contains the log configuration. - Log log = 7; - - Server server = 8; + Log log = 1; - message Project { - // dir is the directory to look for Markdown files. - string dir = 1; - - // find_repo_upward indicates whether to find the nearest Git repository upward. - // This is useful to, for example, recognize .gitignore files. - bool find_repo_upward = 2; - - // ignore_paths is a list of paths to ignore relative to dir. - repeated string ignore_paths = 3 [json_name = "ignore"]; - - // disable_gitignore indicates whether to disable the .gitignore file. - bool disable_gitignore = 4; - } - - message Env { - // use_system_env indicates whether to use the system environment variables. - bool use_system_env = 1; - - // sources is a list of files with env. - repeated string sources = 2; - } + Server server = 2; message Log { // enabled indicates whether to enable logging. @@ -74,12 +37,44 @@ message ConfigCore { } } -// ConfigRepo describes repo-level configuration of the runme toolchain. -message ConfigRepo { +// Project describes repo-level configuration of the runme toolchain. +message Project { + // source is a source of Markdown files to look into. + oneof source { + option (buf.validate.oneof).required = true; + + // root indicates a dir-based source typically including multiple Markdown files. + string root = 1; + + // filename indicates a single Markdown file. + string filename = 2; + } + + // env is the environment variables configuration. + Env env = 3; + + // find_repo_upward indicates whether to find the nearest Git repository upward. + // This is useful to, for example, recognize .gitignore files. + bool find_repo_upward = 4; + + // ignore_paths is a list of paths to ignore relative to dir. + repeated string ignore_paths = 5 [json_name = "ignore"]; + + // disable_gitignore indicates whether to disable the .gitignore file. + bool disable_gitignore = 6; + // filters is a list of filters to apply. // Filters can be applied to documents or // individual code blocks. - repeated Filter filters = 5; + repeated Filter filters = 7; + + message Env { + // use_system_env indicates whether to use the system environment variables. + bool use_system_env = 1; + + // sources is a list of files with env. + repeated string sources = 2; + } message Filter { // type is the type of the filter. @@ -105,9 +100,12 @@ message ConfigRepo { // Config describes the configuration of the runme toolchain, including CLI, server, and clients like VS Code extension. message Config { - // core is the system-level configuration. - ConfigCore core = 1; + // kernel is the system-level configuration and config that's not specific to one single client + Kernel kernel = 1; + + // project contains configuration applicable to the project inside a repo. + Project project = 2; - // repo is the repo-level configuration. - ConfigRepo repo = 2; + // will likely add document to overwrite frontmatter in documents per dir when nested + // Document document = 3; } diff --git a/internal/cmd/beta/beta_cmd.go b/internal/cmd/beta/beta_cmd.go index c8f62c63..db159082 100644 --- a/internal/cmd/beta/beta_cmd.go +++ b/internal/cmd/beta/beta_cmd.go @@ -30,7 +30,7 @@ All commands use the runme.yaml configuration file.`, return autoconfig.Invoke(func(cfg *config.Config) error { // Override the filename if provided. if cFlags.filename != "" { - cfg.Core.Filename = cFlags.filename + cfg.Kernel.Filename = cFlags.filename } // Add a filter to run only tasks from the specified categories. diff --git a/internal/cmd/beta/server/grpcurl_utils.go b/internal/cmd/beta/server/grpcurl_utils.go index 94bbd2b2..191a0345 100644 --- a/internal/cmd/beta/server/grpcurl_utils.go +++ b/internal/cmd/beta/server/grpcurl_utils.go @@ -27,14 +27,14 @@ func getDescriptorSource(ctx context.Context, cfg *config.Config) (grpcurl.Descr } func dialServer(ctx context.Context, cfg *config.Config) (*grpc.ClientConn, error) { - tlsConf, err := runmetls.LoadClientConfig(cfg.Core.ServerTLSCertFile, cfg.Core.ServerTLSKeyFile) + tlsConf, err := runmetls.LoadClientConfig(cfg.Kernel.ServerTLSCertFile, cfg.Kernel.ServerTLSKeyFile) if err != nil { return nil, err } creds := credentials.NewTLS(tlsConf) - network, addr := "tcp", cfg.Core.ServerAddress + network, addr := "tcp", cfg.Kernel.ServerAddress if strings.HasPrefix(addr, "unix://") { network, addr = "unix", strings.TrimPrefix(addr, "unix://") } diff --git a/internal/cmd/beta/server/server_cmd.go b/internal/cmd/beta/server/server_cmd.go index c06b132f..d0ffd447 100644 --- a/internal/cmd/beta/server/server_cmd.go +++ b/internal/cmd/beta/server/server_cmd.go @@ -19,7 +19,7 @@ func Cmd() *cobra.Command { ) error { // For the server commands, we want to always log to stdout. // TODO(adamb): there might be a need to separate client and server logs. - cfg.Core.LogPath = "" + cfg.Kernel.LogPath = "" return nil }, ) diff --git a/internal/cmd/beta/server/server_start_cmd.go b/internal/cmd/beta/server/server_start_cmd.go index df01c121..026cd814 100644 --- a/internal/cmd/beta/server/server_start_cmd.go +++ b/internal/cmd/beta/server/server_start_cmd.go @@ -25,10 +25,10 @@ func serverStartCmd() *cobra.Command { defer logger.Sync() serverCfg := &server.Config{ - Address: cfg.Core.ServerAddress, - CertFile: cfg.Core.ServerTLSCertFile, - KeyFile: cfg.Core.ServerTLSKeyFile, - TLSEnabled: cfg.Core.ServerTLSEnabled, + Address: cfg.Kernel.ServerAddress, + CertFile: cfg.Kernel.ServerTLSCertFile, + KeyFile: cfg.Kernel.ServerTLSKeyFile, + TLSEnabled: cfg.Kernel.ServerTLSEnabled, } logger.Debug("server config", zap.Any("config", serverCfg)) @@ -39,12 +39,12 @@ func serverStartCmd() *cobra.Command { } // When using a unix socket, we want to create a file with server's PID. - if path := pidFileNameFromAddr(cfg.Core.ServerAddress); path != "" { + if path := pidFileNameFromAddr(cfg.Kernel.ServerAddress); path != "" { logger.Debug("creating PID file", zap.String("path", path)) if err := createFileWithPID(path); err != nil { return errors.WithStack(err) } - defer os.Remove(cfg.Core.ServerAddress) + defer os.Remove(cfg.Kernel.ServerAddress) } return errors.WithStack(s.Serve()) diff --git a/internal/cmd/beta/server/server_stop_cmd.go b/internal/cmd/beta/server/server_stop_cmd.go index e9e737bf..660ab1ab 100644 --- a/internal/cmd/beta/server/server_stop_cmd.go +++ b/internal/cmd/beta/server/server_stop_cmd.go @@ -26,7 +26,7 @@ func serverStopCmd() *cobra.Command { logger.Debug("stopping the server by looking for runme.pid") - path := pidFileNameFromAddr(cfg.Core.ServerAddress) + path := pidFileNameFromAddr(cfg.Kernel.ServerAddress) if path == "" { return errors.New("server address is not a unix socket") } diff --git a/internal/config/autoconfig/autoconfig.go b/internal/config/autoconfig/autoconfig.go index ea05e768..b759f23a 100644 --- a/internal/config/autoconfig/autoconfig.go +++ b/internal/config/autoconfig/autoconfig.go @@ -102,12 +102,12 @@ func getConfig(userCfgDir UserConfigDir, viper *viper.Viper) (*config.Config, er return nil, err } - if cfg.Core.ServerTLSEnabled { - if cfg.Core.ServerTLSCertFile == "" { - cfg.Core.ServerTLSCertFile = filepath.Join(string(userCfgDir), "cert.pem") + if cfg.Kernel.ServerTLSEnabled { + if cfg.Kernel.ServerTLSCertFile == "" { + cfg.Kernel.ServerTLSCertFile = filepath.Join(string(userCfgDir), "cert.pem") } - if cfg.Core.ServerTLSKeyFile == "" { - cfg.Core.ServerTLSKeyFile = filepath.Join(string(userCfgDir), "key.pem") + if cfg.Kernel.ServerTLSKeyFile == "" { + cfg.Kernel.ServerTLSKeyFile = filepath.Join(string(userCfgDir), "key.pem") } } @@ -115,7 +115,7 @@ func getConfig(userCfgDir UserConfigDir, viper *viper.Viper) (*config.Config, er } func getLogger(c *config.Config) (*zap.Logger, error) { - if c == nil || !c.Core.LogEnabled { + if c == nil || !c.Kernel.LogEnabled { return zap.NewNop(), nil } @@ -132,16 +132,16 @@ func getLogger(c *config.Config) (*zap.Logger, error) { ErrorOutputPaths: []string{"stderr"}, } - if c.Core.LogVerbose { + if c.Kernel.LogVerbose { zapConfig.Level = zap.NewAtomicLevelAt(zap.DebugLevel) zapConfig.Development = true zapConfig.Encoding = "console" zapConfig.EncoderConfig = zap.NewDevelopmentEncoderConfig() } - if c.Core.LogPath != "" { - zapConfig.OutputPaths = []string{c.Core.LogPath} - zapConfig.ErrorOutputPaths = []string{c.Core.LogPath} + if c.Kernel.LogPath != "" { + zapConfig.OutputPaths = []string{c.Kernel.LogPath} + zapConfig.ErrorOutputPaths = []string{c.Kernel.LogPath} } l, err := zapConfig.Build() @@ -153,11 +153,11 @@ func getProject(c *config.Config, logger *zap.Logger) (*project.Project, error) project.WithLogger(logger), } - if c.Core.Filename != "" { - return project.NewFileProject(c.Core.Filename, opts...) + if c.Kernel.Filename != "" { + return project.NewFileProject(c.Kernel.Filename, opts...) } - projDir := c.Core.ProjectDir + projDir := c.Kernel.ProjectDir // If no project directory is specified, use the current directory. if projDir == "" { projDir = "." @@ -165,12 +165,12 @@ func getProject(c *config.Config, logger *zap.Logger) (*project.Project, error) opts = append( opts, - project.WithIgnoreFilePatterns(c.Core.IgnorePaths...), - project.WithRespectGitignore(!c.Core.DisableGitignore), - project.WithEnvFilesReadOrder(c.Core.EnvSourceFiles), + project.WithIgnoreFilePatterns(c.Kernel.IgnorePaths...), + project.WithRespectGitignore(!c.Kernel.DisableGitignore), + project.WithEnvFilesReadOrder(c.Kernel.EnvSourceFiles), ) - if c.Core.FindRepoUpward { + if c.Kernel.FindRepoUpward { opts = append(opts, project.WithFindRepoUpward()) } @@ -228,7 +228,7 @@ func getProjectFilters(c *config.Config) ([]project.Filter, error) { func getSession(cfg *config.Config, proj *project.Project) (*command.Session, error) { sess := command.NewSession() - if cfg.Core.UseSystemEnv { + if cfg.Kernel.UseSystemEnv { if err := sess.SetEnv(os.Environ()...); err != nil { return nil, err } diff --git a/internal/config/autoconfig/autoconfig_test.go b/internal/config/autoconfig/autoconfig_test.go index 8f3933fd..ba2c66c0 100644 --- a/internal/config/autoconfig/autoconfig_test.go +++ b/internal/config/autoconfig/autoconfig_test.go @@ -26,9 +26,7 @@ func TestInvokeAll(t *testing.T) { // Create a runme.yaml using the README.md file from above. // This won't work with the project as it requires the project // to be a subdirectory of the current working directory. - configYAML := fmt.Sprintf("version: v1alpha1\ncore:\n filename: %s\n", readmeFilePath) - - fmt.Println(string(configYAML)) + configYAML := fmt.Sprintf("version: v1alpha1\nproject:\n filename: %s\n", readmeFilePath) // Create a runme.yaml file in the temp directory. err = os.WriteFile(filepath.Join(tempDir, "/runme.yaml"), []byte(configYAML), 0o600) diff --git a/internal/config/config.go b/internal/config/config.go index 008224be..bde20f11 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -15,7 +15,7 @@ import ( configv1alpha1 "github.com/stateful/runme/v3/internal/gen/proto/go/runme/config/v1alpha1" ) -type ConfigCore struct { +type ConfigKernel struct { // Dir- or git-based project fields. DisableGitignore bool IgnorePaths []string @@ -48,8 +48,8 @@ type ConfigRepo struct { // Config is a flatten configuration of runme.yaml. The purpose of it is to // unify all the different configuration versions into a single struct. type Config struct { - Core ConfigCore - Repo ConfigRepo + Kernel ConfigKernel + Repo ConfigRepo } func ParseYAML(data []byte) (*Config, error) { @@ -119,11 +119,11 @@ func parseYAMLv1alpha1(data []byte) (*configv1alpha1.Config, error) { } func configV1alpha1ToConfig(c *configv1alpha1.Config) *Config { - project := c.Core.GetProject() - log := c.Core.GetLog() + project := c.GetProject() + log := c.Kernel.GetLog() var filters []*Filter - for _, f := range c.Repo.GetFilters() { + for _, f := range c.Project.GetFilters() { filters = append(filters, &Filter{ Type: f.GetType().String(), Condition: f.GetCondition(), @@ -131,25 +131,25 @@ func configV1alpha1ToConfig(c *configv1alpha1.Config) *Config { } return &Config{ - Core: ConfigCore{ - ProjectDir: project.GetDir(), + Kernel: ConfigKernel{ + ProjectDir: project.GetRoot(), FindRepoUpward: project.GetFindRepoUpward(), IgnorePaths: project.GetIgnorePaths(), DisableGitignore: project.GetDisableGitignore(), - Filename: c.Core.GetFilename(), + Filename: project.GetFilename(), - UseSystemEnv: c.Core.GetEnv().GetUseSystemEnv(), - EnvSourceFiles: c.Core.GetEnv().GetSources(), + UseSystemEnv: project.GetEnv().GetUseSystemEnv(), + EnvSourceFiles: project.GetEnv().GetSources(), LogEnabled: log.GetEnabled(), LogPath: log.GetPath(), LogVerbose: log.GetVerbose(), - ServerAddress: c.Core.GetServer().GetAddress(), - ServerTLSEnabled: c.Core.GetServer().GetTls().GetEnabled(), - ServerTLSCertFile: c.Core.GetServer().GetTls().GetCertFile(), - ServerTLSKeyFile: c.Core.GetServer().GetTls().GetKeyFile(), + ServerAddress: c.Kernel.GetServer().GetAddress(), + ServerTLSEnabled: c.Kernel.GetServer().GetTls().GetEnabled(), + ServerTLSCertFile: c.Kernel.GetServer().GetTls().GetCertFile(), + ServerTLSKeyFile: c.Kernel.GetServer().GetTls().GetKeyFile(), }, Repo: ConfigRepo{ Filters: filters, @@ -175,7 +175,7 @@ func validateConfig(cfg *Config) error { } func validateProjectDir(cfg *Config, cwd string) error { - rel, err := filepath.Rel(cwd, filepath.Join(cwd, cfg.Core.ProjectDir)) + rel, err := filepath.Rel(cwd, filepath.Join(cwd, cfg.Kernel.ProjectDir)) if err != nil { return errors.WithStack(err) } @@ -187,7 +187,7 @@ func validateProjectDir(cfg *Config, cwd string) error { } func validateFilename(cfg *Config, cwd string) error { - rel, err := filepath.Rel(cwd, filepath.Join(cwd, cfg.Core.Filename)) + rel, err := filepath.Rel(cwd, filepath.Join(cwd, cfg.Kernel.Filename)) if err != nil { return errors.WithStack(err) } diff --git a/internal/config/config_test.go b/internal/config/config_test.go index d7c9b392..815206e2 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -22,8 +22,8 @@ func TestParseYAML(t *testing.T) { }, { name: "minimal config v1alpha1", - rawConfig: "version: v1alpha1\ncore:\n filename: REAEDME.md\n", - expectedConfig: &Config{Core: ConfigCore{Filename: "REAEDME.md"}}, + rawConfig: "version: v1alpha1\nproject:\n filename: REAEDME.md\n", + expectedConfig: &Config{Kernel: ConfigKernel{Filename: "REAEDME.md"}}, }, { name: "validate source", @@ -32,22 +32,22 @@ func TestParseYAML(t *testing.T) { }, { name: "project and filename", - rawConfig: "version: v1alpha1\ncore:\n project:\n dir: \".\"\n filename: \"README.md\"\n", - errorSubstring: "error parsing \"project\", oneof runme.config.v1alpha1.ConfigCore.source is already set", + rawConfig: "version: v1alpha1\nproject:\n root: \".\"\n filename: \"README.md\"\n", + errorSubstring: "error parsing \"root\", oneof runme.config.v1alpha1.Project.source is already set", }, { name: "validate filter type", - rawConfig: "version: v1alpha1\ncore:\n filename: README.md\nrepo:\n filters:\n - type: 3\n condition: \"name != ''\"\n", - errorSubstring: "failed to validate v1alpha1 config: validation error:\n - repo.filters[0].type: value must be one of the defined enum values", + rawConfig: "version: v1alpha1\nproject:\n filename: README.md\n filters:\n - type: 3\n condition: \"name != ''\"\n", + errorSubstring: "failed to validate v1alpha1 config: validation error:\n - project.filters[0].type: value must be one of the defined enum values", }, { name: "validate project within cwd", - rawConfig: "version: v1alpha1\ncore:\n project:\n dir: '..'\n", + rawConfig: "version: v1alpha1\nproject:\n root: '..'\n", errorSubstring: "failed to validate config: failed to validate project dir: outside of current working directory", }, { name: "validate filename within cwd", - rawConfig: "version: v1alpha1\ncore:\n filename: '../README.md'\n", + rawConfig: "version: v1alpha1\nproject:\n filename: '../README.md'\n", errorSubstring: "failed to validate config: failed to validate filename: outside of current working directory", }, } @@ -79,32 +79,31 @@ func TestParseYAML(t *testing.T) { var ( testConfigV1alpha1Raw = `version: v1alpha1 -core: - project: - dir: "." - find_repo_upward: true - ignore: - - "node_modules" - - ".venv" - disable_gitignore: false - - env: - sources: - - ".env" - +kernel: log: enabled: true path: "/var/tmp/runme.log" verbose: true -repo: +project: + root: "." + find_repo_upward: true + ignore: + - "node_modules" + - ".venv" + disable_gitignore: false + + env: + sources: + - ".env" + filters: - type: "FILTER_TYPE_BLOCK" condition: "name != ''" ` testConfigV1alpha1 = &Config{ - Core: ConfigCore{ + Kernel: ConfigKernel{ ProjectDir: ".", FindRepoUpward: true, IgnorePaths: []string{"node_modules", ".venv"}, diff --git a/internal/gen/proto/go/runme/config/v1alpha1/config.pb.go b/internal/gen/proto/go/runme/config/v1alpha1/config.pb.go index d0c4f534..66bac19e 100644 --- a/internal/gen/proto/go/runme/config/v1alpha1/config.pb.go +++ b/internal/gen/proto/go/runme/config/v1alpha1/config.pb.go @@ -21,77 +21,68 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -type ConfigRepo_FilterType int32 +type Project_FilterType int32 const ( - ConfigRepo_FILTER_TYPE_UNSPECIFIED ConfigRepo_FilterType = 0 - ConfigRepo_FILTER_TYPE_BLOCK ConfigRepo_FilterType = 1 - ConfigRepo_FILTER_TYPE_DOCUMENT ConfigRepo_FilterType = 2 + Project_FILTER_TYPE_UNSPECIFIED Project_FilterType = 0 + Project_FILTER_TYPE_BLOCK Project_FilterType = 1 + Project_FILTER_TYPE_DOCUMENT Project_FilterType = 2 ) -// Enum value maps for ConfigRepo_FilterType. +// Enum value maps for Project_FilterType. var ( - ConfigRepo_FilterType_name = map[int32]string{ + Project_FilterType_name = map[int32]string{ 0: "FILTER_TYPE_UNSPECIFIED", 1: "FILTER_TYPE_BLOCK", 2: "FILTER_TYPE_DOCUMENT", } - ConfigRepo_FilterType_value = map[string]int32{ + Project_FilterType_value = map[string]int32{ "FILTER_TYPE_UNSPECIFIED": 0, "FILTER_TYPE_BLOCK": 1, "FILTER_TYPE_DOCUMENT": 2, } ) -func (x ConfigRepo_FilterType) Enum() *ConfigRepo_FilterType { - p := new(ConfigRepo_FilterType) +func (x Project_FilterType) Enum() *Project_FilterType { + p := new(Project_FilterType) *p = x return p } -func (x ConfigRepo_FilterType) String() string { +func (x Project_FilterType) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (ConfigRepo_FilterType) Descriptor() protoreflect.EnumDescriptor { +func (Project_FilterType) Descriptor() protoreflect.EnumDescriptor { return file_runme_config_v1alpha1_config_proto_enumTypes[0].Descriptor() } -func (ConfigRepo_FilterType) Type() protoreflect.EnumType { +func (Project_FilterType) Type() protoreflect.EnumType { return &file_runme_config_v1alpha1_config_proto_enumTypes[0] } -func (x ConfigRepo_FilterType) Number() protoreflect.EnumNumber { +func (x Project_FilterType) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } -// Deprecated: Use ConfigRepo_FilterType.Descriptor instead. -func (ConfigRepo_FilterType) EnumDescriptor() ([]byte, []int) { +// Deprecated: Use Project_FilterType.Descriptor instead. +func (Project_FilterType) EnumDescriptor() ([]byte, []int) { return file_runme_config_v1alpha1_config_proto_rawDescGZIP(), []int{1, 0} } -// ConfigCore describes system-level configuration of the runme toolchain. -type ConfigCore struct { +// Kernel describes system-level configuration of the runme toolchain. +type Kernel struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // source is a source of Markdown files to look into. - // - // Types that are assignable to Source: - // - // *ConfigCore_Project_ - // *ConfigCore_Filename - Source isConfigCore_Source `protobuf_oneof:"source"` - // env is the environment variables configuration. - Env *ConfigCore_Env `protobuf:"bytes,3,opt,name=env,proto3" json:"env,omitempty"` // log contains the log configuration. - Log *ConfigCore_Log `protobuf:"bytes,7,opt,name=log,proto3" json:"log,omitempty"` - Server *ConfigCore_Server `protobuf:"bytes,8,opt,name=server,proto3" json:"server,omitempty"` + Log *Kernel_Log `protobuf:"bytes,1,opt,name=log,proto3" json:"log,omitempty"` + Server *Kernel_Server `protobuf:"bytes,2,opt,name=server,proto3" json:"server,omitempty"` } -func (x *ConfigCore) Reset() { - *x = ConfigCore{} +func (x *Kernel) Reset() { + *x = Kernel{} if protoimpl.UnsafeEnabled { mi := &file_runme_config_v1alpha1_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -99,13 +90,13 @@ func (x *ConfigCore) Reset() { } } -func (x *ConfigCore) String() string { +func (x *Kernel) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ConfigCore) ProtoMessage() {} +func (*Kernel) ProtoMessage() {} -func (x *ConfigCore) ProtoReflect() protoreflect.Message { +func (x *Kernel) ProtoReflect() protoreflect.Message { mi := &file_runme_config_v1alpha1_config_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -117,85 +108,55 @@ func (x *ConfigCore) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ConfigCore.ProtoReflect.Descriptor instead. -func (*ConfigCore) Descriptor() ([]byte, []int) { +// Deprecated: Use Kernel.ProtoReflect.Descriptor instead. +func (*Kernel) Descriptor() ([]byte, []int) { return file_runme_config_v1alpha1_config_proto_rawDescGZIP(), []int{0} } -func (m *ConfigCore) GetSource() isConfigCore_Source { - if m != nil { - return m.Source - } - return nil -} - -func (x *ConfigCore) GetProject() *ConfigCore_Project { - if x, ok := x.GetSource().(*ConfigCore_Project_); ok { - return x.Project - } - return nil -} - -func (x *ConfigCore) GetFilename() string { - if x, ok := x.GetSource().(*ConfigCore_Filename); ok { - return x.Filename - } - return "" -} - -func (x *ConfigCore) GetEnv() *ConfigCore_Env { - if x != nil { - return x.Env - } - return nil -} - -func (x *ConfigCore) GetLog() *ConfigCore_Log { +func (x *Kernel) GetLog() *Kernel_Log { if x != nil { return x.Log } return nil } -func (x *ConfigCore) GetServer() *ConfigCore_Server { +func (x *Kernel) GetServer() *Kernel_Server { if x != nil { return x.Server } return nil } -type isConfigCore_Source interface { - isConfigCore_Source() -} - -type ConfigCore_Project_ struct { - // project indicates a dir-based source typically including multiple Markdown files. - Project *ConfigCore_Project `protobuf:"bytes,1,opt,name=project,proto3,oneof"` -} - -type ConfigCore_Filename struct { - // filename indicates a single Markdown file. - Filename string `protobuf:"bytes,2,opt,name=filename,proto3,oneof"` -} - -func (*ConfigCore_Project_) isConfigCore_Source() {} - -func (*ConfigCore_Filename) isConfigCore_Source() {} - -// ConfigRepo describes repo-level configuration of the runme toolchain. -type ConfigRepo struct { +// Project describes repo-level configuration of the runme toolchain. +type Project struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // source is a source of Markdown files to look into. + // + // Types that are assignable to Source: + // + // *Project_Root + // *Project_Filename + Source isProject_Source `protobuf_oneof:"source"` + // env is the environment variables configuration. + Env *Project_Env `protobuf:"bytes,3,opt,name=env,proto3" json:"env,omitempty"` + // find_repo_upward indicates whether to find the nearest Git repository upward. + // This is useful to, for example, recognize .gitignore files. + FindRepoUpward bool `protobuf:"varint,4,opt,name=find_repo_upward,json=findRepoUpward,proto3" json:"find_repo_upward,omitempty"` + // ignore_paths is a list of paths to ignore relative to dir. + IgnorePaths []string `protobuf:"bytes,5,rep,name=ignore_paths,json=ignore,proto3" json:"ignore_paths,omitempty"` + // disable_gitignore indicates whether to disable the .gitignore file. + DisableGitignore bool `protobuf:"varint,6,opt,name=disable_gitignore,json=disableGitignore,proto3" json:"disable_gitignore,omitempty"` // filters is a list of filters to apply. // Filters can be applied to documents or // individual code blocks. - Filters []*ConfigRepo_Filter `protobuf:"bytes,5,rep,name=filters,proto3" json:"filters,omitempty"` + Filters []*Project_Filter `protobuf:"bytes,7,rep,name=filters,proto3" json:"filters,omitempty"` } -func (x *ConfigRepo) Reset() { - *x = ConfigRepo{} +func (x *Project) Reset() { + *x = Project{} if protoimpl.UnsafeEnabled { mi := &file_runme_config_v1alpha1_config_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -203,13 +164,13 @@ func (x *ConfigRepo) Reset() { } } -func (x *ConfigRepo) String() string { +func (x *Project) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ConfigRepo) ProtoMessage() {} +func (*Project) ProtoMessage() {} -func (x *ConfigRepo) ProtoReflect() protoreflect.Message { +func (x *Project) ProtoReflect() protoreflect.Message { mi := &file_runme_config_v1alpha1_config_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -221,28 +182,95 @@ func (x *ConfigRepo) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ConfigRepo.ProtoReflect.Descriptor instead. -func (*ConfigRepo) Descriptor() ([]byte, []int) { +// Deprecated: Use Project.ProtoReflect.Descriptor instead. +func (*Project) Descriptor() ([]byte, []int) { return file_runme_config_v1alpha1_config_proto_rawDescGZIP(), []int{1} } -func (x *ConfigRepo) GetFilters() []*ConfigRepo_Filter { +func (m *Project) GetSource() isProject_Source { + if m != nil { + return m.Source + } + return nil +} + +func (x *Project) GetRoot() string { + if x, ok := x.GetSource().(*Project_Root); ok { + return x.Root + } + return "" +} + +func (x *Project) GetFilename() string { + if x, ok := x.GetSource().(*Project_Filename); ok { + return x.Filename + } + return "" +} + +func (x *Project) GetEnv() *Project_Env { + if x != nil { + return x.Env + } + return nil +} + +func (x *Project) GetFindRepoUpward() bool { + if x != nil { + return x.FindRepoUpward + } + return false +} + +func (x *Project) GetIgnorePaths() []string { + if x != nil { + return x.IgnorePaths + } + return nil +} + +func (x *Project) GetDisableGitignore() bool { + if x != nil { + return x.DisableGitignore + } + return false +} + +func (x *Project) GetFilters() []*Project_Filter { if x != nil { return x.Filters } return nil } +type isProject_Source interface { + isProject_Source() +} + +type Project_Root struct { + // root indicates a dir-based source typically including multiple Markdown files. + Root string `protobuf:"bytes,1,opt,name=root,proto3,oneof"` +} + +type Project_Filename struct { + // filename indicates a single Markdown file. + Filename string `protobuf:"bytes,2,opt,name=filename,proto3,oneof"` +} + +func (*Project_Root) isProject_Source() {} + +func (*Project_Filename) isProject_Source() {} + // Config describes the configuration of the runme toolchain, including CLI, server, and clients like VS Code extension. type Config struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // core is the system-level configuration. - Core *ConfigCore `protobuf:"bytes,1,opt,name=core,proto3" json:"core,omitempty"` - // repo is the repo-level configuration. - Repo *ConfigRepo `protobuf:"bytes,2,opt,name=repo,proto3" json:"repo,omitempty"` + // kernel is the system-level configuration. + Kernel *Kernel `protobuf:"bytes,1,opt,name=kernel,proto3" json:"kernel,omitempty"` + // project contains configuration applicable to the project inside a repo. + Project *Project `protobuf:"bytes,2,opt,name=project,proto3" json:"project,omitempty"` } func (x *Config) Reset() { @@ -277,38 +305,35 @@ func (*Config) Descriptor() ([]byte, []int) { return file_runme_config_v1alpha1_config_proto_rawDescGZIP(), []int{2} } -func (x *Config) GetCore() *ConfigCore { +func (x *Config) GetKernel() *Kernel { if x != nil { - return x.Core + return x.Kernel } return nil } -func (x *Config) GetRepo() *ConfigRepo { +func (x *Config) GetProject() *Project { if x != nil { - return x.Repo + return x.Project } return nil } -type ConfigCore_Project struct { +type Kernel_Log struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // dir is the directory to look for Markdown files. - Dir string `protobuf:"bytes,1,opt,name=dir,proto3" json:"dir,omitempty"` - // find_repo_upward indicates whether to find the nearest Git repository upward. - // This is useful to, for example, recognize .gitignore files. - FindRepoUpward bool `protobuf:"varint,2,opt,name=find_repo_upward,json=findRepoUpward,proto3" json:"find_repo_upward,omitempty"` - // ignore_paths is a list of paths to ignore relative to dir. - IgnorePaths []string `protobuf:"bytes,3,rep,name=ignore_paths,json=ignore,proto3" json:"ignore_paths,omitempty"` - // disable_gitignore indicates whether to disable the .gitignore file. - DisableGitignore bool `protobuf:"varint,4,opt,name=disable_gitignore,json=disableGitignore,proto3" json:"disable_gitignore,omitempty"` + // enabled indicates whether to enable logging. + Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` + // path is the path to the log output file. + Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` + // verbose is the verbosity level of the log. + Verbose bool `protobuf:"varint,3,opt,name=verbose,proto3" json:"verbose,omitempty"` } -func (x *ConfigCore_Project) Reset() { - *x = ConfigCore_Project{} +func (x *Kernel_Log) Reset() { + *x = Kernel_Log{} if protoimpl.UnsafeEnabled { mi := &file_runme_config_v1alpha1_config_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -316,13 +341,13 @@ func (x *ConfigCore_Project) Reset() { } } -func (x *ConfigCore_Project) String() string { +func (x *Kernel_Log) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ConfigCore_Project) ProtoMessage() {} +func (*Kernel_Log) ProtoMessage() {} -func (x *ConfigCore_Project) ProtoReflect() protoreflect.Message { +func (x *Kernel_Log) ProtoReflect() protoreflect.Message { mi := &file_runme_config_v1alpha1_config_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -334,52 +359,43 @@ func (x *ConfigCore_Project) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ConfigCore_Project.ProtoReflect.Descriptor instead. -func (*ConfigCore_Project) Descriptor() ([]byte, []int) { +// Deprecated: Use Kernel_Log.ProtoReflect.Descriptor instead. +func (*Kernel_Log) Descriptor() ([]byte, []int) { return file_runme_config_v1alpha1_config_proto_rawDescGZIP(), []int{0, 0} } -func (x *ConfigCore_Project) GetDir() string { - if x != nil { - return x.Dir - } - return "" -} - -func (x *ConfigCore_Project) GetFindRepoUpward() bool { +func (x *Kernel_Log) GetEnabled() bool { if x != nil { - return x.FindRepoUpward + return x.Enabled } return false } -func (x *ConfigCore_Project) GetIgnorePaths() []string { +func (x *Kernel_Log) GetPath() string { if x != nil { - return x.IgnorePaths + return x.Path } - return nil + return "" } -func (x *ConfigCore_Project) GetDisableGitignore() bool { +func (x *Kernel_Log) GetVerbose() bool { if x != nil { - return x.DisableGitignore + return x.Verbose } return false } -type ConfigCore_Env struct { +type Kernel_Server struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // use_system_env indicates whether to use the system environment variables. - UseSystemEnv bool `protobuf:"varint,1,opt,name=use_system_env,json=useSystemEnv,proto3" json:"use_system_env,omitempty"` - // sources is a list of files with env. - Sources []string `protobuf:"bytes,2,rep,name=sources,proto3" json:"sources,omitempty"` + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Tls *Kernel_Server_TLS `protobuf:"bytes,2,opt,name=tls,proto3" json:"tls,omitempty"` } -func (x *ConfigCore_Env) Reset() { - *x = ConfigCore_Env{} +func (x *Kernel_Server) Reset() { + *x = Kernel_Server{} if protoimpl.UnsafeEnabled { mi := &file_runme_config_v1alpha1_config_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -387,13 +403,13 @@ func (x *ConfigCore_Env) Reset() { } } -func (x *ConfigCore_Env) String() string { +func (x *Kernel_Server) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ConfigCore_Env) ProtoMessage() {} +func (*Kernel_Server) ProtoMessage() {} -func (x *ConfigCore_Env) ProtoReflect() protoreflect.Message { +func (x *Kernel_Server) ProtoReflect() protoreflect.Message { mi := &file_runme_config_v1alpha1_config_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -405,40 +421,37 @@ func (x *ConfigCore_Env) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ConfigCore_Env.ProtoReflect.Descriptor instead. -func (*ConfigCore_Env) Descriptor() ([]byte, []int) { +// Deprecated: Use Kernel_Server.ProtoReflect.Descriptor instead. +func (*Kernel_Server) Descriptor() ([]byte, []int) { return file_runme_config_v1alpha1_config_proto_rawDescGZIP(), []int{0, 1} } -func (x *ConfigCore_Env) GetUseSystemEnv() bool { +func (x *Kernel_Server) GetAddress() string { if x != nil { - return x.UseSystemEnv + return x.Address } - return false + return "" } -func (x *ConfigCore_Env) GetSources() []string { +func (x *Kernel_Server) GetTls() *Kernel_Server_TLS { if x != nil { - return x.Sources + return x.Tls } return nil } -type ConfigCore_Log struct { +type Kernel_Server_TLS struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // enabled indicates whether to enable logging. - Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` - // path is the path to the log output file. - Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` - // verbose is the verbosity level of the log. - Verbose bool `protobuf:"varint,3,opt,name=verbose,proto3" json:"verbose,omitempty"` + Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` + CertFile string `protobuf:"bytes,2,opt,name=cert_file,json=certFile,proto3" json:"cert_file,omitempty"` + KeyFile string `protobuf:"bytes,3,opt,name=key_file,json=keyFile,proto3" json:"key_file,omitempty"` } -func (x *ConfigCore_Log) Reset() { - *x = ConfigCore_Log{} +func (x *Kernel_Server_TLS) Reset() { + *x = Kernel_Server_TLS{} if protoimpl.UnsafeEnabled { mi := &file_runme_config_v1alpha1_config_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -446,13 +459,13 @@ func (x *ConfigCore_Log) Reset() { } } -func (x *ConfigCore_Log) String() string { +func (x *Kernel_Server_TLS) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ConfigCore_Log) ProtoMessage() {} +func (*Kernel_Server_TLS) ProtoMessage() {} -func (x *ConfigCore_Log) ProtoReflect() protoreflect.Message { +func (x *Kernel_Server_TLS) ProtoReflect() protoreflect.Message { mi := &file_runme_config_v1alpha1_config_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -464,43 +477,45 @@ func (x *ConfigCore_Log) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ConfigCore_Log.ProtoReflect.Descriptor instead. -func (*ConfigCore_Log) Descriptor() ([]byte, []int) { - return file_runme_config_v1alpha1_config_proto_rawDescGZIP(), []int{0, 2} +// Deprecated: Use Kernel_Server_TLS.ProtoReflect.Descriptor instead. +func (*Kernel_Server_TLS) Descriptor() ([]byte, []int) { + return file_runme_config_v1alpha1_config_proto_rawDescGZIP(), []int{0, 1, 0} } -func (x *ConfigCore_Log) GetEnabled() bool { +func (x *Kernel_Server_TLS) GetEnabled() bool { if x != nil { return x.Enabled } return false } -func (x *ConfigCore_Log) GetPath() string { +func (x *Kernel_Server_TLS) GetCertFile() string { if x != nil { - return x.Path + return x.CertFile } return "" } -func (x *ConfigCore_Log) GetVerbose() bool { +func (x *Kernel_Server_TLS) GetKeyFile() string { if x != nil { - return x.Verbose + return x.KeyFile } - return false + return "" } -type ConfigCore_Server struct { +type Project_Env struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Tls *ConfigCore_Server_TLS `protobuf:"bytes,2,opt,name=tls,proto3" json:"tls,omitempty"` + // use_system_env indicates whether to use the system environment variables. + UseSystemEnv bool `protobuf:"varint,1,opt,name=use_system_env,json=useSystemEnv,proto3" json:"use_system_env,omitempty"` + // sources is a list of files with env. + Sources []string `protobuf:"bytes,2,rep,name=sources,proto3" json:"sources,omitempty"` } -func (x *ConfigCore_Server) Reset() { - *x = ConfigCore_Server{} +func (x *Project_Env) Reset() { + *x = Project_Env{} if protoimpl.UnsafeEnabled { mi := &file_runme_config_v1alpha1_config_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -508,13 +523,13 @@ func (x *ConfigCore_Server) Reset() { } } -func (x *ConfigCore_Server) String() string { +func (x *Project_Env) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ConfigCore_Server) ProtoMessage() {} +func (*Project_Env) ProtoMessage() {} -func (x *ConfigCore_Server) ProtoReflect() protoreflect.Message { +func (x *Project_Env) ProtoReflect() protoreflect.Message { mi := &file_runme_config_v1alpha1_config_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -526,95 +541,32 @@ func (x *ConfigCore_Server) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ConfigCore_Server.ProtoReflect.Descriptor instead. -func (*ConfigCore_Server) Descriptor() ([]byte, []int) { - return file_runme_config_v1alpha1_config_proto_rawDescGZIP(), []int{0, 3} -} - -func (x *ConfigCore_Server) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *ConfigCore_Server) GetTls() *ConfigCore_Server_TLS { - if x != nil { - return x.Tls - } - return nil -} - -type ConfigCore_Server_TLS struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` - CertFile string `protobuf:"bytes,2,opt,name=cert_file,json=certFile,proto3" json:"cert_file,omitempty"` - KeyFile string `protobuf:"bytes,3,opt,name=key_file,json=keyFile,proto3" json:"key_file,omitempty"` -} - -func (x *ConfigCore_Server_TLS) Reset() { - *x = ConfigCore_Server_TLS{} - if protoimpl.UnsafeEnabled { - mi := &file_runme_config_v1alpha1_config_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ConfigCore_Server_TLS) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ConfigCore_Server_TLS) ProtoMessage() {} - -func (x *ConfigCore_Server_TLS) ProtoReflect() protoreflect.Message { - mi := &file_runme_config_v1alpha1_config_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ConfigCore_Server_TLS.ProtoReflect.Descriptor instead. -func (*ConfigCore_Server_TLS) Descriptor() ([]byte, []int) { - return file_runme_config_v1alpha1_config_proto_rawDescGZIP(), []int{0, 3, 0} +// Deprecated: Use Project_Env.ProtoReflect.Descriptor instead. +func (*Project_Env) Descriptor() ([]byte, []int) { + return file_runme_config_v1alpha1_config_proto_rawDescGZIP(), []int{1, 0} } -func (x *ConfigCore_Server_TLS) GetEnabled() bool { +func (x *Project_Env) GetUseSystemEnv() bool { if x != nil { - return x.Enabled + return x.UseSystemEnv } return false } -func (x *ConfigCore_Server_TLS) GetCertFile() string { - if x != nil { - return x.CertFile - } - return "" -} - -func (x *ConfigCore_Server_TLS) GetKeyFile() string { +func (x *Project_Env) GetSources() []string { if x != nil { - return x.KeyFile + return x.Sources } - return "" + return nil } -type ConfigRepo_Filter struct { +type Project_Filter struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // type is the type of the filter. - Type ConfigRepo_FilterType `protobuf:"varint,1,opt,name=type,proto3,enum=runme.config.v1alpha1.ConfigRepo_FilterType" json:"type,omitempty"` + Type Project_FilterType `protobuf:"varint,1,opt,name=type,proto3,enum=runme.config.v1alpha1.Project_FilterType" json:"type,omitempty"` // condition is the filter program to execute for each document or block, // depending on the filter type. // @@ -623,23 +575,23 @@ type ConfigRepo_Filter struct { Condition string `protobuf:"bytes,2,opt,name=condition,proto3" json:"condition,omitempty"` } -func (x *ConfigRepo_Filter) Reset() { - *x = ConfigRepo_Filter{} +func (x *Project_Filter) Reset() { + *x = Project_Filter{} if protoimpl.UnsafeEnabled { - mi := &file_runme_config_v1alpha1_config_proto_msgTypes[8] + mi := &file_runme_config_v1alpha1_config_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ConfigRepo_Filter) String() string { +func (x *Project_Filter) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ConfigRepo_Filter) ProtoMessage() {} +func (*Project_Filter) ProtoMessage() {} -func (x *ConfigRepo_Filter) ProtoReflect() protoreflect.Message { - mi := &file_runme_config_v1alpha1_config_proto_msgTypes[8] +func (x *Project_Filter) ProtoReflect() protoreflect.Message { + mi := &file_runme_config_v1alpha1_config_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -650,19 +602,19 @@ func (x *ConfigRepo_Filter) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ConfigRepo_Filter.ProtoReflect.Descriptor instead. -func (*ConfigRepo_Filter) Descriptor() ([]byte, []int) { - return file_runme_config_v1alpha1_config_proto_rawDescGZIP(), []int{1, 0} +// Deprecated: Use Project_Filter.ProtoReflect.Descriptor instead. +func (*Project_Filter) Descriptor() ([]byte, []int) { + return file_runme_config_v1alpha1_config_proto_rawDescGZIP(), []int{1, 1} } -func (x *ConfigRepo_Filter) GetType() ConfigRepo_FilterType { +func (x *Project_Filter) GetType() Project_FilterType { if x != nil { return x.Type } - return ConfigRepo_FILTER_TYPE_UNSPECIFIED + return Project_FILTER_TYPE_UNSPECIFIED } -func (x *ConfigRepo_Filter) GetCondition() string { +func (x *Project_Filter) GetCondition() string { if x != nil { return x.Condition } @@ -677,89 +629,83 @@ var file_runme_config_v1alpha1_config_proto_rawDesc = []byte{ 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x1b, 0x62, 0x75, 0x66, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9d, 0x06, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x43, 0x6f, 0x72, 0x65, 0x12, 0x45, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, + 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x84, 0x03, 0x0a, 0x06, 0x4b, 0x65, 0x72, + 0x6e, 0x65, 0x6c, 0x12, 0x33, 0x0a, 0x03, 0x6c, 0x6f, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x21, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x2e, + 0x4c, 0x6f, 0x67, 0x52, 0x03, 0x6c, 0x6f, 0x67, 0x12, 0x3c, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x48, 0x00, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x1c, - 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x48, 0x00, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x37, 0x0a, 0x03, - 0x65, 0x6e, 0x76, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x72, 0x75, 0x6e, 0x6d, - 0x65, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6e, 0x76, - 0x52, 0x03, 0x65, 0x6e, 0x76, 0x12, 0x37, 0x0a, 0x03, 0x6c, 0x6f, 0x67, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x03, 0x6c, 0x6f, 0x67, 0x12, 0x40, - 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, - 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x43, 0x6f, 0x72, - 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x1a, 0x90, 0x01, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x10, 0x0a, 0x03, - 0x64, 0x69, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x72, 0x12, 0x28, - 0x0a, 0x10, 0x66, 0x69, 0x6e, 0x64, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x75, 0x70, 0x77, 0x61, - 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x66, 0x69, 0x6e, 0x64, 0x52, 0x65, - 0x70, 0x6f, 0x55, 0x70, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1c, 0x0a, 0x0c, 0x69, 0x67, 0x6e, 0x6f, - 0x72, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, - 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x12, 0x2b, 0x0a, 0x11, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, - 0x65, 0x5f, 0x67, 0x69, 0x74, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x10, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x47, 0x69, 0x74, 0x69, 0x67, 0x6e, - 0x6f, 0x72, 0x65, 0x1a, 0x45, 0x0a, 0x03, 0x45, 0x6e, 0x76, 0x12, 0x24, 0x0a, 0x0e, 0x75, 0x73, - 0x65, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x65, 0x6e, 0x76, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0c, 0x75, 0x73, 0x65, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x45, 0x6e, 0x76, - 0x12, 0x18, 0x0a, 0x07, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x07, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x1a, 0x4d, 0x0a, 0x03, 0x4c, 0x6f, - 0x67, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, - 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, - 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x07, 0x76, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x65, 0x1a, 0xbb, 0x01, 0x0a, 0x06, 0x53, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3e, - 0x0a, 0x03, 0x74, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x72, 0x75, + 0x2e, 0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x06, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x1a, 0x4d, 0x0a, 0x03, 0x4c, 0x6f, 0x67, 0x12, 0x18, 0x0a, + 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, + 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x76, + 0x65, 0x72, 0x62, 0x6f, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x76, 0x65, + 0x72, 0x62, 0x6f, 0x73, 0x65, 0x1a, 0xb7, 0x01, 0x0a, 0x06, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3a, 0x0a, 0x03, 0x74, 0x6c, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x54, 0x4c, + 0x53, 0x52, 0x03, 0x74, 0x6c, 0x73, 0x1a, 0x57, 0x0a, 0x03, 0x54, 0x4c, 0x53, 0x12, 0x18, 0x0a, + 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, + 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x65, 0x72, 0x74, 0x5f, + 0x66, 0x69, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x65, 0x72, 0x74, + 0x46, 0x69, 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x46, 0x69, 0x6c, 0x65, 0x22, + 0xda, 0x04, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x14, 0x0a, 0x04, 0x72, + 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x72, 0x6f, 0x6f, + 0x74, 0x12, 0x1c, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x34, 0x0a, 0x03, 0x65, 0x6e, 0x76, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x72, + 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x45, 0x6e, 0x76, + 0x52, 0x03, 0x65, 0x6e, 0x76, 0x12, 0x28, 0x0a, 0x10, 0x66, 0x69, 0x6e, 0x64, 0x5f, 0x72, 0x65, + 0x70, 0x6f, 0x5f, 0x75, 0x70, 0x77, 0x61, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0e, 0x66, 0x69, 0x6e, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x55, 0x70, 0x77, 0x61, 0x72, 0x64, 0x12, + 0x1c, 0x0a, 0x0c, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x73, 0x18, + 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x12, 0x2b, 0x0a, + 0x11, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x67, 0x69, 0x74, 0x69, 0x67, 0x6e, 0x6f, + 0x72, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, + 0x65, 0x47, 0x69, 0x74, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x12, 0x3f, 0x0a, 0x07, 0x66, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x53, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x54, 0x4c, 0x53, 0x52, 0x03, 0x74, 0x6c, 0x73, 0x1a, 0x57, - 0x0a, 0x03, 0x54, 0x4c, 0x53, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, - 0x1b, 0x0a, 0x09, 0x63, 0x65, 0x72, 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x63, 0x65, 0x72, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x08, - 0x6b, 0x65, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x6b, 0x65, 0x79, 0x46, 0x69, 0x6c, 0x65, 0x42, 0x0f, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x12, 0x05, 0xba, 0x48, 0x02, 0x08, 0x01, 0x22, 0xac, 0x02, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x52, 0x65, 0x70, 0x6f, 0x12, 0x42, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, - 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, - 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x70, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x74, - 0x65, 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x1a, 0x7e, 0x0a, 0x06, 0x46, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x4a, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x2c, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x52, 0x65, 0x70, 0x6f, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x54, 0x79, 0x70, - 0x65, 0x42, 0x08, 0xba, 0x48, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x12, 0x28, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xba, 0x48, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x08, - 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x5a, 0x0a, 0x0a, 0x46, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x46, 0x49, 0x4c, - 0x54, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, - 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x46, 0x49, 0x4c, 0x54, 0x45, 0x52, - 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x10, 0x01, 0x12, 0x18, 0x0a, - 0x14, 0x46, 0x49, 0x4c, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x4f, 0x43, - 0x55, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x02, 0x22, 0x76, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x12, 0x35, 0x0a, 0x04, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x21, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x43, 0x6f, - 0x72, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x35, 0x0a, 0x04, 0x72, 0x65, 0x70, 0x6f, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x04, 0x72, 0x65, 0x70, 0x6f, 0x42, - 0x56, 0x5a, 0x54, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x66, 0x75, 0x6c, 0x2f, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2f, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, - 0x67, 0x6f, 0x2f, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x46, 0x69, 0x6c, 0x74, + 0x65, 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x1a, 0x45, 0x0a, 0x03, 0x45, + 0x6e, 0x76, 0x12, 0x24, 0x0a, 0x0e, 0x75, 0x73, 0x65, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, + 0x5f, 0x65, 0x6e, 0x76, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x75, 0x73, 0x65, 0x53, + 0x79, 0x73, 0x74, 0x65, 0x6d, 0x45, 0x6e, 0x76, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x73, 0x1a, 0x7b, 0x0a, 0x06, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x47, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x29, 0x2e, 0x72, 0x75, 0x6e, + 0x6d, 0x65, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x54, 0x79, 0x70, 0x65, 0x42, 0x08, 0xba, 0x48, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xba, 0x48, 0x07, 0x72, 0x05, 0x10, + 0x01, 0x18, 0x80, 0x08, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, + 0x5a, 0x0a, 0x0a, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, + 0x17, 0x46, 0x49, 0x4c, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, + 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x46, 0x49, + 0x4c, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x10, + 0x01, 0x12, 0x18, 0x0a, 0x14, 0x46, 0x49, 0x4c, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x44, 0x4f, 0x43, 0x55, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x02, 0x42, 0x0f, 0x0a, 0x06, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x05, 0xba, 0x48, 0x02, 0x08, 0x01, 0x22, 0x79, 0x0a, 0x06, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x35, 0x0a, 0x06, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4b, + 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x52, 0x06, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x12, 0x38, 0x0a, + 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, + 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x07, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x42, 0x56, 0x5a, 0x54, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x66, 0x75, 0x6c, 0x2f, 0x72, + 0x75, 0x6e, 0x6d, 0x65, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x65, + 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x72, 0x75, 0x6e, 0x6d, 0x65, + 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -775,34 +721,32 @@ func file_runme_config_v1alpha1_config_proto_rawDescGZIP() []byte { } var file_runme_config_v1alpha1_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_runme_config_v1alpha1_config_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_runme_config_v1alpha1_config_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_runme_config_v1alpha1_config_proto_goTypes = []interface{}{ - (ConfigRepo_FilterType)(0), // 0: runme.config.v1alpha1.ConfigRepo.FilterType - (*ConfigCore)(nil), // 1: runme.config.v1alpha1.ConfigCore - (*ConfigRepo)(nil), // 2: runme.config.v1alpha1.ConfigRepo - (*Config)(nil), // 3: runme.config.v1alpha1.Config - (*ConfigCore_Project)(nil), // 4: runme.config.v1alpha1.ConfigCore.Project - (*ConfigCore_Env)(nil), // 5: runme.config.v1alpha1.ConfigCore.Env - (*ConfigCore_Log)(nil), // 6: runme.config.v1alpha1.ConfigCore.Log - (*ConfigCore_Server)(nil), // 7: runme.config.v1alpha1.ConfigCore.Server - (*ConfigCore_Server_TLS)(nil), // 8: runme.config.v1alpha1.ConfigCore.Server.TLS - (*ConfigRepo_Filter)(nil), // 9: runme.config.v1alpha1.ConfigRepo.Filter + (Project_FilterType)(0), // 0: runme.config.v1alpha1.Project.FilterType + (*Kernel)(nil), // 1: runme.config.v1alpha1.Kernel + (*Project)(nil), // 2: runme.config.v1alpha1.Project + (*Config)(nil), // 3: runme.config.v1alpha1.Config + (*Kernel_Log)(nil), // 4: runme.config.v1alpha1.Kernel.Log + (*Kernel_Server)(nil), // 5: runme.config.v1alpha1.Kernel.Server + (*Kernel_Server_TLS)(nil), // 6: runme.config.v1alpha1.Kernel.Server.TLS + (*Project_Env)(nil), // 7: runme.config.v1alpha1.Project.Env + (*Project_Filter)(nil), // 8: runme.config.v1alpha1.Project.Filter } var file_runme_config_v1alpha1_config_proto_depIdxs = []int32{ - 4, // 0: runme.config.v1alpha1.ConfigCore.project:type_name -> runme.config.v1alpha1.ConfigCore.Project - 5, // 1: runme.config.v1alpha1.ConfigCore.env:type_name -> runme.config.v1alpha1.ConfigCore.Env - 6, // 2: runme.config.v1alpha1.ConfigCore.log:type_name -> runme.config.v1alpha1.ConfigCore.Log - 7, // 3: runme.config.v1alpha1.ConfigCore.server:type_name -> runme.config.v1alpha1.ConfigCore.Server - 9, // 4: runme.config.v1alpha1.ConfigRepo.filters:type_name -> runme.config.v1alpha1.ConfigRepo.Filter - 1, // 5: runme.config.v1alpha1.Config.core:type_name -> runme.config.v1alpha1.ConfigCore - 2, // 6: runme.config.v1alpha1.Config.repo:type_name -> runme.config.v1alpha1.ConfigRepo - 8, // 7: runme.config.v1alpha1.ConfigCore.Server.tls:type_name -> runme.config.v1alpha1.ConfigCore.Server.TLS - 0, // 8: runme.config.v1alpha1.ConfigRepo.Filter.type:type_name -> runme.config.v1alpha1.ConfigRepo.FilterType - 9, // [9:9] is the sub-list for method output_type - 9, // [9:9] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name + 4, // 0: runme.config.v1alpha1.Kernel.log:type_name -> runme.config.v1alpha1.Kernel.Log + 5, // 1: runme.config.v1alpha1.Kernel.server:type_name -> runme.config.v1alpha1.Kernel.Server + 7, // 2: runme.config.v1alpha1.Project.env:type_name -> runme.config.v1alpha1.Project.Env + 8, // 3: runme.config.v1alpha1.Project.filters:type_name -> runme.config.v1alpha1.Project.Filter + 1, // 4: runme.config.v1alpha1.Config.kernel:type_name -> runme.config.v1alpha1.Kernel + 2, // 5: runme.config.v1alpha1.Config.project:type_name -> runme.config.v1alpha1.Project + 6, // 6: runme.config.v1alpha1.Kernel.Server.tls:type_name -> runme.config.v1alpha1.Kernel.Server.TLS + 0, // 7: runme.config.v1alpha1.Project.Filter.type:type_name -> runme.config.v1alpha1.Project.FilterType + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name } func init() { file_runme_config_v1alpha1_config_proto_init() } @@ -812,7 +756,7 @@ func file_runme_config_v1alpha1_config_proto_init() { } if !protoimpl.UnsafeEnabled { file_runme_config_v1alpha1_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConfigCore); i { + switch v := v.(*Kernel); i { case 0: return &v.state case 1: @@ -824,7 +768,7 @@ func file_runme_config_v1alpha1_config_proto_init() { } } file_runme_config_v1alpha1_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConfigRepo); i { + switch v := v.(*Project); i { case 0: return &v.state case 1: @@ -848,7 +792,7 @@ func file_runme_config_v1alpha1_config_proto_init() { } } file_runme_config_v1alpha1_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConfigCore_Project); i { + switch v := v.(*Kernel_Log); i { case 0: return &v.state case 1: @@ -860,7 +804,7 @@ func file_runme_config_v1alpha1_config_proto_init() { } } file_runme_config_v1alpha1_config_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConfigCore_Env); i { + switch v := v.(*Kernel_Server); i { case 0: return &v.state case 1: @@ -872,7 +816,7 @@ func file_runme_config_v1alpha1_config_proto_init() { } } file_runme_config_v1alpha1_config_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConfigCore_Log); i { + switch v := v.(*Kernel_Server_TLS); i { case 0: return &v.state case 1: @@ -884,7 +828,7 @@ func file_runme_config_v1alpha1_config_proto_init() { } } file_runme_config_v1alpha1_config_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConfigCore_Server); i { + switch v := v.(*Project_Env); i { case 0: return &v.state case 1: @@ -896,19 +840,7 @@ func file_runme_config_v1alpha1_config_proto_init() { } } file_runme_config_v1alpha1_config_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConfigCore_Server_TLS); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_runme_config_v1alpha1_config_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConfigRepo_Filter); i { + switch v := v.(*Project_Filter); i { case 0: return &v.state case 1: @@ -920,9 +852,9 @@ func file_runme_config_v1alpha1_config_proto_init() { } } } - file_runme_config_v1alpha1_config_proto_msgTypes[0].OneofWrappers = []interface{}{ - (*ConfigCore_Project_)(nil), - (*ConfigCore_Filename)(nil), + file_runme_config_v1alpha1_config_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*Project_Root)(nil), + (*Project_Filename)(nil), } type x struct{} out := protoimpl.TypeBuilder{ @@ -930,7 +862,7 @@ func file_runme_config_v1alpha1_config_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_runme_config_v1alpha1_config_proto_rawDesc, NumEnums: 1, - NumMessages: 9, + NumMessages: 8, NumExtensions: 0, NumServices: 0, }, diff --git a/internal/gen/proto/ts/runme/config/v1alpha1/config_pb.d.ts b/internal/gen/proto/ts/runme/config/v1alpha1/config_pb.d.ts index 602c7b99..fd648097 100644 --- a/internal/gen/proto/ts/runme/config/v1alpha1/config_pb.d.ts +++ b/internal/gen/proto/ts/runme/config/v1alpha1/config_pb.d.ts @@ -5,101 +5,26 @@ // @ts-nocheck import { MessageType } from "@protobuf-ts/runtime"; /** - * ConfigCore describes system-level configuration of the runme toolchain. + * Kernel describes system-level configuration of the runme toolchain. * - * @generated from protobuf message runme.config.v1alpha1.ConfigCore + * @generated from protobuf message runme.config.v1alpha1.Kernel */ -export interface ConfigCore { - /** - * @generated from protobuf oneof: source - */ - source: { - oneofKind: "project"; - /** - * project indicates a dir-based source typically including multiple Markdown files. - * - * @generated from protobuf field: runme.config.v1alpha1.ConfigCore.Project project = 1; - */ - project: ConfigCore_Project; - } | { - oneofKind: "filename"; - /** - * filename indicates a single Markdown file. - * - * @generated from protobuf field: string filename = 2; - */ - filename: string; - } | { - oneofKind: undefined; - }; - /** - * env is the environment variables configuration. - * - * @generated from protobuf field: runme.config.v1alpha1.ConfigCore.Env env = 3; - */ - env?: ConfigCore_Env; +export interface Kernel { /** * log contains the log configuration. * - * @generated from protobuf field: runme.config.v1alpha1.ConfigCore.Log log = 7; - */ - log?: ConfigCore_Log; - /** - * @generated from protobuf field: runme.config.v1alpha1.ConfigCore.Server server = 8; - */ - server?: ConfigCore_Server; -} -/** - * @generated from protobuf message runme.config.v1alpha1.ConfigCore.Project - */ -export interface ConfigCore_Project { - /** - * dir is the directory to look for Markdown files. - * - * @generated from protobuf field: string dir = 1; - */ - dir: string; - /** - * find_repo_upward indicates whether to find the nearest Git repository upward. - * This is useful to, for example, recognize .gitignore files. - * - * @generated from protobuf field: bool find_repo_upward = 2; + * @generated from protobuf field: runme.config.v1alpha1.Kernel.Log log = 1; */ - findRepoUpward: boolean; + log?: Kernel_Log; /** - * ignore_paths is a list of paths to ignore relative to dir. - * - * @generated from protobuf field: repeated string ignore_paths = 3 [json_name = "ignore"]; - */ - ignorePaths: string[]; - /** - * disable_gitignore indicates whether to disable the .gitignore file. - * - * @generated from protobuf field: bool disable_gitignore = 4; - */ - disableGitignore: boolean; -} -/** - * @generated from protobuf message runme.config.v1alpha1.ConfigCore.Env - */ -export interface ConfigCore_Env { - /** - * use_system_env indicates whether to use the system environment variables. - * - * @generated from protobuf field: bool use_system_env = 1; - */ - useSystemEnv: boolean; - /** - * sources is a list of files with env. - * - * @generated from protobuf field: repeated string sources = 2; + * @generated from protobuf field: runme.config.v1alpha1.Kernel.Server server = 2; */ - sources: string[]; + server?: Kernel_Server; } /** - * @generated from protobuf message runme.config.v1alpha1.ConfigCore.Log + * @generated from protobuf message runme.config.v1alpha1.Kernel.Log */ -export interface ConfigCore_Log { +export interface Kernel_Log { /** * enabled indicates whether to enable logging. * @@ -120,22 +45,22 @@ export interface ConfigCore_Log { verbose: boolean; } /** - * @generated from protobuf message runme.config.v1alpha1.ConfigCore.Server + * @generated from protobuf message runme.config.v1alpha1.Kernel.Server */ -export interface ConfigCore_Server { +export interface Kernel_Server { /** * @generated from protobuf field: string address = 1; */ address: string; /** - * @generated from protobuf field: runme.config.v1alpha1.ConfigCore.Server.TLS tls = 2; + * @generated from protobuf field: runme.config.v1alpha1.Kernel.Server.TLS tls = 2; */ - tls?: ConfigCore_Server_TLS; + tls?: Kernel_Server_TLS; } /** - * @generated from protobuf message runme.config.v1alpha1.ConfigCore.Server.TLS + * @generated from protobuf message runme.config.v1alpha1.Kernel.Server.TLS */ -export interface ConfigCore_Server_TLS { +export interface Kernel_Server_TLS { /** * @generated from protobuf field: bool enabled = 1; */ @@ -150,30 +75,94 @@ export interface ConfigCore_Server_TLS { keyFile: string; } /** - * ConfigRepo describes repo-level configuration of the runme toolchain. + * Project describes repo-level configuration of the runme toolchain. * - * @generated from protobuf message runme.config.v1alpha1.ConfigRepo + * @generated from protobuf message runme.config.v1alpha1.Project */ -export interface ConfigRepo { +export interface Project { + /** + * @generated from protobuf oneof: source + */ + source: { + oneofKind: "root"; + /** + * root indicates a dir-based source typically including multiple Markdown files. + * + * @generated from protobuf field: string root = 1; + */ + root: string; + } | { + oneofKind: "filename"; + /** + * filename indicates a single Markdown file. + * + * @generated from protobuf field: string filename = 2; + */ + filename: string; + } | { + oneofKind: undefined; + }; + /** + * env is the environment variables configuration. + * + * @generated from protobuf field: runme.config.v1alpha1.Project.Env env = 3; + */ + env?: Project_Env; + /** + * find_repo_upward indicates whether to find the nearest Git repository upward. + * This is useful to, for example, recognize .gitignore files. + * + * @generated from protobuf field: bool find_repo_upward = 4; + */ + findRepoUpward: boolean; + /** + * ignore_paths is a list of paths to ignore relative to dir. + * + * @generated from protobuf field: repeated string ignore_paths = 5 [json_name = "ignore"]; + */ + ignorePaths: string[]; + /** + * disable_gitignore indicates whether to disable the .gitignore file. + * + * @generated from protobuf field: bool disable_gitignore = 6; + */ + disableGitignore: boolean; /** * filters is a list of filters to apply. * Filters can be applied to documents or * individual code blocks. * - * @generated from protobuf field: repeated runme.config.v1alpha1.ConfigRepo.Filter filters = 5; + * @generated from protobuf field: repeated runme.config.v1alpha1.Project.Filter filters = 7; */ - filters: ConfigRepo_Filter[]; + filters: Project_Filter[]; } /** - * @generated from protobuf message runme.config.v1alpha1.ConfigRepo.Filter + * @generated from protobuf message runme.config.v1alpha1.Project.Env */ -export interface ConfigRepo_Filter { +export interface Project_Env { + /** + * use_system_env indicates whether to use the system environment variables. + * + * @generated from protobuf field: bool use_system_env = 1; + */ + useSystemEnv: boolean; + /** + * sources is a list of files with env. + * + * @generated from protobuf field: repeated string sources = 2; + */ + sources: string[]; +} +/** + * @generated from protobuf message runme.config.v1alpha1.Project.Filter + */ +export interface Project_Filter { /** * type is the type of the filter. * - * @generated from protobuf field: runme.config.v1alpha1.ConfigRepo.FilterType type = 1; + * @generated from protobuf field: runme.config.v1alpha1.Project.FilterType type = 1; */ - type: ConfigRepo_FilterType; + type: Project_FilterType; /** * condition is the filter program to execute for each document or block, * depending on the filter type. @@ -186,9 +175,9 @@ export interface ConfigRepo_Filter { condition: string; } /** - * @generated from protobuf enum runme.config.v1alpha1.ConfigRepo.FilterType + * @generated from protobuf enum runme.config.v1alpha1.Project.FilterType */ -export declare enum ConfigRepo_FilterType { +export declare enum Project_FilterType { /** * @generated from protobuf enum value: FILTER_TYPE_UNSPECIFIED = 0; */ @@ -209,74 +198,67 @@ export declare enum ConfigRepo_FilterType { */ export interface Config { /** - * core is the system-level configuration. + * kernel is the system-level configuration. * - * @generated from protobuf field: runme.config.v1alpha1.ConfigCore core = 1; + * @generated from protobuf field: runme.config.v1alpha1.Kernel kernel = 1; */ - core?: ConfigCore; + kernel?: Kernel; /** - * repo is the repo-level configuration. + * project contains configuration applicable to the project inside a repo. * - * @generated from protobuf field: runme.config.v1alpha1.ConfigRepo repo = 2; + * @generated from protobuf field: runme.config.v1alpha1.Project project = 2; */ - repo?: ConfigRepo; + project?: Project; } -declare class ConfigCore$Type extends MessageType { - constructor(); -} -/** - * @generated MessageType for protobuf message runme.config.v1alpha1.ConfigCore - */ -export declare const ConfigCore: ConfigCore$Type; -declare class ConfigCore_Project$Type extends MessageType { +declare class Kernel$Type extends MessageType { constructor(); } /** - * @generated MessageType for protobuf message runme.config.v1alpha1.ConfigCore.Project + * @generated MessageType for protobuf message runme.config.v1alpha1.Kernel */ -export declare const ConfigCore_Project: ConfigCore_Project$Type; -declare class ConfigCore_Env$Type extends MessageType { +export declare const Kernel: Kernel$Type; +declare class Kernel_Log$Type extends MessageType { constructor(); } /** - * @generated MessageType for protobuf message runme.config.v1alpha1.ConfigCore.Env + * @generated MessageType for protobuf message runme.config.v1alpha1.Kernel.Log */ -export declare const ConfigCore_Env: ConfigCore_Env$Type; -declare class ConfigCore_Log$Type extends MessageType { +export declare const Kernel_Log: Kernel_Log$Type; +declare class Kernel_Server$Type extends MessageType { constructor(); } /** - * @generated MessageType for protobuf message runme.config.v1alpha1.ConfigCore.Log + * @generated MessageType for protobuf message runme.config.v1alpha1.Kernel.Server */ -export declare const ConfigCore_Log: ConfigCore_Log$Type; -declare class ConfigCore_Server$Type extends MessageType { +export declare const Kernel_Server: Kernel_Server$Type; +declare class Kernel_Server_TLS$Type extends MessageType { constructor(); } /** - * @generated MessageType for protobuf message runme.config.v1alpha1.ConfigCore.Server + * @generated MessageType for protobuf message runme.config.v1alpha1.Kernel.Server.TLS */ -export declare const ConfigCore_Server: ConfigCore_Server$Type; -declare class ConfigCore_Server_TLS$Type extends MessageType { +export declare const Kernel_Server_TLS: Kernel_Server_TLS$Type; +declare class Project$Type extends MessageType { constructor(); } /** - * @generated MessageType for protobuf message runme.config.v1alpha1.ConfigCore.Server.TLS + * @generated MessageType for protobuf message runme.config.v1alpha1.Project */ -export declare const ConfigCore_Server_TLS: ConfigCore_Server_TLS$Type; -declare class ConfigRepo$Type extends MessageType { +export declare const Project: Project$Type; +declare class Project_Env$Type extends MessageType { constructor(); } /** - * @generated MessageType for protobuf message runme.config.v1alpha1.ConfigRepo + * @generated MessageType for protobuf message runme.config.v1alpha1.Project.Env */ -export declare const ConfigRepo: ConfigRepo$Type; -declare class ConfigRepo_Filter$Type extends MessageType { +export declare const Project_Env: Project_Env$Type; +declare class Project_Filter$Type extends MessageType { constructor(); } /** - * @generated MessageType for protobuf message runme.config.v1alpha1.ConfigRepo.Filter + * @generated MessageType for protobuf message runme.config.v1alpha1.Project.Filter */ -export declare const ConfigRepo_Filter: ConfigRepo_Filter$Type; +export declare const Project_Filter: Project_Filter$Type; declare class Config$Type extends MessageType { constructor(); } diff --git a/internal/gen/proto/ts/runme/config/v1alpha1/config_pb.js b/internal/gen/proto/ts/runme/config/v1alpha1/config_pb.js index 5fd5bda2..b10a0ee5 100644 --- a/internal/gen/proto/ts/runme/config/v1alpha1/config_pb.js +++ b/internal/gen/proto/ts/runme/config/v1alpha1/config_pb.js @@ -10,139 +10,127 @@ // @ts-nocheck import { MessageType } from "@protobuf-ts/runtime"; /** - * @generated from protobuf enum runme.config.v1alpha1.ConfigRepo.FilterType + * @generated from protobuf enum runme.config.v1alpha1.Project.FilterType */ -export var ConfigRepo_FilterType; -(function (ConfigRepo_FilterType) { +export var Project_FilterType; +(function (Project_FilterType) { /** * @generated from protobuf enum value: FILTER_TYPE_UNSPECIFIED = 0; */ - ConfigRepo_FilterType[ConfigRepo_FilterType["UNSPECIFIED"] = 0] = "UNSPECIFIED"; + Project_FilterType[Project_FilterType["UNSPECIFIED"] = 0] = "UNSPECIFIED"; /** * @generated from protobuf enum value: FILTER_TYPE_BLOCK = 1; */ - ConfigRepo_FilterType[ConfigRepo_FilterType["BLOCK"] = 1] = "BLOCK"; + Project_FilterType[Project_FilterType["BLOCK"] = 1] = "BLOCK"; /** * @generated from protobuf enum value: FILTER_TYPE_DOCUMENT = 2; */ - ConfigRepo_FilterType[ConfigRepo_FilterType["DOCUMENT"] = 2] = "DOCUMENT"; -})(ConfigRepo_FilterType || (ConfigRepo_FilterType = {})); + Project_FilterType[Project_FilterType["DOCUMENT"] = 2] = "DOCUMENT"; +})(Project_FilterType || (Project_FilterType = {})); // @generated message type with reflection information, may provide speed optimized methods -class ConfigCore$Type extends MessageType { +class Kernel$Type extends MessageType { constructor() { - super("runme.config.v1alpha1.ConfigCore", [ - { no: 1, name: "project", kind: "message", oneof: "source", T: () => ConfigCore_Project }, - { no: 2, name: "filename", kind: "scalar", oneof: "source", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "env", kind: "message", T: () => ConfigCore_Env }, - { no: 7, name: "log", kind: "message", T: () => ConfigCore_Log }, - { no: 8, name: "server", kind: "message", T: () => ConfigCore_Server } + super("runme.config.v1alpha1.Kernel", [ + { no: 1, name: "log", kind: "message", T: () => Kernel_Log }, + { no: 2, name: "server", kind: "message", T: () => Kernel_Server } ]); } } /** - * @generated MessageType for protobuf message runme.config.v1alpha1.ConfigCore + * @generated MessageType for protobuf message runme.config.v1alpha1.Kernel */ -export const ConfigCore = new ConfigCore$Type(); +export const Kernel = new Kernel$Type(); // @generated message type with reflection information, may provide speed optimized methods -class ConfigCore_Project$Type extends MessageType { +class Kernel_Log$Type extends MessageType { constructor() { - super("runme.config.v1alpha1.ConfigCore.Project", [ - { no: 1, name: "dir", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "find_repo_upward", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 3, name: "ignore_paths", kind: "scalar", jsonName: "ignore", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "disable_gitignore", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + super("runme.config.v1alpha1.Kernel.Log", [ + { no: 1, name: "enabled", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 2, name: "path", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "verbose", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } ]); } } /** - * @generated MessageType for protobuf message runme.config.v1alpha1.ConfigCore.Project + * @generated MessageType for protobuf message runme.config.v1alpha1.Kernel.Log */ -export const ConfigCore_Project = new ConfigCore_Project$Type(); +export const Kernel_Log = new Kernel_Log$Type(); // @generated message type with reflection information, may provide speed optimized methods -class ConfigCore_Env$Type extends MessageType { +class Kernel_Server$Type extends MessageType { constructor() { - super("runme.config.v1alpha1.ConfigCore.Env", [ - { no: 1, name: "use_system_env", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "sources", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ } + super("runme.config.v1alpha1.Kernel.Server", [ + { no: 1, name: "address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "tls", kind: "message", T: () => Kernel_Server_TLS } ]); } } /** - * @generated MessageType for protobuf message runme.config.v1alpha1.ConfigCore.Env + * @generated MessageType for protobuf message runme.config.v1alpha1.Kernel.Server */ -export const ConfigCore_Env = new ConfigCore_Env$Type(); +export const Kernel_Server = new Kernel_Server$Type(); // @generated message type with reflection information, may provide speed optimized methods -class ConfigCore_Log$Type extends MessageType { +class Kernel_Server_TLS$Type extends MessageType { constructor() { - super("runme.config.v1alpha1.ConfigCore.Log", [ + super("runme.config.v1alpha1.Kernel.Server.TLS", [ { no: 1, name: "enabled", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "path", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "verbose", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } -} -/** - * @generated MessageType for protobuf message runme.config.v1alpha1.ConfigCore.Log - */ -export const ConfigCore_Log = new ConfigCore_Log$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ConfigCore_Server$Type extends MessageType { - constructor() { - super("runme.config.v1alpha1.ConfigCore.Server", [ - { no: 1, name: "address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "tls", kind: "message", T: () => ConfigCore_Server_TLS } + { no: 2, name: "cert_file", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "key_file", kind: "scalar", T: 9 /*ScalarType.STRING*/ } ]); } } /** - * @generated MessageType for protobuf message runme.config.v1alpha1.ConfigCore.Server + * @generated MessageType for protobuf message runme.config.v1alpha1.Kernel.Server.TLS */ -export const ConfigCore_Server = new ConfigCore_Server$Type(); +export const Kernel_Server_TLS = new Kernel_Server_TLS$Type(); // @generated message type with reflection information, may provide speed optimized methods -class ConfigCore_Server_TLS$Type extends MessageType { +class Project$Type extends MessageType { constructor() { - super("runme.config.v1alpha1.ConfigCore.Server.TLS", [ - { no: 1, name: "enabled", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "cert_file", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "key_file", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + super("runme.config.v1alpha1.Project", [ + { no: 1, name: "root", kind: "scalar", oneof: "source", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "filename", kind: "scalar", oneof: "source", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "env", kind: "message", T: () => Project_Env }, + { no: 4, name: "find_repo_upward", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 5, name: "ignore_paths", kind: "scalar", jsonName: "ignore", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 6, name: "disable_gitignore", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 7, name: "filters", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Project_Filter } ]); } } /** - * @generated MessageType for protobuf message runme.config.v1alpha1.ConfigCore.Server.TLS + * @generated MessageType for protobuf message runme.config.v1alpha1.Project */ -export const ConfigCore_Server_TLS = new ConfigCore_Server_TLS$Type(); +export const Project = new Project$Type(); // @generated message type with reflection information, may provide speed optimized methods -class ConfigRepo$Type extends MessageType { +class Project_Env$Type extends MessageType { constructor() { - super("runme.config.v1alpha1.ConfigRepo", [ - { no: 5, name: "filters", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ConfigRepo_Filter } + super("runme.config.v1alpha1.Project.Env", [ + { no: 1, name: "use_system_env", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 2, name: "sources", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ } ]); } } /** - * @generated MessageType for protobuf message runme.config.v1alpha1.ConfigRepo + * @generated MessageType for protobuf message runme.config.v1alpha1.Project.Env */ -export const ConfigRepo = new ConfigRepo$Type(); +export const Project_Env = new Project_Env$Type(); // @generated message type with reflection information, may provide speed optimized methods -class ConfigRepo_Filter$Type extends MessageType { +class Project_Filter$Type extends MessageType { constructor() { - super("runme.config.v1alpha1.ConfigRepo.Filter", [ - { no: 1, name: "type", kind: "enum", T: () => ["runme.config.v1alpha1.ConfigRepo.FilterType", ConfigRepo_FilterType, "FILTER_TYPE_"], options: { "buf.validate.field": { enum: { definedOnly: true } } } }, + super("runme.config.v1alpha1.Project.Filter", [ + { no: 1, name: "type", kind: "enum", T: () => ["runme.config.v1alpha1.Project.FilterType", Project_FilterType, "FILTER_TYPE_"], options: { "buf.validate.field": { enum: { definedOnly: true } } } }, { no: 2, name: "condition", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "buf.validate.field": { string: { minLen: "1", maxLen: "1024" } } } } ]); } } /** - * @generated MessageType for protobuf message runme.config.v1alpha1.ConfigRepo.Filter + * @generated MessageType for protobuf message runme.config.v1alpha1.Project.Filter */ -export const ConfigRepo_Filter = new ConfigRepo_Filter$Type(); +export const Project_Filter = new Project_Filter$Type(); // @generated message type with reflection information, may provide speed optimized methods class Config$Type extends MessageType { constructor() { super("runme.config.v1alpha1.Config", [ - { no: 1, name: "core", kind: "message", T: () => ConfigCore }, - { no: 2, name: "repo", kind: "message", T: () => ConfigRepo } + { no: 1, name: "kernel", kind: "message", T: () => Kernel }, + { no: 2, name: "project", kind: "message", T: () => Project } ]); } } diff --git a/testdata/beta/base.txtar b/testdata/beta/base.txtar index 48074fb3..cee5521e 100644 --- a/testdata/beta/base.txtar +++ b/testdata/beta/base.txtar @@ -16,12 +16,12 @@ stderr 'no tasks to run' -- experimental/runme.yaml -- version: v1alpha1 -core: - project: - dir: "." +project: + root: "." env: sources: - .env +#kernel: # log: # enable: true diff --git a/testdata/beta/categories.txtar b/testdata/beta/categories.txtar index dc58d89f..7057a415 100644 --- a/testdata/beta/categories.txtar +++ b/testdata/beta/categories.txtar @@ -8,8 +8,9 @@ stdout '^bar[\s]+bar-baz[\s]+$' -- experimental/runme.yaml -- version: v1alpha1 -core: +project: filename: README.md +#kernel: # log: # enable: true diff --git a/testdata/beta/failure.txtar b/testdata/beta/failure.txtar index b7bb60a3..9e36f5cb 100644 --- a/testdata/beta/failure.txtar +++ b/testdata/beta/failure.txtar @@ -12,7 +12,7 @@ stderr '^could not execute command: failed to open file-based project ".*/unknow -- experimental/runme.yaml -- version: v1alpha1 -core: +project: filename: README.md -- README.md -- diff --git a/testdata/beta/find_repo_upward.txtar b/testdata/beta/find_repo_upward.txtar index 382b63b9..c01be856 100644 --- a/testdata/beta/find_repo_upward.txtar +++ b/testdata/beta/find_repo_upward.txtar @@ -12,10 +12,9 @@ cmp stdout result-print.txt -- nested/experimental/runme.yaml -- version: v1alpha1 -core: - project: - dir: "." - find_repo_upward: true +project: + root: "." + find_repo_upward: true env: sources: - .env diff --git a/testdata/beta/project_dir_nested.txtar b/testdata/beta/project_dir_nested.txtar index cafa4816..26116ddc 100644 --- a/testdata/beta/project_dir_nested.txtar +++ b/testdata/beta/project_dir_nested.txtar @@ -8,9 +8,8 @@ cmp stdout result-print.txt -- experimental/runme.yaml -- version: v1alpha1 -core: - project: - dir: "./nested" +project: + root: "./nested" env: sources: - .env diff --git a/testdata/beta/server.txtar b/testdata/beta/server.txtar index 783208f5..7f4344c9 100644 --- a/testdata/beta/server.txtar +++ b/testdata/beta/server.txtar @@ -8,8 +8,9 @@ stderr '(?sm)server listening' -- experimental/runme.yaml -- version: v1alpha1 -core: +project: filename: README.md +kernel: server: address: unix://runme.sock tls: