syntax = "proto3";

// If you make any changes make sure you run: make regenerate-proto

package gitlab.agent.entity;

option go_package = "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v18/pkg/entity";

import "buf/validate/validate.proto";

message GitalyInfo {
  string address = 1 [json_name = "address", (buf.validate.field).string.min_bytes = 1];
  string token = 2 [json_name = "token"];
  map<string, string> features = 3 [json_name = "features"];
}

// Modified copy of Gitaly's https://gitlab.com/gitlab-org/gitaly/-/blob/55cb537898bce04e5e44be074a4d3d441e1f62b6/proto/shared.proto#L25
// Was copied to avoid exposing Gitaly type in the API and forcing the consumer to have a dependency on Gitaly.
message GitalyRepository {
  string storage_name = 2 [json_name = "storage_name", (buf.validate.field).string.min_bytes = 1];
  string relative_path = 3 [json_name = "relative_path", (buf.validate.field).string.min_bytes = 1];
  // Sets the GIT_OBJECT_DIRECTORY envvar on git commands to the value of this field.
  // It influences the object storage directory the SHA1 directories are created underneath.
  string git_object_directory = 4 [json_name = "git_object_directory"];
  // Sets the GIT_ALTERNATE_OBJECT_DIRECTORIES envvar on git commands to the values of this field.
  // It influences the list of Git object directories which can be used to search for Git objects.
  repeated string git_alternate_object_directories = 5 [json_name = "git_alternate_object_directories"];
  // Used in callbacks to GitLab so that it knows what repository the event is
  // associated with. May be left empty on RPC's that do not perform callbacks.
  // During project creation, `gl_repository` may not be known.
  string gl_repository = 6 [json_name = "gl_repository", (buf.validate.field).string.min_bytes = 1];
  // The human-readable GitLab project path (e.g. gitlab-org/gitlab-ce).
  // When hashed storage is use, this associates a project path with its
  // path on disk. The name can change over time (e.g. when a project is
  // renamed). This is primarily used for logging/debugging at the
  // moment.
  string gl_project_path = 8 [json_name = "gl_project_path", (buf.validate.field).string.min_bytes = 1];
}
