git_cache

command
v0.0.0-...-ad8c3d5 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package main implements a git repo cache on GCS.

The served API is as follows:

/get: Redirect to the GCS repo metadata cache object, populating the cache if necessary.
  - uri: Git repo URI e.g. github.com/org/repo
  - contains: The RFC3339-formatted time after which a cache entry must have been created.

Object Format

The repo cache is stored as a gzipped tar archive of the .git/ directory from an empty checkout of the upstream repo.

Data Races

Racing requests for the same resource will write and return different copies of the repo but these are expected to be ~identical and, given the GCS object versioning scheme, subsequent requests will converge to return the latest version of the archive.

The current behavior could be improved by coalescing like requests and blocking on a single writer.

Cache Lifecycle

If the caller provides the "contains" parameter that is more recent than the most recent cache entry, it will be re-fetched and overwritten.

There is currently no TTL for cache entries nor a size limitation for the backing storage. These are areas for future work.

Jump to

Keyboard shortcuts

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