feat: add many things

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2026-03-08 23:00:03 +01:00
parent 45353089c2
commit 5a5f9a3003
104 changed files with 23417 additions and 2027 deletions

View File

@@ -0,0 +1,79 @@
syntax = "proto3";
package forest.v1;
import "forest/v1/releases.proto";
message AutoReleasePolicy {
string id = 1;
string name = 2;
bool enabled = 3;
optional string branch_pattern = 4;
optional string title_pattern = 5;
optional string author_pattern = 6;
optional string commit_message_pattern = 7;
optional string source_type_pattern = 8;
repeated string target_environments = 9;
repeated string target_destinations = 10;
bool force_release = 11;
string created_at = 12;
string updated_at = 13;
// When true, trigger the project's release pipeline instead of
// deploying directly to target destinations/environments.
bool use_pipeline = 14;
}
message CreateAutoReleasePolicyRequest {
Project project = 1;
string name = 2;
optional string branch_pattern = 3;
optional string title_pattern = 4;
optional string author_pattern = 5;
optional string commit_message_pattern = 6;
optional string source_type_pattern = 7;
repeated string target_environments = 8;
repeated string target_destinations = 9;
bool force_release = 10;
bool use_pipeline = 11;
}
message CreateAutoReleasePolicyResponse {
AutoReleasePolicy policy = 1;
}
message UpdateAutoReleasePolicyRequest {
Project project = 1;
string name = 2;
optional bool enabled = 3;
optional string branch_pattern = 4;
optional string title_pattern = 5;
optional string author_pattern = 6;
optional string commit_message_pattern = 7;
optional string source_type_pattern = 8;
repeated string target_environments = 9;
repeated string target_destinations = 10;
optional bool force_release = 11;
optional bool use_pipeline = 12;
}
message UpdateAutoReleasePolicyResponse {
AutoReleasePolicy policy = 1;
}
message DeleteAutoReleasePolicyRequest {
Project project = 1;
string name = 2;
}
message DeleteAutoReleasePolicyResponse {}
message ListAutoReleasePoliciesRequest {
Project project = 1;
}
message ListAutoReleasePoliciesResponse {
repeated AutoReleasePolicy policies = 1;
}
service AutoReleasePolicyService {
rpc CreateAutoReleasePolicy(CreateAutoReleasePolicyRequest) returns (CreateAutoReleasePolicyResponse);
rpc UpdateAutoReleasePolicy(UpdateAutoReleasePolicyRequest) returns (UpdateAutoReleasePolicyResponse);
rpc DeleteAutoReleasePolicy(DeleteAutoReleasePolicyRequest) returns (DeleteAutoReleasePolicyResponse);
rpc ListAutoReleasePolicies(ListAutoReleasePoliciesRequest) returns (ListAutoReleasePoliciesResponse);
}

View File

@@ -0,0 +1,57 @@
syntax = "proto3";
package forest.v1;
message CreateDestinationRequest {
string name = 1;
string environment = 2;
map<string, string> metadata = 3;
DestinationType type = 4;
string organisation = 5;
}
message CreateDestinationResponse {}
message UpdateDestinationRequest {
string name = 1;
map<string, string> metadata = 2;
}
message UpdateDestinationResponse {}
message DeleteDestinationRequest {
string name = 1;
}
message DeleteDestinationResponse {}
message GetDestinationsRequest {
string organisation = 1;
}
message GetDestinationsResponse {
repeated Destination destinations = 1;
}
message ListDestinationTypesRequest {}
message ListDestinationTypesResponse {
repeated DestinationType types = 1;
}
service DestinationService {
rpc CreateDestination(CreateDestinationRequest) returns (CreateDestinationResponse) {}
rpc UpdateDestination(UpdateDestinationRequest) returns (UpdateDestinationResponse) {}
rpc DeleteDestination(DeleteDestinationRequest) returns (DeleteDestinationResponse) {}
rpc GetDestinations(GetDestinationsRequest) returns (GetDestinationsResponse);
rpc ListDestinationTypes(ListDestinationTypesRequest) returns (ListDestinationTypesResponse);
}
message Destination {
string name = 1;
string environment = 2;
map<string, string> metadata = 3;
DestinationType type = 4;
string organisation = 5;
}
message DestinationType {
string organisation = 1;
string name = 2;
uint64 version = 3;
}

