data

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EventTypes is a list of event types to import
	EventTypePR           string = "pr"
	EventTypePRReview     string = "pr_review"
	EventTypeIssue        string = "issue"
	EventTypeIssueComment string = "issue_comment"
	EventTypeFork         string = "fork"

	EventAgeMonthsDefault = 6
)
View Source
const (
	DataFileName string = "data.db"
)

Variables

View Source
var (
	UpdatableProperties = []string{
		"entity",
	}
)

Functions

func CleanEntities

func CleanEntities(db *sql.DB) error

func ClearState

func ClearState(db *sql.DB, org, repo string) error

func Contains

func Contains[T comparable](list []T, val T) bool

Contains checks for val in list

func GetCNCFEntityAffiliations

func GetCNCFEntityAffiliations(ctx context.Context) (map[string]*CNCFDeveloper, error)

func GetDB

func GetDB(path string) (*sql.DB, error)

func GetDataState

func GetDataState(db *sql.DB) (map[string]int64, error)

GetDataState returns the current state of the database.

func GetDeveloperUsernames

func GetDeveloperUsernames(db *sql.DB) ([]string, error)

func GetMinEventDate

func GetMinEventDate(db *sql.DB, org, repo *string) (string, error)

GetMinEventDate returns the earliest event date, optionally filtered by org/repo.

func GetNoFullnameDeveloperUsernames

func GetNoFullnameDeveloperUsernames(db *sql.DB) ([]string, error)

func GetOrgRepoNames

func GetOrgRepoNames(ctx context.Context, client *http.Client, org string) ([]string, error)

func ImportAllReleases

func ImportAllReleases(dbPath, token string) error

func ImportAllRepoMeta

func ImportAllRepoMeta(dbPath, token string) error

func ImportAllRepoMetricHistory added in v0.8.0

func ImportAllRepoMetricHistory(dbPath, token string) error

ImportAllRepoMetricHistory backfills metric history for all known org/repo pairs.

func ImportReleases

func ImportReleases(dbPath, token, owner, repo string) error

func ImportRepoMeta

func ImportRepoMeta(dbPath, token, owner, repo string) error

func ImportRepoMetricHistory added in v0.8.0

func ImportRepoMetricHistory(dbPath, token, owner, repo string) error

ImportRepoMetricHistory backfills daily star and fork counts for the last 30 days.

func Init

func Init(dbFilePath string) error

Init initializes the database for a given name.

func SaveDevelopers

func SaveDevelopers(db *sql.DB, devs []*Developer) error

func SaveState

func SaveState(db *sql.DB, query, org, repo string, state *State) error

func UpdateDeveloper

func UpdateDeveloper(ctx context.Context, db *sql.DB, client *http.Client, username string, cDev *CNCFDeveloper) error

func UpdateDeveloperNames

func UpdateDeveloperNames(db *sql.DB, devs map[string]string) error

func UpdateEvents

func UpdateEvents(dbPath, token string) (map[string]int, error)

ImportEvents imports events from GitHub for a given org/repo combination.

Types

type AffiliationImportResult

type AffiliationImportResult struct {
	Duration   string `json:"duration,omitempty" yaml:"duration,omitempty"`
	DBDevs     int    `json:"db_devs,omitempty" yaml:"dbDevs,omitempty"`
	CNCFDevs   int    `json:"cncf_devs,omitempty" yaml:"cncfDevs,omitempty"`
	MappedDevs int    `json:"mapped_devs,omitempty" yaml:"mappedDevs,omitempty"`
}

func UpdateDevelopersWithCNCFEntityAffiliations

func UpdateDevelopersWithCNCFEntityAffiliations(ctx context.Context, db *sql.DB, client *http.Client) (*AffiliationImportResult, error)

UpdateDevelopersWithCNCFEntityAffiliations updates the developers with the CNCF entity affiliations.

type CNCFAffiliation

