platform

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

internal/platform/gitea.go

internal/platform/github.go

internal/platform/platform.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JobLog

type JobLog struct {
	Name string
	Log  string
}

JobLog holds the name and log text of a failed CI job.

type Platform

type Platform interface {
	SetCommitStatus(ctx context.Context, state, description string) error
	EnsureLabelExists(ctx context.Context) error
	FindIssueForCommit(ctx context.Context, sha string) (int, bool, error)
	CreateIssue(ctx context.Context, sha, diagnosis, provider string, failedJobs []string, runID string) (int, error)
	AddComment(ctx context.Context, issueNumber int, diagnosis, provider string) error
	FetchFailedJobLogs(ctx context.Context, runID string) ([]JobLog, error)
}

Platform is the port for CI platform operations.

func New

func New(name, repo, runID, commitSHA, token, baseURL string) (Platform, error)

New returns the appropriate Platform adapter based on name ("gitea" or "github"). baseURL is required for gitea; for github it defaults to https://api.github.com. Passing a non-empty baseURL for github overrides the default (useful in tests).

Jump to

Keyboard shortcuts

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