Documentation
¶
Index ¶
- Variables
- func ValidateCampaign(c Campaign) error
- type Actor
- type Campaign
- type CampaignStatus
- type Gate
- type Guidance
- type ManageMode
- type Metric
- type Pitfall
- type Review
- type ReviewFinding
- type SessionRoute
- type Snapshot
- type Store
- func (s *Store) AppendGuidance(campaignID string, guidance Guidance) (Campaign, Guidance, error)
- func (s *Store) AppendPitfall(campaignID string, pitfall Pitfall) (Campaign, Pitfall, error)
- func (s *Store) AppendReview(campaignID string, review Review) (Campaign, Review, error)
- func (s *Store) CreateCampaign(c Campaign) (Campaign, error)
- func (s *Store) GetCampaign(campaignID string) (Campaign, error)
- func (s *Store) ListCampaigns(visibilityKey, statusFilter string, limit int) ([]Campaign, error)
- func (s *Store) PatchCampaign(campaignID string, mutate func(*Campaign) error) (Campaign, error)
- func (s *Store) Path() string
- func (s *Store) UpsertTrial(campaignID string, trial Trial) (Campaign, Trial, error)
- type Trial
- type TrialStatus
- type Verdict
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrCampaignNotFound = errors.New("campaign not found")
)
Functions ¶
func ValidateCampaign ¶
Types ¶
type Actor ¶
type Actor struct {
UserID string `json:"user_id,omitempty"`
OpenID string `json:"open_id,omitempty"`
Name string `json:"name,omitempty"`
}
func (Actor) PreferredID ¶
type Campaign ¶
type Campaign struct {
ID string `json:"id"`
Title string `json:"title,omitempty"`
Objective string `json:"objective"`
Repo string `json:"repo,omitempty"`
IssueIID string `json:"issue_iid,omitempty"`
IssueURL string `json:"issue_url,omitempty"`
Session SessionRoute `json:"session"`
Creator Actor `json:"creator"`
ManageMode ManageMode `json:"manage_mode"`
Status CampaignStatus `json:"status"`
MaxParallelTrials int `json:"max_parallel_trials,omitempty"`
Summary string `json:"summary,omitempty"`
CurrentWinnerTrialID string `json:"current_winner_trial_id,omitempty"`
Baseline []Metric `json:"baseline,omitempty"`
Gates []Gate `json:"gates,omitempty"`
Trials []Trial `json:"trials,omitempty"`
Guidance []Guidance `json:"guidance,omitempty"`
Reviews []Review `json:"reviews,omitempty"`
Pitfalls []Pitfall `json:"pitfalls,omitempty"`
Tags []string `json:"tags,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Revision int64 `json:"revision"`
}
func NormalizeCampaign ¶
type CampaignStatus ¶
type CampaignStatus string
const ( StatusPlanned CampaignStatus = "planned" StatusRunning CampaignStatus = "running" StatusHold CampaignStatus = "hold" StatusMerged CampaignStatus = "merged" StatusRejected CampaignStatus = "rejected" StatusCompleted CampaignStatus = "completed" StatusCanceled CampaignStatus = "canceled" )
type ManageMode ¶
type ManageMode string
const ( ManageModeCreatorOnly ManageMode = "creator_only" ManageModeScopeAll ManageMode = "scope_all" )
type Pitfall ¶
type Pitfall struct {
ID string `json:"id"`
Summary string `json:"summary,omitempty"`
Reason string `json:"reason,omitempty"`
RelatedTrialID string `json:"related_trial_id,omitempty"`
RetryIf string `json:"retry_if,omitempty"`
Tags []string `json:"tags,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
}
type Review ¶
type Review struct {
ID string `json:"id"`
ReviewerID string `json:"reviewer_id,omitempty"`
Provider string `json:"provider,omitempty"`
Model string `json:"model,omitempty"`
Verdict Verdict `json:"verdict,omitempty"`
Summary string `json:"summary,omitempty"`
Blocking bool `json:"blocking,omitempty"`
Confidence string `json:"confidence,omitempty"`
Findings []ReviewFinding `json:"findings,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
}
type ReviewFinding ¶
type SessionRoute ¶
type SessionRoute struct {
ScopeKey string `json:"scope_key"`
ReceiveIDType string `json:"receive_id_type,omitempty"`
ReceiveID string `json:"receive_id,omitempty"`
ChatType string `json:"chat_type,omitempty"`
}
func (SessionRoute) VisibilityKey ¶ added in v0.3.16
func (r SessionRoute) VisibilityKey() string
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) AppendGuidance ¶
func (*Store) AppendPitfall ¶
func (*Store) AppendReview ¶
func (*Store) ListCampaigns ¶
func (*Store) PatchCampaign ¶
type Trial ¶
type Trial struct {
ID string `json:"id"`
Title string `json:"title,omitempty"`
Hypothesis string `json:"hypothesis,omitempty"`
Branch string `json:"branch,omitempty"`
MergeReq string `json:"merge_request,omitempty"`
Executor string `json:"executor,omitempty"`
Resource string `json:"resource,omitempty"`
JobID string `json:"job_id,omitempty"`
Status TrialStatus `json:"status"`
Verdict Verdict `json:"verdict,omitempty"`
Summary string `json:"summary,omitempty"`
Metrics []Metric `json:"metrics,omitempty"`
Tags []string `json:"tags,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
CompletedAt time.Time `json:"completed_at,omitempty"`
}
type TrialStatus ¶
type TrialStatus string
const ( TrialStatusPlanned TrialStatus = "planned" TrialStatusRunning TrialStatus = "running" TrialStatusCandidate TrialStatus = "candidate" TrialStatusHold TrialStatus = "hold" TrialStatusCompleted TrialStatus = "completed" TrialStatusMerged TrialStatus = "merged" TrialStatusRejected TrialStatus = "rejected" TrialStatusAborted TrialStatus = "aborted" )
type Verdict ¶
type Verdict string
const ( VerdictMerge Verdict = "merge" VerdictReject Verdict = "reject" VerdictHold Verdict = "hold" VerdictNeedsMoreEvidence Verdict = "needs-more-evidence" VerdictAborted Verdict = "aborted" VerdictApprove Verdict = "approve" VerdictConcern Verdict = "concern" VerdictBlocking Verdict = "blocking" )
Click to show internal directories.
Click to hide internal directories.