type CNCFAffiliation struct {
	Entity string `json:"entity,omitempty" yaml:"entity,omitempty"`
	From   string `json:"from,omitempty" yaml:"from,omitempty"`
	To     string `json:"to,omitempty" yaml:"to,omitempty"`
}

type CNCFDeveloper

type CNCFDeveloper struct {
	Username     string             `json:"username,omitempty" yaml:"username,omitempty"`
	Identities   []string           `json:"identities,omitempty" yaml:"identities,omitempty"`
	Affiliations []*CNCFAffiliation `json:"affiliations,omitempty" yaml:"affiliations,omitempty"`
}

func (*CNCFDeveloper) GetBestIdentity

func (c *CNCFDeveloper) GetBestIdentity() string

func (*CNCFDeveloper) GetLatestAffiliation

func (c *CNCFDeveloper) GetLatestAffiliation() string

type ChangeFailureRateSeries added in v0.9.0

type ChangeFailureRateSeries struct {
	Months      []string  `json:"months" yaml:"months"`
	Failures    []int     `json:"failures" yaml:"failures"`
	Deployments []int     `json:"deployments" yaml:"deployments"`
	Rate        []float64 `json:"rate" yaml:"rate"`
}

func GetChangeFailureRate added in v0.9.0

func GetChangeFailureRate(db *sql.DB, org, repo, entity *string, months int) (*ChangeFailureRateSeries, error)

type ContributorFunnelSeries added in v0.9.0

type ContributorFunnelSeries struct {
	Months       []string `json:"months" yaml:"months"`
	FirstComment []int    `json:"first_comment" yaml:"firstComment"`
	FirstPR      []int    `json:"first_pr" yaml:"firstPR"`
	FirstMerge   []int    `json:"first_merge" yaml:"firstMerge"`
}

func GetContributorFunnel added in v0.9.0

func GetContributorFunnel(db *sql.DB, org, repo, entity *string, months int) (*ContributorFunnelSeries, error)

type CountedItem

type CountedItem struct {
	Name  string `json:"name,omitempty" yaml:"name,omitempty"`
	Count int    `json:"count,omitempty" yaml:"count,omitempty"`
}

func GetDeveloperPercentages

func GetDeveloperPercentages(db *sql.DB, entity, org, repo *string, ex []string, months int) ([]*CountedItem, error)

GetOrgRepoPercentages returns a list of repo percentages for the given organization.

func GetEntityPercentages

func GetEntityPercentages(db *sql.DB, entity, org, repo *string, ex []string, months int) ([]*CountedItem, error)

GetEntityPercentages returns a list of entity percentages for the given repository.

func QueryEntities

func QueryEntities(db *sql.DB, val string, limit int) ([]*CountedItem, error)

type CountedResult

type CountedResult struct {
	Query   Query            `json:"query,omitempty" yaml:"query,omitempty"`
	Results int              `json:"results,omitempty" yaml:"results,omitempty"`
	Data    map[string]int64 `json:"data,omitempty" yaml:"data,omitempty"`
}

type DailyActivitySeries added in v0.8.1

type DailyActivitySeries struct {
	Dates  []string `json:"dates"`
	Counts []int    `json:"counts"`
}

func GetDailyActivity added in v0.8.1

func GetDailyActivity(db *sql.DB, org, repo, entity *string, months int) (*DailyActivitySeries, error)

type DeepReputationResult added in v0.7.2

type DeepReputationResult struct {
	Scored  int `json:"scored" yaml:"scored"`
	Skipped int `json:"skipped" yaml:"skipped"`
	Errors  int `json:"errors" yaml:"errors"`
}

DeepReputationResult is returned by the bulk deep scoring step.

func ImportDeepReputation added in v0.7.2

func ImportDeepReputation(db *sql.DB, token string, limit int, org, repo *string) (*DeepReputationResult, error)

