contract

package
v0.8.9 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: 4 Imported by: 0

Documentation

Overview

Package contract implements the GitRepository CR contract adapter — the one-way projection from the resolved runtime spec (resolve.ResolvedGitRepositorySpec) to the protobuf contract type (sourcescontractv1alpha1.GitRepositorySpec).

The contract type is consumed by infrastructure-layer concerns only:

  • Execution hash computation for repository deduplication
  • Spec comparison across reconciliation cycles
  • Audit pipelines

Controllers and domain logic MUST NOT consume the returned contract value.

The common proto wrapper pattern applies throughout:

  • Provider → *v1.GitProvider{Provider: enumVal}
  • Webhook events → []*v1.GitEventType{{Type: enumVal}}

GitRepositoryRef and GitRepositoryWebhook are local messages in the sources v1alpha1 package, not common types.

Provider mapping is fatal on unknown values — providers are a platform-controlled closed set. Event type mapping is also fatal — unknown event strings indicate a misconfigured webhook spec.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToGitRepositoryContract

ToGitRepositoryContract projects the resolved runtime GitRepository spec into a protobuf sourcescontractv1alpha1.GitRepositorySpec for infrastructure consumers (hashing, comparison, audit).

Provider and webhook event types are projected as wrapper message instances. Returns an error when the provider string is unknown or any webhook event string is unsupported.

⚠️ ONE-WAY adapter. The returned value MUST NOT be fed back into any controller or domain logic path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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