rdev/internal/port/ci_provider.go
jordan bc47e426b0 feat: Add CI pipeline proxy, DNS alias management, and worker executor system
- Add ListPipelines/GetPipeline to CIProvider port with Woodpecker adapter
- Add DNS alias endpoints: GET/POST/DELETE /projects/{id}/domains
- Implement worker executor daemon, build executor, and git operations
- Add build service, worker service, and build audit tracking
- Add worker registry with PostgreSQL adapter and migration
- Add multi-provider code agent interface (Claude Code + OpenCode)
- Add create-and-build combo endpoint
- Update landing-page cookbook to reflect all gaps closed
- Fix tech debt: unified validation, auth scopes, error wrapping, slog patterns

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 21:05:28 -07:00

39 lines
1.5 KiB
Go

// Package port defines interfaces (ports) for external dependencies.
package port
import (
"context"
"github.com/orchard9/rdev/internal/domain"
)
// CIProvider manages CI/CD pipeline configurations.
// Implementations include Woodpecker, GitHub Actions, GitLab CI, etc.
type CIProvider interface {
// ActivateRepo enables CI for a repository.
// The forge is the git forge (e.g., gitea, github) where the repo lives.
// This creates the necessary webhooks and enables the CI pipeline.
ActivateRepo(ctx context.Context, forge, owner, repo string) (*domain.CIRepo, error)
// DeactivateRepo disables CI for a repository.
DeactivateRepo(ctx context.Context, owner, repo string) error
// GetRepo returns the CI configuration for a repository.
GetRepo(ctx context.Context, owner, repo string) (*domain.CIRepo, error)
// ListRepos returns all repositories visible to the CI system.
ListRepos(ctx context.Context) ([]*domain.CIRepo, error)
// AddSecret adds a secret to a repository for use in pipelines.
AddSecret(ctx context.Context, owner, repo string, secret domain.CISecret) error
// DeleteSecret removes a secret from a repository.
DeleteSecret(ctx context.Context, owner, repo, secretName string) error
// ListPipelines returns recent CI pipeline executions for a repository.
ListPipelines(ctx context.Context, owner, repo string) ([]*domain.CIPipeline, error)
// GetPipeline returns a specific pipeline execution by number.
GetPipeline(ctx context.Context, owner, repo string, number int64) (*domain.CIPipeline, error)
}