github

package
v0.0.0-...-207e67a Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const GitHubAppID = 1046118
View Source
const OpenshiftEngOrg = GitHubOrg("openshift-eng")
View Source
const OpenshiftOrg = GitHubOrg("openshift")

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(ctx context.Context, org GitHubOrg) *Client

func (*Client) CreatePRComment

func (c *Client) CreatePRComment(org, repo string, number int, comment string) error

func (*Client) DeletePRComment

func (c *Client) DeletePRComment(org, repo string, updateID int64) error

func (*Client) FindCommentID

func (c *Client) FindCommentID(org, repo string, number int, commentKey, commentID string) (*int64, *string, error)

func (*Client) GetPREntry

func (c *Client) GetPREntry(org, repo string, number int) (*PREntry, error)

func (*Client) GetPRSHAMerged

func (c *Client) GetPRSHAMerged(org, repo string, number int, sha string) (*time.Time, error)

GetPRSHAMerged returns the merge time for a PR/SHA combination. The caching is designed to minimize queries to GitHub. We basically have to handle these cases:

  • the PR doesn't exist (cache as nil)
  • the PR is unmerged (cache with nil mergedAt)
  • the PR is merged with a different SHA (cache with the merged sha, return nil)
  • the PR is merged with the same SHA (cache with the merged sha, return merged time)

func (*Client) GetPRTitle

func (c *Client) GetPRTitle(org, repo string, number int) (*string, error)

func (*Client) GetPRURL

func (c *Client) GetPRURL(org, repo string, number int) (*string, error)

func (*Client) IsPrRecentlyMerged

func (c *Client) IsPrRecentlyMerged(org, repo string, number int) (*time.Time, *string, error)

func (*Client) IsWithinRateLimitThreshold

func (c *Client) IsWithinRateLimitThreshold() bool

func (*Client) PRFetch

func (c *Client) PRFetch(org, repo string, number int) (prEntry *PREntry, err error)

PRFetch is an uncached call to github to get the most up to date information on the PR. Use cautiously and only when necessary

type GitHubOrg

type GitHubOrg string

openshift github orgs that our app has access to

type PREntry

type PREntry struct {
	MergedAt *time.Time
	SHA      string
	Title    *string
	URL      *string
	Login    *string
	State    *string
}

Jump to

Keyboard shortcuts

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