ImportDeepReputation deep-scores the N lowest-reputation contributors using GitHub API signals. Runs after shallow scoring; errors are per-user and never fatal to the overall import.

type DeleteResult added in v0.7.5

type DeleteResult struct {
	Org           string `json:"org" yaml:"org"`
	Repo          string `json:"repo" yaml:"repo"`
	Events        int64  `json:"events" yaml:"events"`
	RepoMeta      int64  `json:"repo_meta" yaml:"repo_meta"`
	Releases      int64  `json:"releases" yaml:"releases"`
	ReleaseAssets int64  `json:"release_assets" yaml:"release_assets"`
	State         int64  `json:"state" yaml:"state"`
}

func DeleteRepoData added in v0.7.5

func DeleteRepoData(db *sql.DB, org, repo string) (*DeleteResult, error)

type Developer

type Developer struct {
	Username      string `json:"username,omitempty" yaml:"username,omitempty"`
	FullName      string `json:"full_name,omitempty" yaml:"fullName,omitempty"`
	Email         string `json:"email,omitempty" yaml:"email,omitempty"`
	AvatarURL     string `json:"avatar,omitempty" yaml:"avatar,omitempty"`
	ProfileURL    string `json:"url,omitempty" yaml:"url,omitempty"`
	Entity        string `json:"entity,omitempty" yaml:"entity,omitempty"`
	Organizations []*Org `json:"organizations,omitempty" yaml:"organizations,omitempty"`
}

func GetDeveloper

func GetDeveloper(db *sql.DB, username string) (*Developer, error)

func GetGitHubDeveloper

func GetGitHubDeveloper(ctx context.Context, client *http.Client, username string) (*Developer, error)

type DeveloperListItem

type DeveloperListItem struct {
	Username string `json:"username,omitempty" yaml:"username,omitempty"`
	Entity   string `json:"entity,omitempty" yaml:"entity,omitempty"`
}

func SearchDevelopers

func SearchDevelopers(db *sql.DB, val string, limit int) ([]*DeveloperListItem, error)

SearchDevelopers returns a list of developers matching the given query.

func SearchGitHubUsers

func SearchGitHubUsers(ctx context.Context, client *http.Client, query string, limit int) ([]*DeveloperListItem, error)

type EntityResult

type EntityResult struct {
	Entity         string               `json:"entity,omitempty" yaml:"entity,omitempty"`
	DeveloperCount int                  `json:"developer_count,omitempty" yaml:"developerCount,omitempty"`
	Developers     []*DeveloperListItem `json:"developers,omitempty" yaml:"developers,omitempty"`
}

func GetEntity

func GetEntity(db *sql.DB, val string) (*EntityResult, error)

type Event

type Event struct {
	Org       string  `json:"org,omitempty" yaml:"org,omitempty"`
	Repo      string  `json:"repo,omitempty" yaml:"repo,omitempty"`
	Username  string  `json:"username,omitempty" yaml:"username,omitempty"`
	Type      string  `json:"type,omitempty" yaml:"type,omitempty"`
	Date      string  `json:"date,omitempty" yaml:"date,omitempty"`
	URL       string  `json:"url,omitempty" yaml:"url,omitempty"`
	Mentions  string  `json:"mentions,omitempty" yaml:"mentions,omitempty"`
	Labels    string  `json:"labels,omitempty" yaml:"labels,omitempty"`
	State     *string `json:"state,omitempty" yaml:"state,omitempty"`
	Number    *int    `json:"number,omitempty" yaml:"number,omitempty"`
	CreatedAt *string `json:"created_at,omitempty" yaml:"createdAt,omitempty"`
	ClosedAt  *string `json:"closed_at,omitempty" yaml:"closedAt,omitempty"`
	MergedAt  *string `json:"merged_at,omitempty" yaml:"mergedAt,omitempty"`
	Additions *int    `json:"additions,omitempty" yaml:"additions,omitempty"`
	Deletions *int    `json:"deletions,omitempty" yaml:"deletions,omitempty"`
	Title     string  `json:"title,omitempty" yaml:"title,omitempty"`
}