View File

@@ -0,0 +1,67 @@
syntax = "proto3";
package forest.v1;
message Environment {
string id = 1;
string organisation = 2;
string name = 3;
optional string description = 4;
int32 sort_order = 5;
string created_at = 6;
}
message CreateEnvironmentRequest {
string organisation = 1;
string name = 2;
optional string description = 3;
int32 sort_order = 4;
}
message CreateEnvironmentResponse {
Environment environment = 1;
}
message GetEnvironmentRequest {
oneof identifier {
string id = 1;
EnvironmentLookup lookup = 2;
}
}
message EnvironmentLookup {
string organisation = 1;
string name = 2;
}
message GetEnvironmentResponse {
Environment environment = 1;
}
message ListEnvironmentsRequest {
string organisation = 1;
}
message ListEnvironmentsResponse {
repeated Environment environments = 1;
}
message UpdateEnvironmentRequest {
string id = 1;
optional string description = 2;
optional int32 sort_order = 3;
}
message UpdateEnvironmentResponse {
Environment environment = 1;
}
message DeleteEnvironmentRequest {
string id = 1;
}
message DeleteEnvironmentResponse {}
service EnvironmentService {
rpc CreateEnvironment(CreateEnvironmentRequest) returns (CreateEnvironmentResponse);
rpc GetEnvironment(GetEnvironmentRequest) returns (GetEnvironmentResponse);
rpc ListEnvironments(ListEnvironmentsRequest) returns (ListEnvironmentsResponse);
rpc UpdateEnvironment(UpdateEnvironmentRequest) returns (UpdateEnvironmentResponse);
rpc DeleteEnvironment(DeleteEnvironmentRequest) returns (DeleteEnvironmentResponse);
}

View File

@@ -0,0 +1,100 @@
syntax = "proto3";
package forest.v1;
import "forest/v1/releases.proto";
// ── Stage type enum (useful for UI dropdowns / filtering) ────────────
enum StageType {
STAGE_TYPE_UNSPECIFIED = 0;
STAGE_TYPE_DEPLOY = 1;
STAGE_TYPE_WAIT = 2;
}
// ── Per-type config messages ─────────────────────────────────────────
message DeployStageConfig {
string environment = 1;
}
message WaitStageConfig {
int64 duration_seconds = 1;
}
// ── A single pipeline stage ──────────────────────────────────────────
message PipelineStage {
string id = 1;
repeated string depends_on = 2;
oneof config {
DeployStageConfig deploy = 10;
WaitStageConfig wait = 11;
}
}
// ── Runtime stage status (for observing pipeline progress) ───────────
enum PipelineStageStatus {
PIPELINE_STAGE_STATUS_UNSPECIFIED = 0;
PIPELINE_STAGE_STATUS_PENDING = 1;
PIPELINE_STAGE_STATUS_ACTIVE = 2;
PIPELINE_STAGE_STATUS_SUCCEEDED = 3;
PIPELINE_STAGE_STATUS_FAILED = 4;
PIPELINE_STAGE_STATUS_CANCELLED = 5;
}
// ── Pipeline resource ────────────────────────────────────────────────
message ReleasePipeline {
string id = 1;
string name = 2;
bool enabled = 3;
repeated PipelineStage stages = 4;
string created_at = 5;
string updated_at = 6;
}
// ── CRUD messages ────────────────────────────────────────────────────
message CreateReleasePipelineRequest {
Project project = 1;
string name = 2;
repeated PipelineStage stages = 3;
}
message CreateReleasePipelineResponse {
ReleasePipeline pipeline = 1;
}
message UpdateReleasePipelineRequest {
Project project = 1;
string name = 2;
optional bool enabled = 3;
// When set, replaces all stages. When absent, stages are unchanged.
repeated PipelineStage stages = 4;
bool update_stages = 5;
}
message UpdateReleasePipelineResponse {
ReleasePipeline pipeline = 1;
}
message DeleteReleasePipelineRequest {
Project project = 1;
string name = 2;
}
message DeleteReleasePipelineResponse {}
message ListReleasePipelinesRequest {
Project project = 1;
}
message ListReleasePipelinesResponse {
repeated ReleasePipeline pipelines = 1;
}
service ReleasePipelineService {
rpc CreateReleasePipeline(CreateReleasePipelineRequest) returns (CreateReleasePipelineResponse);
rpc UpdateReleasePipeline(UpdateReleasePipelineRequest) returns (UpdateReleasePipelineResponse);
rpc DeleteReleasePipeline(DeleteReleasePipelineRequest) returns (DeleteReleasePipelineResponse);
rpc ListReleasePipelines(ListReleasePipelinesRequest) returns (ListReleasePipelinesResponse);
}

