provenancesweep

package
v1.167.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 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 provenancesweep trims the provenance captures that outlived the versions they describe.

A capture is appended to an asset on every content write, and until #1623 nothing removed one. An asset whose history is capped at twelve versions carried captures for three hundred and thirty-three of them, describing versions the platform had already deleted. The prune now drops a version's capture with the version, which holds for every write from here on; this pass is what settles the rows written before it.

It is a pass rather than a migration because the rule it applies depends on the deployment's portal.max_versions, which a migration cannot read. It is idempotent -- an asset with nothing left to trim is not written -- so a second replica, or a second boot, does no work.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, db *sql.DB, platformDefault *int)

Run trims every asset whose captures describe versions its retention cap has removed. platformDefault is the deployment's configured portal.max_versions, nil where it set none; the cap the pass applies is what the prune applies, resolved the same way, and an unlimited cap leaves an asset with no override of its own alone.

A failure to trim one asset is logged and the pass continues: the point is to settle a library, and one row the database refused is not a reason to leave the rest carrying history for versions that no longer exist.

Types

This section is empty.

Jump to

Keyboard shortcuts

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