githubpr

package
v0.0.39 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package githubpr wraps the git + gh CLI invocations seictl onboard uses to land an engineer cell as a PR against the platform repo.

Production callers stub this whole package via the onboard verb's dep seam; tests don't usually need to exercise the shell-out layer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAuth

func CheckAuth() error

CheckAuth runs `gh auth status`. seictl onboard refuses to run without it because we'd fail at PR creation anyway and leave a half-prepared branch behind.

func CheckCleanTree

func CheckCleanTree(repoPath string) error

CheckCleanTree returns nil if the platform repo has no staged or unstaged changes to tracked files. Untracked files are tolerated because CreatePR adds explicit paths via `git add <file>`, never `-A`.

func DiscoverRepo

func DiscoverRepo(start string) (string, error)

DiscoverRepo walks up from start looking for a directory that contains both `.git/` and `clusters/harbor/`. Returns the absolute path or an error if no marker is found by the filesystem root.

func EnsureBaseUpToDate

func EnsureBaseUpToDate(repoPath, baseBranch string) error

EnsureBaseUpToDate errors if local HEAD is missing commits from origin/<baseBranch>. Without this guard, onboard would read a stale aggregator from the working tree and silently overwrite peer entries when the PR landed.

Types

type Options

type Options struct {
	RepoPath      string // platform repo on disk
	Branch        string // e.g. "seictl/onboard-bdc"
	BaseBranch    string // usually "main"
	CommitMessage string
	PRTitle       string
	PRBody        string
	Files         map[string][]byte // repo-relative path → content
}

Options drives a CreatePR run.

type Result

type Result struct {
	Branch string
	URL    string
}

Result is what CreatePR returns on success.

func CreatePR

func CreatePR(opts Options) (*Result, error)

CreatePR branches, writes files, commits, pushes, and opens a PR. Idempotent against a prior partial run: a remote branch with an open PR returns that PR's URL with no further mutation.

Jump to

Keyboard shortcuts

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