Documentation
¶
Overview ¶
Package contract implements the GitHubEvent CR contract adapter — the one-way projection from the resolved runtime spec (resolve.ResolvedGitHubEventSpec) to the protobuf contract type (eventscontractv1alpha1.GitHubEventSpec).
The contract type is consumed by infrastructure-layer concerns only:
- Execution hash computation for event deduplication
- Event comparison across webhook redeliveries
- Audit pipelines
Controllers and domain logic MUST NOT consume the returned contract value.
Event type mapping is non-fatal — unknown GitHub event type strings map to UNSPECIFIED rather than returning an error. GitHub may deliver event types the platform has not yet modelled; dropping them to UNSPECIFIED is preferable to failing the entire resolution pipeline.
The common proto wrapper pattern applies: EventType is projected as *v1.GitHubEventType with the enum value on the Type field.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToGitHubEventContract ¶
func ToGitHubEventContract(s *resolve.ResolvedGitHubEventSpec) *eventscontractv1alpha1.GitHubEventSpec
ToGitHubEventContract projects the resolved runtime GitHubEvent spec into a protobuf eventscontractv1alpha1.GitHubEventSpec for infrastructure consumers (hashing, deduplication, comparison, audit).
EventType is projected as a *v1.GitHubEventType wrapper message with the enum value on the Type field.
CommitSha and EventId are identity fields preserved exactly as received from the GitHub webhook payload — no transformation applied.
⚠️ ONE-WAY adapter. The returned value MUST NOT be fed back into any controller or domain logic path.
Types ¶
This section is empty.