Documentation
¶
Overview ¶
Package lavaflow performs the LavaFlow workflows behind the volcano cloud lavaflow subcommands. LavaFlow reads a project's runtime errors, diagnoses the issues they group into, and opens pull requests that fix them.
Index ¶
- Constants
- Variables
- type Service
- func (s Service) GetRun(ctx context.Context, rawID string) (*apiclient.LavaFlowRun, error)
- func (s Service) ListRuns(ctx context.Context, limit int, cursor string) (*apiclient.PaginatedLavaFlowRuns, error)
- func (s Service) Repository(ctx context.Context) (state, name string, err error)
- func (s Service) SetEnabled(ctx context.Context, enabled bool) (*apiclient.LavaFlowSettings, error)
- func (s Service) StartRun(ctx context.Context, rawIssueID string) (*apiclient.LavaFlowRun, error)
- func (s Service) Status(ctx context.Context) (*Status, error)
- type Status
Constants ¶
const ( RepositoryConnected = "connected" RepositoryNotConnected = "not_connected" // RepositoryUnknown means the connection could not be read, so the status // says nothing about it rather than claim none is connected. RepositoryUnknown = "unknown" )
Whether a repository is connected for LavaFlow's fix pull requests.
const CostNote = "LavaFlow is in preview. During the preview, it needs the SUPERAGENT plan."
CostNote is what LavaFlow needs during the preview, worded as the dashboard, the pricing page and the public docs word it. It names no billing model.
const MaxRunsLimit = 100
MaxRunsLimit is the largest page of runs the API returns.
const OnDescription = "LavaFlow uses AI to diagnose this project's errors from their logs and deployed source, " +
"and opens fix pull requests in your connected repository."
OnDescription says what LavaFlow does, and that it uses AI to do it, in the wording approved for that disclosure. Keep it verbatim: it opens the help, enable's output and the docs.
Variables ¶
ErrUnavailable reports an API where LavaFlow is not on: a platform release older than LavaFlow, which has none of its routes, or one where Volcano has not turned it on or has switched it off. Said in place of the 404 either answers, which otherwise reads as a missing project or run.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service performs LavaFlow workflows against the current project.
func NewService ¶
func NewService(deps cliruntime.Deps) Service
NewService returns a LavaFlow service.
func (Service) ListRuns ¶
func (s Service) ListRuns(ctx context.Context, limit int, cursor string) (*apiclient.PaginatedLavaFlowRuns, error)
ListRuns returns one page of the current project's runs, newest first. cursor is "" for the first page.
func (Service) Repository ¶
Repository says which repository LavaFlow's fix pull requests go to, for a project whose LavaFlow settings were just read or saved: its state, and its full name when it is connected. Only a cancel or deadline is an error.
func (Service) SetEnabled ¶
SetEnabled turns LavaFlow on or off for the current project. The update changes only the fields it sends, so it sends enabled alone: a manifest's max_stage and auto_trigger stay as they are.
type Status ¶
type Status struct {
Settings *apiclient.LavaFlowSettings `json:"settings"`
RepositoryState string `json:"repository_state"`
// Repository is the connected repository's full name, set only when
// RepositoryState is RepositoryConnected.
Repository string `json:"repository,omitempty"`
}
Status is a project's LavaFlow settings and whether a repository is connected for its fix pull requests.