type EventDetails

type EventDetails struct {
	Event     *Event     `json:"event,omitempty" yaml:"event,omitempty"`
	Developer *Developer `json:"developer,omitempty" yaml:"developer,omitempty"`
}

func SearchEvents

func SearchEvents(db *sql.DB, q *EventSearchCriteria) ([]*EventDetails, error)

type EventImporter

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

type EventSearchCriteria

type EventSearchCriteria struct {
	FromDate *string `json:"from,omitempty" yaml:"from,omitempty"`
	ToDate   *string `json:"to,omitempty" yaml:"to,omitempty"`
	Type     *string `json:"type,omitempty" yaml:"type,omitempty"`
	Org      *string `json:"org,omitempty" yaml:"org,omitempty"`
	Repo     *string `json:"repo,omitempty" yaml:"repo,omitempty"`
	Username *string `json:"user,omitempty" yaml:"user,omitempty"`
	Entity   *string `json:"entity,omitempty" yaml:"entity,omitempty"`
	Mention  *string `json:"mention,omitempty" yaml:"mention,omitempty"`
	Label    *string `json:"label,omitempty" yaml:"label,omitempty"`
	Page     int     `json:"page,omitempty" yaml:"page,omitempty"`
	PageSize int     `json:"page_size,omitempty" yaml:"pageSize,omitempty"`
}

func (EventSearchCriteria) String

func (c EventSearchCriteria) String() string

type EventTypeSeries

type EventTypeSeries struct {
	Dates         []string  `json:"dates" yaml:"dates"`
	PRs           []int     `json:"pr" yaml:"pr"`
	PRReviews     []int     `json:"pr_review" yaml:"prReview"`
	Issues        []int     `json:"issue" yaml:"issue"`
	IssueComments []int     `json:"issue_comment" yaml:"issueComment"`
	Forks         []int     `json:"fork" yaml:"fork"`
	Total         []int     `json:"total" yaml:"total"`
	Trend         []float32 `json:"trend" yaml:"trend"`
}

func GetEventTypeSeries

func GetEventTypeSeries(db *sql.DB, org, repo, entity *string, months int) (*EventTypeSeries, error)

type ForksAndActivitySeries added in v0.6.8

type ForksAndActivitySeries struct {
	Months []string `json:"months" yaml:"months"`
	Forks  []int    `json:"forks" yaml:"forks"`
	Events []int    `json:"events" yaml:"events"`
}

func GetForksAndActivity added in v0.6.8

func GetForksAndActivity(db *sql.DB, org, repo, entity *string, months int) (*ForksAndActivitySeries, error)

type ImportSummary

type ImportSummary struct {
	Repo       string `json:"repo" yaml:"repo"`
	Since      string `json:"since" yaml:"since"`
	Events     int    `json:"events" yaml:"events"`
	Developers int    `json:"developers" yaml:"developers"`
}

ImportSummary contains per-repo import metadata.

func ImportEvents

func ImportEvents(dbPath, token, owner, repo string, months int) (map[string]int, *ImportSummary, error)

ImportEvents imports events from GitHub for a given org/repo combination.

type InsightsSummary

type InsightsSummary struct {
	BusFactor  int `json:"bus_factor" yaml:"busFactor"`
	PonyFactor int `json:"pony_factor" yaml:"ponyFactor"`
}

func GetInsightsSummary

func GetInsightsSummary(db *sql.DB, org, repo, entity *string, months int) (*InsightsSummary, error)

type ListItem

type ListItem struct {
	Value string `json:"value,omitempty" yaml:"value,omitempty"`
	Text  string `json:"text,omitempty" yaml:"text,omitempty"`
}

func GetEntityLike

func GetEntityLike(db *sql.DB, query string, limit int) ([]*ListItem, error)

