projects

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package projects parses and validates deploy/config/projects.yaml: which repos exist, which brains they feed, and which GitHub identity owns them.

The Python ingest service validates the same file with the same rules (kb/src/ki_kb/projects.py). Both are tested against testdata/projects so they cannot drift apart.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalid = errors.New("invalid projects file")

ErrInvalid wraps every validation failure.

Functions

func NormalizeRepo

func NormalizeRepo(url string) (string, error)

NormalizeRepo returns the canonical lower-case https URL for any GitHub remote form.

Types

type Config

type Config struct {
	// SensitiveBrains holds names and families ("client-*").
	SensitiveBrains []string
	Identities      map[string]Identity
	Projects        []Project
	Workspaces      []Workspace
}

Config is a parsed, validated projects file.

func Load

func Load(file string) (*Config, error)

Load reads and validates a projects file.

func Parse

func Parse(data []byte) (*Config, error)

Parse validates and returns a projects file.

func (*Config) IsSensitive

func (c *Config) IsSensitive(brain string) bool

IsSensitive reports whether a brain may only be read when named explicitly.

type Identity

type Identity struct {
	Name       string
	GitHubUser string
	Email      string
	Credential string
	// Vault is false for employers or clients whose content must never be
	// copied into the vault.
	Vault bool
	// Ingest is false for employers or clients whose repos must never be
	// ingested into any brain. It has no default: every identity states it.
	Ingest bool
}

Identity is one GitHub account.

type IngestRule

type IngestRule struct {
	Path  string
	Brain string
}

IngestRule maps a repo path prefix to a brain.

type Project

type Project struct {
	Name     string
	Repo     string
	Branch   string
	Identity Identity
	Brains   []string
	Ingest   []IngestRule
	Board    string
	// VaultFolders are extra folders under the vault's projects/ that belong to
	// this project besides the one named after it.
	VaultFolders []string
	// Bulk projects are off-peak only: the kb worker holds their ingest back
	// in peak windows and on a low provider balance, and syncs them last.
	Bulk bool
}

Project is one entry in the projects file.

func (Project) BrainFor

func (p Project) BrainFor(rel string) (string, bool)

BrainFor returns the brain a repo-relative file feeds; the longest matching rule wins.

type Workspace

type Workspace struct {
	Name     string
	Title    string
	Brains   []string
	Projects []string
	Board    string
	Vault    []string
}

Workspace is a named view over projects, brains, a board, and vault folders.

Jump to

Keyboard shortcuts

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