syntax = "proto3";

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

package gitlab.agent.flux.rpc;

option go_package = "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v18/internal/module/flux/rpc";

import "buf/validate/validate.proto";

message ReconcileProjectsRequest {
  repeated Project project = 1;
}

message ReconcileProjectsResponse {
  Project project = 1 [(buf.validate.field).required = true];
}

message Project {
  // The project `id` here must be a GitLab full project path, e.g. `gitlab-org/gitlab`.
  // Numerical ids are not supported, see https://gitlab.com/gitlab-org/cluster-integration/gitlab-agent/-/issues/406
  // We use `id` instead of something like `full_path` to have consistency across existing modules.
  string id = 1 [(buf.validate.field).string.min_bytes = 1];
}

service GitLabFlux {
  rpc ReconcileProjects(ReconcileProjectsRequest) returns (stream ReconcileProjectsResponse) {
    option idempotency_level = NO_SIDE_EFFECTS;
  }
}