GetEntityLike returns a list of repos that match the given pattern.

func GetOrgLike

func GetOrgLike(db *sql.DB, query string, limit int) ([]*ListItem, error)

GetOrgLike returns a list of orgs and repos that match the given pattern.

func GetRepoLike

func GetRepoLike(db *sql.DB, query string, limit int) ([]*ListItem, error)

GetRepoLike returns a list of repos that match the given pattern.

type MomentumSeries added in v0.9.0

type MomentumSeries struct {
	Months []string `json:"months" yaml:"months"`
	Active []int    `json:"active" yaml:"active"`
	Delta  []int    `json:"delta" yaml:"delta"`
}

func GetContributorMomentum added in v0.9.0

func GetContributorMomentum(db *sql.DB, org, repo, entity *string, months int) (*MomentumSeries, error)

type Org

type Org struct {
	URL         string `json:"url,omitempty" yaml:"url,omitempty"`
	Name        string `json:"name,omitempty" yaml:"name,omitempty"`
	Company     string `json:"company,omitempty" yaml:"company,omitempty"`
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
}

func GetUserOrgs

func GetUserOrgs(ctx context.Context, client *http.Client, username string, limit int) ([]*Org, error)

type OrgRepoItem

type OrgRepoItem struct {
	Org  string `json:"org,omitempty" yaml:"org,omitempty"`
	Repo string `json:"repo,omitempty" yaml:"repo,omitempty"`
}

func GetAllOrgRepos

func GetAllOrgRepos(db *sql.DB) ([]*OrgRepoItem, error)

GetAllOrgRepos returns a list of repo percentages for the given organization.

type PRReviewRatioSeries

type PRReviewRatioSeries struct {
	Months  []string  `json:"months" yaml:"months"`
	PRs     []int     `json:"prs" yaml:"prs"`
	Reviews []int     `json:"reviews" yaml:"reviews"`
	Ratio   []float64 `json:"ratio" yaml:"ratio"`
}

func GetPRReviewRatio

func GetPRReviewRatio(db *sql.DB, org, repo, entity *string, months int) (*PRReviewRatioSeries, error)

type PRSizeSeries added in v0.9.0

type PRSizeSeries struct {
	Months []string `json:"months" yaml:"months"`
	Small  []int    `json:"small" yaml:"small"`
	Medium []int    `json:"medium" yaml:"medium"`
	Large  []int    `json:"large" yaml:"large"`
	XLarge []int    `json:"xlarge" yaml:"xlarge"`
}

func GetPRSizeDistribution added in v0.9.0

func GetPRSizeDistribution(db *sql.DB, org, repo, entity *string, months int) (*PRSizeSeries, error)

type Query

type Query struct {
	On    int64  `json:"on,omitempty" yaml:"on,omitempty"`
	Type  string `json:"type,omitempty" yaml:"type,omitempty"`
	Value string `json:"value,omitempty" yaml:"value,omitempty"`
	Limit int    `json:"limit,omitempty" yaml:"limit,omitempty"`
}

type ReleaseCadenceSeries

type ReleaseCadenceSeries struct {
	Months      []string `json:"months" yaml:"months"`
	Total       []int    `json:"total" yaml:"total"`
	Stable      []int    `json:"stable" yaml:"stable"`
	Deployments []int    `json:"deployments" yaml:"deployments"`
}

func GetReleaseCadence

func GetReleaseCadence(db *sql.DB, org, repo, entity *string, months int) (*ReleaseCadenceSeries, error)

type ReleaseDownloadsByTagSeries added in v0.7.0

type ReleaseDownloadsByTagSeries struct {
	Tags      []string `json:"tags" yaml:"tags"`
	Downloads []int    `json:"downloads" yaml:"downloads"`
}

func GetReleaseDownloadsByTag added in v0.7.0

func GetReleaseDownloadsByTag(db *sql.DB, org, repo *string, months int) (*ReleaseDownloadsByTagSeries, error)

