e2eauth

package
v0.57.0-rc.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const OkToTestLabel = "ok-to-test"

Variables

View Source
var TrustedAuthorLogins = map[string]bool{
	"renovate-fullsend[bot]": true,
	"fullsend-ai-coder[bot]": true,
}

TrustedAuthorLogins are PR authors that may run e2e without write access. See docs/contributing/bot-identities.md.

Functions

func ResolveCollaboratorRole

func ResolveCollaboratorRole(roleName, permission string) (string, error)

ResolveCollaboratorRole maps GitHub collaborator permission API fields to a canonical role string for the e2e CI gate. Built-in role_name values are cross-checked against permission; custom roles fall back to permission alone.

Types

type GitHubGate

type GitHubGate interface {
	GetPullRequestAuthorizationContext(ctx context.Context, owner, repo string, number int) (*forge.PullRequestAuthorizationContext, error)
	ListIssueLabelEvents(ctx context.Context, owner, repo string, number int) ([]forge.IssueLabelEvent, error)
	RemoveIssueLabel(ctx context.Context, owner, repo string, number int, label string) error
	GetCollaboratorPermissionDetail(ctx context.Context, owner, repo, username string) (forge.GitHubCollaboratorPermissionDetail, error)
}

GitHubGate is the forge surface required for e2e pull-request authorization.

func GateFromForge

func GateFromForge(client forge.Client) (GitHubGate, error)

GateFromForge returns a GitHubGate when client implements the required methods.

type Input

type Input struct {
	Owner           string
	Repo            string
	PRNumber        int
	EventAction     string
	PRUpdatedAt     string
	PRAuthorLogin   string
	LabelActorLogin string
	DryRun          bool
}

Input carries workflow event fields for an authorization decision.

type Result

type Result struct {
	Authorized   bool
	Reason       string
	LabelRemoved bool
	APIError     bool
	Err          error
}

Result is the authorization outcome written to GITHUB_OUTPUT by the gate.

func Check

func Check(ctx context.Context, gh GitHubGate, in Input) Result

Check decides whether a pull request may run credentialed e2e tests in CI.

Jump to

Keyboard shortcuts

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