feat: implement proto-gen platform
- Config loader with env var expansion and validation - SQLite database with tasks and toolchain_versions tables - Gitea REST API client for repository and branch operations - K8s client for Job lifecycle management (with noop fallback for local dev) - REST API: tasks CRUD, retry, plugins, version management - Worker/scheduler with polling, concurrency control, and job tracking - Static frontend: generate, tasks, settings pages - Toolchain images: Go and Node.js Dockerfiles with entrypoint scripts - Helm chart with deployment, service, configmap, ingress, PVC - Multi-stage Dockerfile for service - Unit tests for config, database, gitclient, k8s, api, worker - E2E tests for idempotency, version switch, failure recovery
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
type TaskStatus string
|
||||
|
||||
const (
|
||||
StatusPending TaskStatus = "pending"
|
||||
StatusRunning TaskStatus = "running"
|
||||
StatusSuccess TaskStatus = "success"
|
||||
StatusFailed TaskStatus = "failed"
|
||||
)
|
||||
|
||||
type Task struct {
|
||||
ID string `json:"id"`
|
||||
Status TaskStatus `json:"status"`
|
||||
Language string `json:"language"`
|
||||
ProtoRepo string `json:"proto_repo"`
|
||||
ProtoBranch string `json:"proto_branch"`
|
||||
ProtoCommit string `json:"proto_commit,omitempty"`
|
||||
TargetRepo string `json:"target_repo"`
|
||||
ToolchainImage string `json:"toolchain_image"`
|
||||
ImageDigest string `json:"image_digest,omitempty"`
|
||||
ResultCommit string `json:"result_commit,omitempty"`
|
||||
Error string `json:"error,omitempty"`
|
||||
Log string `json:"log,omitempty"`
|
||||
Retries int `json:"retries"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
type ToolchainVersion struct {
|
||||
Language string `json:"language"`
|
||||
ImageTag string `json:"image_tag"`
|
||||
Enabled bool `json:"enabled"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
Reference in New Issue
Block a user