Documentation
¶
Index ¶
- Variables
- func VerifyChangeWebhook(secret []byte, signature, event, deliveryID string, body []byte) (gitprovider.VerifiedChangeEvent, error)
- type Client
- func (c *Client) BootstrapRepository(ctx context.Context, req gitprovider.RepositoryBootstrapRequest) (result *gitprovider.RepositoryBootstrapResult, resultErr error)
- func (c *Client) CreateProposal(ctx context.Context, req gitprovider.ProposalRequest) (*gitprovider.ProposalRef, error)
- func (c *Client) DeleteRepository(ctx context.Context, repositoryID string) error
- func (c *Client) GetProposal(ctx context.Context, req gitprovider.ProposalGetRequest) (*gitprovider.ProposalRef, error)
- func (c *Client) ListOpenProposals(ctx context.Context, req gitprovider.ProposalListRequest) ([]gitprovider.ProposalRef, error)
- func (c *Client) PublishProofCheck(ctx context.Context, check gitprovider.ProofCheck) error
- func (c *Client) UpdateProposal(ctx context.Context, req gitprovider.ProposalUpdateRequest) (*gitprovider.ProposalRef, error)
- func (c *Client) ValidateRepository(ctx context.Context, branch string) error
- type InstallationLifecycleEvent
- type InstallationRepository
Constants ¶
This section is empty.
Variables ¶
var ( ErrInstallationLifecycleAuthentication = xerror.New(xerror.KindUnauthorized, "GITHUB_APP_LIFECYCLE_AUTHENTICATION_FAILED", "GitHub App lifecycle authentication failed") ErrInstallationLifecycleIgnored = xerror.New(xerror.KindInvalidInput, "GITHUB_APP_LIFECYCLE_IGNORED", "GitHub App lifecycle event is not handled") ErrInstallationLifecycleTooLarge = xerror.New(xerror.KindInvalidInput, "GITHUB_APP_LIFECYCLE_TOO_LARGE", "GitHub App lifecycle payload is too large") )
Functions ¶
func VerifyChangeWebhook ¶
func VerifyChangeWebhook(secret []byte, signature, event, deliveryID string, body []byte) (gitprovider.VerifiedChangeEvent, error)
VerifyChangeWebhook authenticates and normalizes a GitHub pull-request event. The webhook is only a low-latency signal; upsert processing re-reads the pull request from GitHub before trusting its current head or state. Pipeline paths are resolved later from Braidplane-owned mappings.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps GitHub pull request APIs behind Braidplane's provider proposal contract.
func New ¶
func New( ctx context.Context, config gitprovider.Config, creds gitprovider.Credentials, repo gitprovider.RepositoryRef, ) (*Client, error)
New creates a GitHub provider proposal client.
func (*Client) BootstrapRepository ¶
func (c *Client) BootstrapRepository( ctx context.Context, req gitprovider.RepositoryBootstrapRequest, ) (result *gitprovider.RepositoryBootstrapResult, resultErr error)
BootstrapRepository creates a private GitHub repository with the exact initial template.
func (*Client) CreateProposal ¶
func (c *Client) CreateProposal( ctx context.Context, req gitprovider.ProposalRequest, ) (*gitprovider.ProposalRef, error)
CreateProposal creates a GitHub pull request.
func (*Client) DeleteRepository ¶
DeleteRepository removes the exact bootstrap repository identified by its immutable ID.
func (*Client) GetProposal ¶
func (c *Client) GetProposal( ctx context.Context, req gitprovider.ProposalGetRequest, ) (*gitprovider.ProposalRef, error)
GetProposal returns one pull request, including closed and merged states.
func (*Client) ListOpenProposals ¶
func (c *Client) ListOpenProposals( ctx context.Context, req gitprovider.ProposalListRequest, ) ([]gitprovider.ProposalRef, error)
ListOpenProposals returns open pull requests for the requested source/target branches.
func (*Client) PublishProofCheck ¶
func (c *Client) PublishProofCheck(ctx context.Context, check gitprovider.ProofCheck) error
PublishProofCheck idempotently projects one sanitized receipt onto its exact commit.
func (*Client) UpdateProposal ¶
func (c *Client) UpdateProposal( ctx context.Context, req gitprovider.ProposalUpdateRequest, ) (*gitprovider.ProposalRef, error)
UpdateProposal updates a GitHub pull request title and body.
type InstallationLifecycleEvent ¶
type InstallationLifecycleEvent struct {
DeliveryID string
Action string
InstallationID int64
Added []InstallationRepository
Removed []int64
}
func VerifyInstallationLifecycleWebhook ¶
func VerifyInstallationLifecycleWebhook(secret []byte, signature, event, deliveryID string, body []byte) (InstallationLifecycleEvent, error)