diff options
| author | aur-build <aur-build@localhost> | 2026-11-18 10:02:04 +0000 |
|---|---|---|
| committer | aur-build <aur-build@localhost> | 2026-11-18 10:02:04 +0000 |
| commit | bc63622a1a91f6e1036eb8e6824c04f922e2654e (patch) | |
| tree | 6ca0a3d136ac5c5ba3d8abe89a2bce4b8531803c /testcorpus/downgrade/PKGBUILD | |
| parent | 5809493be2f6e47e3bbfc8a645ea0d82d5aedd82 (diff) | |
| download | aur-build-bc63622a1a91f6e1036eb8e6824c04f922e2654e.tar.gz aur-build-bc63622a1a91f6e1036eb8e6824c04f922e2654e.zip | |
ops: retention that never lies about what is on disk, metrics that cannot drift, and a backup that restores
Three §15 features, each with a failure mode worth designing against.
**Retention** evicts the files of releases beyond the keep window and never
deletes a row. The artifact keeps its digest, size and provenance and gains a
purged_at, so the record says 'these bytes existed and were dropped at T'
instead of continuing to claim a file that is no longer there. A package, its
signature, its build log and its cached sources are evicted as one unit — a
package whose log is gone but whose bytes remain is the worst outcome: full
price, no explanation. Shared content-addressed files are reference-checked
against every *retained* release first, because two releases built from the same
source share one cached archive and aging one out must not corrupt the other.
The currently accepted release and anything still backing an in_index package are
kept regardless of how far down the list they sit: deleting the bytes the index
is pointing at is the one thing retention must never do.
**Staging sweep** derives 'abandoned' rather than guessing it: the dir's build is
terminal, or has no build row at all, and the dir is older than a grace period.
A dir whose build is running is left alone however old it looks, because a long
build is not an abandoned one.
**Metrics** are computed from live state on every scrape. There are no counters
incremented at event sites, because a counter maintained by every code path is a
counter that quietly drifts the first time a path is added; a query cannot
drift. Includes queue depth, the review-debt age histogram (not just how many
reviews are pending but how stale they are), build success rate, WAL size,
stale counts by reason and staging usage. A fresh install reports success rate
1.0 rather than NaN or 0%, so an empty system does not page anyone. Served at
GET /metrics and by 'aur-build metrics'.
**Backup** uses VACUUM INTO on the writer connection, so it cannot interleave
with a write, and refuses to overwrite an existing file — a backup that silently
replaces last week's backup is a way of losing the only copy on the day you need
it. The snapshot is then reopened and checked for schema version and approval
rows: if it does not open on its own it is a file, not a backup.
New CLI: metrics, gc [--keep N] [--dry-run], backup <path>.
tests/ops.rs: 9 tests. 170 tests pass, clippy clean.
Diffstat (limited to 'testcorpus/downgrade/PKGBUILD')
0 files changed, 0 insertions, 0 deletions