View File

@@ -31,6 +31,10 @@ message ReleaseRequest {
string artifact_id = 1;
repeated string destinations = 2;
repeated string environments = 3;
bool force = 4;
// When true, use the project's release pipeline (DAG) instead of
// deploying directly to the specified destinations/environments.
bool use_pipeline = 5;
}
message ReleaseResponse {
// List of release intents created (one per destination)
@@ -88,6 +92,54 @@ message GetProjectsResponse {
message GetReleasesByActorRequest {
string actor_id = 1; // user_id or app_id
string actor_type = 2; // "user" or "app"
int32 page_size = 3;
string page_token = 4;
}
message GetReleasesByActorResponse {
repeated ReleaseIntentSummary releases = 1;
string next_page_token = 2;
}
message ReleaseIntentSummary {
string release_intent_id = 1;
string artifact_id = 2;
Project project = 3;
repeated ReleaseDestinationStatus destinations = 4;
string created_at = 5;
}
message ReleaseDestinationStatus {
string destination = 1;
string environment = 2;
string status = 3;
}
message GetDestinationStatesRequest {
string organisation = 1;
optional string project = 2;
}
message GetDestinationStatesResponse {
repeated DestinationState destinations = 1;
}
message DestinationState {
string destination_id = 1;
string destination_name = 2;
string environment = 3;
optional string release_id = 4;
optional string artifact_id = 5;
optional string status = 6;
optional string error_message = 7;
optional string queued_at = 8;
optional string completed_at = 9;
optional int32 queue_position = 10;
}
service ReleaseService {
rpc AnnotateRelease(AnnotateReleaseRequest) returns (AnnotateReleaseResponse);
rpc Release(ReleaseRequest) returns (ReleaseResponse);
@@ -95,8 +147,10 @@ service ReleaseService {
rpc GetArtifactBySlug(GetArtifactBySlugRequest) returns (GetArtifactBySlugResponse);
rpc GetArtifactsByProject(GetArtifactsByProjectRequest) returns (GetArtifactsByProjectResponse);
rpc GetReleasesByActor(GetReleasesByActorRequest) returns (GetReleasesByActorResponse);
rpc GetOrganisations(GetOrganisationsRequest) returns (GetOrganisationsResponse);
rpc GetProjects(GetProjectsRequest) returns (GetProjectsResponse);
rpc GetDestinationStates(GetDestinationStatesRequest) returns (GetDestinationStatesResponse);
}
message Source {
@@ -131,6 +185,7 @@ message ArtifactDestination {
string type_organisation = 3;
string type_name = 4;
uint64 type_version = 5;
string status = 6;
}
message Project {

View File

@@ -18,6 +18,9 @@ service UsersService {
rpc DeleteUser(DeleteUserRequest) returns (DeleteUserResponse);
rpc ListUsers(ListUsersRequest) returns (ListUsersResponse);
// Stats
rpc GetUserStats(GetUserStatsRequest) returns (GetUserStatsResponse);
// Password management
rpc ChangePassword(ChangePasswordRequest) returns (ChangePasswordResponse);
@@ -280,6 +283,28 @@ message DeletePersonalAccessTokenRequest {
message DeletePersonalAccessTokenResponse {}
// ─── Stats ──────────────────────────────────────────────────────────
message GetUserStatsRequest {
oneof identifier {
string user_id = 1;
string username = 2;
}
}
message GetUserStatsResponse {
UserStats stats = 1;
}
message UserStats {
int64 total_releases = 1;
int64 successful_releases = 2;
int64 failed_releases = 3;
int64 in_progress_releases = 4;
int64 total_annotations = 5;
int64 total_uploads = 6;
}
// ─── MFA ─────────────────────────────────────────────────────────────
enum MfaType {