pullrequests

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package pullrequests opens the pull request of a publish, on the host's API, with the same credential that pushed it, and writes its body: who asked for the work and what gitd checked, so a reviewer reads in a minute what they would otherwise dig for.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Body

func Body(platform string, account Account) string

Body is a pull request's body: the platform's text first, when given, then the order it is merged in with the pull requests of its submodules, and gitd's account of the publish.

A superproject points at its submodules' new commits, so theirs are merged first, each with a merge commit: a squash or a rebase makes other commits, and leaves the superproject pointing at one its submodule's base does not have.

Types

type Account

type Account struct {
	RequestedBy string
	Provenance  *gitdv1.Provenance
	Subjects    []string
	Files       int
	Added       int
	Removed     int
	Rules       publishing.Effective
	Submodules  []string
	// MergeFirst are the pull requests of the submodules the publish points at, to be
	// merged before this one; PartOf is the pull request a submodule's belongs to.
	MergeFirst []string
	PartOf     string
}

Account is what a body tells of a publish.

type Opener

type Opener struct {
	// contains filtered or unexported fields
}

Opener opens pull requests on GitHub with the credential that reaches each repository.

func New

func New(keys *credentials.Keys, github connections.GitHub) *Opener

New returns an opener reaching repositories with keys, and GitHub as github says.

func (*Opener) Edit

func (opener *Opener) Edit(ctx context.Context, request Request, number int64) error

Edit writes request's title and body over those of the pull request number.

func (*Opener) Open

func (opener *Opener) Open(ctx context.Context, request Request) (*gitdv1.OpenedPullRequest, error)

Open opens a pull request and then asks for its reviewers and labels; a review or a label that cannot be asked for is logged, and the pull request stays opened. Asked to update, it writes the title and body over those of the pull request already open from the branch, when one is, and leaves its base, draft, reviewers and labels as they are. A host gitd does not know as GitHub's is refused as unsupported.

type Request

type Request struct {
	Repository repo.Repo
	Branch     string
	Given      []credentials.Credential
	Title      string
	Body       string
	Base       string
	Draft      bool
	Labels     []string
	Reviewers  []string
	Update     bool
}

Request is a pull request to open from a published branch, with the credentials the publish was given. Update says to update the one already open from the branch, if one is, rather than open another.

Jump to

Keyboard shortcuts

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