{"modulePath":"github.com/Docplanner/github-flow-manager","version":"v1.1.11","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package github\n\n## Types\n\n```go\ntype Author struct {\n\tName githubv4.String\n}\n```\nAuthor represents the information about the commit author\n\n```go\ntype CheckSuite struct {\n\tConclusion githubv4.String\n}\n```\nCheckSuite represents the information about the check suite obtained from Github\n\n```go\ntype CheckSuiteNode struct {\n\tWorkflowRun WorkflowRun\n}\n```\nCheckSuiteNode represents the information about the check suite information of the Node.\n\nIt deliberately does not select the nested checkRuns connection. Check runs are read from statusCheckRollup.contexts instead: nesting checkRuns under checkSuites multiplied the query's node count by suites × runs for every commit, and made whether a run was visible at all depend on where its suite happened to sort. This selection is only needed for a required name that is the name of a \\*workflow\\* rather than of an individual run.\n\n```go\ntype CheckSuites struct {\n\tTotalCount githubv4.Int\n\tPageInfo   PageInfo\n\tNodes      []CheckSuiteNode\n}\n```\nCheckSuites represents the information about the check suite of a slice of Nodes\n\n```go\ntype Commit struct {\n\tSHA           string\n\tMessage       string\n\tParents       []Commit\n\tStatusSuccess bool\n\t// ChecksSummary explains, one line per required check name, why\n\t// StatusSuccess came out the way it did. Empty when no specific check names\n\t// were requested and the GitHub status rollup was used instead.\n\tChecksSummary       []string\n\tAuthoredDate        time.Time\n\tAuthorName          string\n\tSpecificCheckPassed bool\n\t// contains filtered or unexported fields\n}\n```\nCommit represents a specific GitHub commit\n\n```go\nfunc PickFirstParentCommits(fullCommitsList []Commit) []Commit\n```\nPickFirstParentCommits recover the first parent commit of a commit history from a repository\n\n```go\nfunc (c *Commit) ChecksTruncated() bool\n```\nChecksTruncated reports whether some of this commit's check data was left unread because a connection had further pages. A commit that already passed needs no more data; one that did not may only be failing because the deciding check sits on a page nobody fetched.\n\n```go\ntype CommitContextsQuery struct {\n\tRepository struct {\n\t\tObject struct {\n\t\t\tCommit struct {\n\t\t\t\tStatusCheckRollup struct {\n\t\t\t\t\tContexts StatusCheckRollupContexts `graphql:\"contexts(first: $contextsNumber, after: $contextsAfter)\"`\n\t\t\t\t}\n\t\t\t} `graphql:\"... on Commit\"`\n\t\t} `graphql:\"object(oid: $oid)\"`\n\t} `graphql:\"repository(owner: $owner, name: $name)\"`\n}\n```\nCommitContextsQuery fetches one further page of a single commit's status-check rollup contexts.\n\n```go\ntype CommitSuitesQuery struct {\n\tRepository struct {\n\t\tObject struct {\n\t\t\tCommit struct {\n\t\t\t\tCheckSuites CheckSuites `graphql:\"checkSuites(first: $checkSuitesNumber, after: $suitesAfter)\"`\n\t\t\t} `graphql:\"... on Commit\"`\n\t\t} `graphql:\"object(oid: $oid)\"`\n\t} `graphql:\"repository(owner: $owner, name: $name)\"`\n}\n```\nCommitSuitesQuery fetches one further page of a single commit's check suites.\n\n```go\ntype Context struct {\n\tContext githubv4.String\n\tState   githubv4.String\n}\n```\nContext represents the information about the Context\n\n```go\ntype Edge struct {\n\tNode EdgeRootNode\n}\n```\nEdge represents the information about a edge element\n\n```go\ntype EdgeNode struct {\n\tOid     githubv4.String\n\tMessage githubv4.String\n}\n```\nEdgeNode represents the information about an edge node\n\n```go\ntype EdgeParent struct {\n\tNode EdgeNode\n}\n```\nEdgeParent represents the information about a parent node\n\n```go\ntype EdgeRootNode struct {\n\tParents           ParentsEdge `graphql:\"parents(first: $parentsNumber)\"`\n\tOid               githubv4.String\n\tMessage           githubv4.String\n\tAuthoredDate      githubv4.DateTime\n\tAuthor            Author\n\tStatusCheckRollup StatusCheckRollup\n\tCheckSuites       CheckSuites `graphql:\"checkSuites(first: $checkSuitesNumber)\"`\n\tStatus            NodeStatus\n}\n```\nEdgeRootNode represents the information about a edge root node\n\n```go\ntype Error struct {\n\tMessage       string\n\tPreviousError error\n}\n```\nError represents a specific error in commit check\n\n```go\nfunc (e Error) Error() string\n```\n\n```go\ntype History struct {\n\tEdges []Edge\n}\n```\nHistory represents the information about a slice of Edges\n\n```go\ntype Manager struct {\n\tContext    context.Context\n\tClient     *githubv4.Client\n\tHTTPClient *http.Client\n}\n```\nManager represents the information necessary in Github to manage the repository\n\n```go\nfunc New(githubAccessToken string) *Manager\n```\nNew creates a new githubManager using a github access token\n\n```go\nfunc (gm *Manager) ChangeBranchHead(owner, repo, branch, sha string, force bool) error\n```\nChangeBranchHead change the head of a branch TODO remove v3 client when implemented in v4\n\n```go\nfunc (gm *Manager) GetCommits(owner, repo, branch string, lastCommitsNumber int, specificChecksNames string, sep string, acceptSkippedChecks bool, contextsNumber, checkSuitesNumber int) ([]Commit, error)\n```\nGetCommits recover the commits for a specific repository in a specific branch. When specificChecksNames is set, every name it contains must be satisfied on a commit for its StatusSuccess to be true; acceptSkippedChecks additionally lets a check GitHub reports as SKIPPED count as satisfied.\n\n```go\nfunc (gm *Manager) TopUpChecks(owner, repo string, c *Commit) error\n```\nTopUpChecks reads the check data that did not fit in the first page and folds it into the commit's verdict.\n\nBoth statusCheckRollup.contexts and checkSuites are capped at 100 entries per page and real repositories exceed that, so a commit can look unsatisfied purely because the deciding check sat on a page nobody asked for. Rather than judging on a partial view, fetch the rest — but only when it can still change the answer, which is why callers invoke this per commit they actually examine instead of for the whole history up front. It stops as soon as every required name is satisfied.\n\n```go\ntype NodeStatus struct {\n\tContexts []Context\n}\n```\nNodeStatus represents the information about a slice of Contexts.\n\nCommit.status.contexts is a plain list rather than a connection, so this is always the complete set of classic commit statuses — there is nothing to paginate.\n\n```go\ntype PageInfo struct {\n\tHasNextPage githubv4.Boolean\n\tEndCursor   githubv4.String\n}\n```\nPageInfo carries a connection's cursor so the pages that did not fit can be fetched on demand.\n\n```go\ntype ParentsEdge struct {\n\tEdges []EdgeParent\n}\n```\nParentsEdge represents the information about the parents edge\n\n```go\ntype Query struct {\n\tRepository Repository `graphql:\"repository(owner: $owner, name: $name)\"`\n}\n```\nQuery represents the information obtained in a Github Query\n\n```go\ntype Ref struct {\n\tTarget Target\n}\n```\nRef represents the information about a ref element\n\n```go\ntype Repository struct {\n\tRef Ref `graphql:\"ref(qualifiedName: $branch)\"`\n}\n```\nRepository represents the information obtained about a repository in a Github Query\n\n```go\ntype RollupCheckRun struct {\n\tName       githubv4.String\n\tStatus     githubv4.String\n\tConclusion githubv4.String\n}\n```\nRollupCheckRun is the CheckRun member of the statusCheckRollup contexts union.\n\n```go\ntype RollupContext struct {\n\tTypename      githubv4.String     `graphql:\"__typename\"`\n\tStatusContext RollupStatusContext `graphql:\"... on StatusContext\"`\n\tCheckRun      RollupCheckRun      `graphql:\"... on CheckRun\"`\n}\n```\nRollupContext is one entry of statusCheckRollup.contexts, a union of StatusContext and CheckRun. Typename says which member is populated.\n\n```go\ntype RollupStatusContext struct {\n\tContext githubv4.String\n\tState   githubv4.String\n}\n```\nRollupStatusContext is the StatusContext member of the statusCheckRollup contexts union: a classic commit status, as reported through the rollup.\n\n```go\ntype StatusCheckRollup struct {\n\tState    githubv4.String\n\tContexts StatusCheckRollupContexts `graphql:\"contexts(first: $contextsNumber)\"`\n}\n```\nStatusCheckRollup represents the information about the status check of rollup\n\n```go\ntype StatusCheckRollupContexts struct {\n\tTotalCount githubv4.Int\n\tPageInfo   PageInfo\n\tNodes      []RollupContext\n}\n```\nStatusCheckRollupContexts represents the information about the status check of rollup contexts.\n\nThis is where check runs are read from. GitHub returns the latest run per check name here, so re-runs of the same check arrive as one entry rather than one per attempt, and the list is flat rather than grouped by suite.\n\n```go\ntype Target struct {\n\tCommit TargetCommit `graphql:\"... on Commit\"`\n}\n```\nTarget represents the target of a specific commit\n\n```go\ntype TargetCommit struct {\n\tHistory History `graphql:\"history(first: $commitsNumber)\"`\n}\n```\nTargetCommit represents the information about a commit history\n\n```go\ntype Workflow struct {\n\tName githubv4.String\n}\n```\nWorkflow represents the information of the Github Workflow\n\n```go\ntype WorkflowRun struct {\n\tWorkflow   Workflow\n\tCheckSuite CheckSuite\n}\n```\nWorkflowRun represents the information about the workflow run execution\n\n","path":"github.com/Docplanner/github-flow-manager/github","name":"github","synopsis":"","isRedistributable":true}