type ReleaseDownloadsSeries added in v0.7.0

type ReleaseDownloadsSeries struct {
	Months    []string `json:"months" yaml:"months"`
	Downloads []int    `json:"downloads" yaml:"downloads"`
}

func GetReleaseDownloads added in v0.7.0

func GetReleaseDownloads(db *sql.DB, org, repo *string, months int) (*ReleaseDownloadsSeries, error)

type Repo

type Repo struct {
	Name        string `json:"name,omitempty" yaml:"name,omitempty"`
	FullName    string `json:"full_name,omitempty" yaml:"fullName,omitempty"`
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
	URL         string `json:"url,omitempty" yaml:"url,omitempty"`
}

func GetOrgRepos

func GetOrgRepos(ctx context.Context, client *http.Client, org string) ([]*Repo, error)

type RepoMeta

type RepoMeta struct {
	Org        string `json:"org" yaml:"org"`
	Repo       string `json:"repo" yaml:"repo"`
	Stars      int    `json:"stars" yaml:"stars"`
	Forks      int    `json:"forks" yaml:"forks"`
	OpenIssues int    `json:"open_issues" yaml:"openIssues"`
	Language   string `json:"language" yaml:"language"`
	License    string `json:"license" yaml:"license"`
	Archived   bool   `json:"archived" yaml:"archived"`
	UpdatedAt  string `json:"updated_at" yaml:"updatedAt"`
}

func GetRepoMetas

func GetRepoMetas(db *sql.DB, org, repo *string) ([]*RepoMeta, error)

type RepoMetricHistory added in v0.8.0

type RepoMetricHistory struct {
	Org   string `json:"org"`
	Repo  string `json:"repo"`
	Date  string `json:"date"`
	Stars int    `json:"stars"`
	Forks int    `json:"forks"`
}

func GetRepoMetricHistory added in v0.8.0

func GetRepoMetricHistory(db *sql.DB, org, repo *string) ([]*RepoMetricHistory, error)

type ReputationDistribution

type ReputationDistribution struct {
	Labels []string  `json:"labels" yaml:"labels"`
	Data   []float64 `json:"data" yaml:"data"`
}

ReputationDistribution is the dashboard chart data.

func GetReputationDistribution

func GetReputationDistribution(db *sql.DB, org, repo, entity *string, months int) (*ReputationDistribution, error)

type ReputationResult

type ReputationResult struct {
	Updated int `json:"updated" yaml:"updated"`
	Skipped int `json:"skipped" yaml:"skipped"`
	Errors  int `json:"errors" yaml:"errors"`
}

ReputationResult is returned by the shallow bulk import.

func ImportReputation

func ImportReputation(db *sql.DB, org, repo *string) (*ReputationResult, error)

ImportReputation computes shallow (local-only) reputation scores for all contributors with stale or missing scores. No GitHub API calls.

type RetentionSeries

type RetentionSeries struct {
	Months    []string `json:"months" yaml:"months"`
	New       []int    `json:"new" yaml:"new"`
	Returning []int    `json:"returning" yaml:"returning"`
}

func GetContributorRetention

func GetContributorRetention(db *sql.DB, org, repo, entity *string, months int) (*RetentionSeries, error)

type ReviewLatencySeries added in v0.9.0

type ReviewLatencySeries struct {
	Months   []string  `json:"months" yaml:"months"`
	Count    []int     `json:"count" yaml:"count"`
	AvgHours []float64 `json:"avg_hours" yaml:"avgHours"`
}

func GetReviewLatency added in v0.9.0

func GetReviewLatency(db *sql.DB, org, repo, entity *string, months int) (*ReviewLatencySeries, error)

type SignalSummary

