Documentation
¶
Overview ¶
Package github implements providers.Provider for GitHub Actions.
This is a thin adapter around the existing pkg/github.Client, translating its types into the provider-neutral interface.
Index ¶
- type Provider
- func (p *Provider) CatchUpPoll(ctx context.Context) error
- func (p *Provider) ClaimJob(ctx context.Context, event *providers.JobEvent, runnerName string, ...) (*providers.Claim, error)
- func (p *Provider) CleanStaleWebhooks(ctx context.Context)
- func (p *Provider) DefaultImage() string
- func (p *Provider) DefaultImageFor(os string) string
- func (p *Provider) DefaultJobImage() string
- func (p *Provider) DeregisterWebhooks(ctx context.Context) error
- func (p *Provider) Events() <-chan providers.JobEvent
- func (p *Provider) FetchJobImage(ctx context.Context, event *providers.JobEvent) string
- func (p *Provider) Name() string
- func (p *Provider) RateSnapshot() (remaining, limit int64, reset, updated time.Time)
- func (p *Provider) RegisterWebhooks(ctx context.Context, url, secret string) error
- func (p *Provider) ReleaseJob(ctx context.Context, claim *providers.Claim) error
- func (p *Provider) ReportsRunnerNames() bool
- func (p *Provider) Start(ctx context.Context, cfg providers.PollConfig) (<-chan providers.JobEvent, error)
- func (p *Provider) Stop(ctx context.Context) error
- func (p *Provider) WebhookHandler(secret string) (http.Handler, <-chan providers.JobEvent)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements providers.Poll and providers.Webhook for GitHub Actions.
func New ¶
New creates a GitHub provider wrapping an existing GitHub client. linuxImage / windowsImage, if non-empty, override the runner container image for the corresponding job OS. Empty values defer to the built-in Linux default and (for Windows) the runtime's host-matched servercore fallback.
func (*Provider) CatchUpPoll ¶
CatchUpPoll fires a single poll to discover jobs queued while ephemerd was offline. Used in webhook mode (where continuous polling is disabled) to catch jobs that transitioned to "queued" before webhooks could be registered — webhook events aren't replayed for jobs already in that state.
func (*Provider) CleanStaleWebhooks ¶
CleanStaleWebhooks removes any workflow_job webhooks left behind by previous ephemerd instances that crashed or were killed without cleanup. Called on startup before registering new webhooks to avoid hitting GitHub's 20-hook limit.
func (*Provider) DefaultImage ¶
DefaultImage returns the Linux runner image (legacy alias for the scheduler's per-OS resolution). New callers should use DefaultImageFor.
func (*Provider) DefaultImageFor ¶
func (*Provider) DefaultJobImage ¶
func (*Provider) DeregisterWebhooks ¶
func (*Provider) Events ¶
Events exposes the provider's poll-event channel without starting the poll loop. In webhook mode the scheduler never calls Start(), but CatchUpPoll still emits into this channel — the scheduler must drain it or the startup recovery events rot in the channel buffer unobserved.
func (*Provider) FetchJobImage ¶
func (*Provider) RateSnapshot ¶
RateSnapshot exposes the underlying GitHub client's last-observed rate-limit state so the scheduler's retry queue can bias backoff: when remaining==0 with a fresh update timestamp and reset > now, the next attempt is snapped just past the reset. Zero values mean "no data yet" (the client has not yet made a request).
func (*Provider) RegisterWebhooks ¶
func (*Provider) ReleaseJob ¶
func (*Provider) ReportsRunnerNames ¶
ReportsRunnerNames implements providers.RunnerNameReporter: GitHub workflow_job webhooks carry runner_name on in_progress and completed actions, so the scheduler may key runner teardown and the orphan sweep on observed assignments for runners dispatched via this provider.