resolve

package
v0.8.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package resolve implements resolution for the GitRepository CR.

The GitRepository CR stores its spec as a raw JSON contract (spec.contract). ResolveGitRepository decodes this into a fully typed ResolvedGitRepository — the authoritative runtime representation consumed by all downstream domain and application logic.

Resolution validates required fields (provider, hookUrl, repository) and normalises the optional webhook list. Webhook entries with no valid events are silently skipped — an empty event list is not a valid subscription.

All failures surface as errors. Resolution never panics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitRepositoryRef

type GitRepositoryRef struct {
	Owner string
	Name  string
}

GitRepositoryRef identifies the repository on the provider.

type GitRepositoryWebhook

type GitRepositoryWebhook struct {
	Events []string
}

GitRepositoryWebhook is a single webhook subscription. Events contains the normalised provider event strings ("push", "pull_request" etc.).

type ResolvedGitRepository

type ResolvedGitRepository struct {
	Repository *sourcesv1alpha1.GitRepository
	Spec       *ResolvedGitRepositorySpec
}

ResolvedGitRepository pairs the original Kubernetes GitRepository object with its fully decoded and validated spec.

func ResolveGitRepository

func ResolveGitRepository(repo *sourcesv1alpha1.GitRepository) (*ResolvedGitRepository, error)

ResolveGitRepository decodes and validates the raw JSON contract from the GitRepository CR spec into a ResolvedGitRepository. Returns an error if the CR is nil, the contract is absent, or any required field is missing or malformed.

type ResolvedGitRepositorySpec

type ResolvedGitRepositorySpec struct {
	// Provider is the normalised provider string ("github", "gitlab", etc.).
	// The contract adapter maps this to the proto GitProvider wrapper message.
	Provider string
	// HookURL is the webhook delivery endpoint registered with the provider.
	HookURL    string
	Repository GitRepositoryRef
	// Webhooks is nil when no subscriptions are declared.
	Webhooks []GitRepositoryWebhook
}

ResolvedGitRepositorySpec is the decoded GitRepository spec.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL