importer

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModeAll        = "all"
	ModeImport     = "import"
	ModeReputation = "reputation"
)

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context) error

Run reads IMPORT_MODE env var and dispatches to the appropriate workflow. Supported modes: "all" (default), "import" (skip deep reputation), "reputation" (deep reputation only).

func RunDeepReputation added in v0.18.0

func RunDeepReputation(ctx context.Context) error

RunDeepReputation scores all stale contributors globally using round-robin token rotation across all active installations. Single task, no parallelism.

Types

type RepoWork added in v0.33.0

type RepoWork struct {
	Org     string
	Repo    string
	Tenants []TenantRef
}

RepoWork represents a unique repo to import, with all tenants that track it.

func BuildWorkList added in v0.33.0

func BuildWorkList(rows []tenant.ImportWorkRow) []RepoWork

BuildWorkList deduplicates tenant_repo rows by (org, repo), grouping tenant refs under each unique repo. Preserves exact org/repo casing.

func ShardRepos added in v0.33.0

func ShardRepos(repos []RepoWork, taskCount, taskIndex int) []RepoWork

ShardRepos deterministically assigns repos to a task shard. Sorts by lowercase(repo), then lowercase(org) as tiebreaker, then assigns every taskCount-th item to the given taskIndex. Guarantees: union of all shards == input, no gaps, no overlaps.

type TenantRef added in v0.33.0

type TenantRef struct {
	TenantRepoID string
	TenantID     string
	Plan         string
}

TenantRef links a tenant to their tenant_repo row for post-import bookkeeping.

Jump to

Keyboard shortcuts

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