umpyre.storage.git_branch#

Git branch-based storage operations.

Classes

GitBranchStorage(repo_path[, remote, token])

Store metrics in a separate git branch.

Exceptions

GitBranchStorageError

Raised when git branch storage operations fail.

class umpyre.storage.git_branch.GitBranchStorage(repo_path, remote='origin', *, token=None)[source]#

Bases: object

Store metrics in a separate git branch.

This provides versioned, branch-based storage without polluting the main branch or requiring external artifacts.

Example

>>> storage = GitBranchStorage(repo_path="/path/to/repo")
>>> metrics = {"lines": 100, "functions": 10}
>>> storage.store_metrics(metrics, "abc123", branch="code-metrics")
store_metrics(metrics, commit_sha, branch='code-metrics', formats=None)[source]#

Store metrics to git branch.

Parameters:
  • metrics (dict) – Metric dictionary to store

  • commit_sha (str) – Git commit SHA

  • branch (str) – Target branch name

  • formats (Optional[list[str]]) – List of formats (‘json’, ‘csv’)

exception umpyre.storage.git_branch.GitBranchStorageError[source]#

Bases: Exception

Raised when git branch storage operations fail.