type SignalSummary struct {
	AgeDays           int64  `json:"age_days" yaml:"ageDays"`
	Followers         int64  `json:"followers" yaml:"followers"`
	Following         int64  `json:"following" yaml:"following"`
	PublicRepos       int64  `json:"public_repos" yaml:"publicRepos"`
	Suspended         bool   `json:"suspended" yaml:"suspended"`
	OrgMember         bool   `json:"org_member" yaml:"orgMember"`
	Commits           int64  `json:"commits" yaml:"commits"`
	TotalCommits      int64  `json:"total_commits" yaml:"totalCommits"`
	TotalContributors int    `json:"total_contributors" yaml:"totalContributors"`
	LastCommitDays    int64  `json:"last_commit_days" yaml:"lastCommitDays"`
	AuthorAssociation string `json:"author_association" yaml:"authorAssociation"`
	HasBio            bool   `json:"has_bio" yaml:"hasBio"`
	HasCompany        bool   `json:"has_company" yaml:"hasCompany"`
	HasLocation       bool   `json:"has_location" yaml:"hasLocation"`
	HasWebsite        bool   `json:"has_website" yaml:"hasWebsite"`
	PRsMerged         int64  `json:"prs_merged" yaml:"prsMerged"`
	PRsClosed         int64  `json:"prs_closed" yaml:"prsClosed"`
	RecentPRRepoCount int64  `json:"recent_pr_repo_count" yaml:"recentPRRepoCount"`
	ForkedRepos       int64  `json:"forked_repos" yaml:"forkedRepos"`
	TrustedOrgMember  bool   `json:"trusted_org_member" yaml:"trustedOrgMember"`
}

SignalSummary exposes gathered signals to the UI.

type State

type State struct {
	Since time.Time `json:"since" yaml:"since"`
	Page  int       `json:"page" yaml:"page"`
}

func GetState

func GetState(db *sql.DB, query, org, repo string, min time.Time) (*State, error)

type Substitution

type Substitution struct {
	Prop    string `json:"prop" yaml:"prop"`
	Old     string `json:"old" yaml:"old"`
	New     string `json:"new" yaml:"new"`
	Records int64  `json:"records" yaml:"records"`
}

func ApplySubstitutions

func ApplySubstitutions(db *sql.DB) ([]*Substitution, error)

func SaveAndApplyDeveloperSub

func SaveAndApplyDeveloperSub(db *sql.DB, prop, old, new string) (*Substitution, error)

type UserReputation

type UserReputation struct {
	Username   string         `json:"username" yaml:"username"`
	Reputation float64        `json:"reputation" yaml:"reputation"`
	Deep       bool           `json:"deep" yaml:"deep"`
	Signals    *SignalSummary `json:"signals,omitempty" yaml:"signals,omitempty"`
}

UserReputation is returned by the on-demand deep score endpoint.

func ComputeDeepReputation

func ComputeDeepReputation(db *sql.DB, token, username string) (*UserReputation, error)

ComputeDeepReputation scores a single user using GitHub API signals and stores the result. Called on-demand from the UI.

func GetOrComputeDeepReputation

func GetOrComputeDeepReputation(db *sql.DB, token, username string) (*UserReputation, error)

GetOrComputeDeepReputation returns a cached deep score if fresh (<24h), otherwise computes a new one via GitHub API.

type VelocitySeries

type VelocitySeries struct {
	Months  []string  `json:"months" yaml:"months"`
	Count   []int     `json:"count" yaml:"count"`
	AvgDays []float64 `json:"avg_days" yaml:"avgDays"`
}

func GetTimeToClose

func GetTimeToClose(db *sql.DB, org, repo, entity *string, months int) (*VelocitySeries, error)

func GetTimeToMerge

func GetTimeToMerge(db *sql.DB, org, repo, entity *string, months int) (*VelocitySeries, error)

func GetTimeToRestoreBugs added in v0.9.0

func GetTimeToRestoreBugs(db *sql.DB, org, repo, entity *string, months int) (*VelocitySeries, error)

Jump to

Keyboard shortcuts

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