Documentation
¶
Overview ¶
Package platform defines the platform-neutral types (repos, events) and the interface every git hosting adapter implements.
Index ¶
Constants ¶
This section is empty.
Variables ¶
ErrUnauthorized is returned by ParseWebhook when authentication fails.
Functions ¶
func BranchHasPrefix ¶ added in v0.3.0
BranchHasPrefix reports whether branch starts with any of the prefixes.
func CheckedItems ¶
CheckedItems counts checked markdown todo items ("- [x] ...") in text. Used to detect Renovate checkbox ticks in MR/issue descriptions: a tick is a transition where the checked count increases.
func CheckedMarkerItems ¶ added in v0.2.0
CheckedMarkerItems counts checked todo items that carry a Renovate HTML comment marker (e.g. "- [x] <!-- rebase-check -->..."). Renovate embeds such markers in every actionable checkbox, so this filters out ordinary human task lists.
func HasRenovateDebugMarker ¶ added in v0.3.0
HasRenovateDebugMarker reports whether text contains renovate's debug HTML comment ("<!--renovate-debug:...-->"). Renovate appends it to every MR/PR description, so it reliably identifies renovate MRs even when the checkbox lines carry no markers.
func RepoAllowed ¶ added in v0.2.0
RepoAllowed reports whether a repo full name is inside one of the configured groups/orgs (path-prefix match, case-insensitive). With no groups configured, all repos are allowed.
Types ¶
type Platform ¶
type Platform interface {
Name() string
WebhookPath() string
// ParseWebhook authenticates and parses a webhook request. body is the
// already-read request body. Returns (nil, nil) when the event needs no
// action, ErrUnauthorized when authentication fails.
ParseWebhook(r *http.Request, body []byte) (*Event, error)
// DiscoverRepos lists all repos under the configured groups/orgs.
DiscoverRepos(ctx context.Context) ([]Repo, error)
// Schedule returns the cron schedule config for this platform.
Schedule() config.Schedule
// AllowsRepo reports whether the repo is inside the platform's
// configured groups/orgs (empty configuration allows all).
AllowsRepo(fullName string) bool
}
Platform abstracts a git hosting platform.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package github adapts GitHub (cloud or enterprise) to the platform interface: org webhook parsing and repo discovery.
|
Package github adapts GitHub (cloud or enterprise) to the platform interface: org webhook parsing and repo discovery. |
|
Package gitlab adapts a GitLab instance to the platform interface: group webhook parsing and project discovery.
|
Package gitlab adapts a GitLab instance to the platform interface: group webhook parsing and project discovery. |