aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/pkg/pkg_test.go
AgeCommit message (Collapse)Author
2026-04-23internal/pkg: record cache variant on-diskOphestra
This makes custom artifacts much less error-prone to use. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-04-18internal/pkg: drop cached error on cancelOphestra
This avoids disabling the artifact when using the individual cancel method. Unfortunately this makes the method blocking. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-04-17internal/pkg: abort all pending curesOphestra
This cancels all current pending cures without closing the cache. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-04-17internal/pkg: fine-grained cancellationOphestra
This enables a specific artifact to be targeted for cancellation. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-04-15internal/pkg: pass impure job countOphestra
This is cleaner than checking cpu count during cure, it is impossible to avoid impurity in both situations but this is configurable. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-04-10internal/landlock: relocate from package containerOphestra
This is not possible to use directly, so remove it from the public API. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-04-07all: optionally forbid degrading in testsOphestra
This enables transparently degradable tests to be forced on in environments known to support them. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-04-07internal/pkg: transparently degrade landlock in testsOphestra
This does not test package container, so should transparently cope with Landlock LSM being unavailable. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-04-03internal/pkg: optionally suppress via assumed checksumOphestra
This is quite error-prone and causes cache inconsistency similar to the store inconsistency seen on nix when a similar condition happens. Keep this behind a flag in case it is ever beneficial. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-04-03internal/pkg: cache flagsOphestra
This is cleaner for extending the API. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-17internal/stub: move from containerOphestra
This package solves a very specific stubbing use case, in a less than elegant manner. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-17fhs: move from containerOphestra
This package is not container-specific. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-17check: move from containerOphestra
This package is not container specific, and widely used across the project. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-03-04internal/pkg: write per-artifact logsOphestra
This is currently only used by execArtifact. A later patch will add additional logging facilities. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-02-05internal/pkg: standardise artifact IROphestra
This should hopefully provide good separation between the artifact curing backend implementation and the (still work in progress) language. Making the IR parseable also guarantees uniqueness of the representation. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-02-03internal/pkg: improve error resolutionOphestra
This was taking way too long for early failures. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-27internal/pkg: encode checksum in identOphestra
This also rearranges the ident ir to be more predictable, and avoids an obvious and somewhat easy to get into inconsistent state. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-27internal/pkg: exclusive artifactsOphestra
This alleviates scheduler overhead when curing many artifacts. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-25internal/pkg: expose response bodyOphestra
This uses the new measured reader provided by Cache. This should make httpArtifact zero-copy. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-25internal/pkg: expose underlying readerOphestra
This will be fully implemented in httpArtifact in a future commit. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-24internal/pkg: block on implementation entryOphestra
This avoids blocking while not in Cure method of the implementation. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-19internal/pkg: make checksum available to cureOphestra
This enables deduplication by value as implemented in execArtifact. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-17internal/pkg: deduplicate dependency errorsOphestra
This significantly simplifies error reporting for caller. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-16internal/pkg: lock on-filesystem cacheOphestra
Any fine-grained file-based locking here significantly hurts performance and is not part of the use case of the package. This change guarantees exclusive access to prevent inconsistent state on the filesystem. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-16internal/pkg: parallelise scrubOphestra
This significantly improves scrubbing performance. Since the cache directory structure is friendly to simultaneous access, this is possible without synchronisation. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-15internal/pkg: cache computed identifiersOphestra
This eliminates duplicate identifier computations. The new implementation also significantly reduces allocations while computing identifier for a large dependency tree. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-12internal/pkg: optionally named static fileOphestra
These are generally for generating configuration files or build scripts, naming them is quite useful. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-09internal/pkg: pass context to file cureOphestra
This removes the left over embedded contexts. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-09internal/pkg: move dependency flooding to cacheOphestra
This imposes a hard upper limit to concurrency during dependency satisfaction and moves all dependency-related code out of individual implementations of Artifact. This change also includes ctx and msg as part of Cache. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-07internal/pkg: tar optional fileOphestra
This allows tar to take a single-file directory Artifact as input. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-07internal/pkg: return reader for filesOphestra
This improves efficiency for cache hits. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-06internal/pkg: implement exec artifactOphestra
This runs a program in a container environment. Artifacts can be made available to the container, they are cured concurrently and mounted in order. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-06internal/pkg: pass cure context as single valueOphestra
This cleans up the function signature and makes backwards compatible API changes possible. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-05internal/pkg: verify checksum after uneventful scrubOphestra
This checks that scrub did not condemn any entry without reporting it. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-05internal/pkg: consistency check for on-disk cacheOphestra
This change adds a method to check on-disk cache consistency and destroy inconsistent entries as they are encountered. This primarily helps verify artifact implementation correctness, but can also repair a cache that got into an inconsistent state from curing a misbehaving artifact, without having to destroy the entire cache. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-05internal/pkg: override "." for directory checksumOphestra
This makes the checksum consistent with the final resting state of artifact directories without incurring the cost of an extra pair of chown syscalls. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-05internal/pkg: temporary scratch space for cureOphestra
This allows for more flexibility during implementation. The use case that required this was for expanding single directory tarballs. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-05internal/pkg: compute http identifier from urlOphestra
The previous implementation exposes arbitrary user input to the cache as an identifier, which is highly error-prone and can cause the cache to enter an inconsistent state if the user is not careful. This change replaces the implementation to compute identifier late, using url string as params. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-05internal/pkg: improve artifact interfaceOphestra
This moves all cache I/O code to Cache. Artifact now only contains methods for constructing their actual contents. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-04internal/pkg: create symlinks for filesOphestra
These are much easier to handle than hard links and should be just as transparent for this use case. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-04internal/pkg: implement tar artifactOphestra
This is useful for unpacking tarballs downloaded from the internet. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-04internal/pkg: override working directory permsOphestra
This must be writable to enable renaming, and the final result is conventionally read-only alongside the entire directory contents. This change overrides the permission bits as part of Store. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-03internal/pkg: implement caching for directoriesOphestra
This works on any directories and should be robust against any bad state the artifact curing process might have failed at. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-03internal/pkg: wrap checksum string encodingOphestra
This wraps base64.URLEncoding.EncodeToString for cleaner call site. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-03internal/pkg: compute identifier from depsOphestra
This provides infrastructure for computing a deterministic identifier based on current artifact kind, opaque parameters data, and optional dependency kind and identifiers. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-03internal/pkg: create work directoryOphestra
This is used for artifacts that cure into directories. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-03internal/pkg: implement http artifactOphestra
This is useful for downloading source tarballs from the internet. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-02internal/pkg: relocate cache test helperOphestra
This is useful for other tests that need a cache instance. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-02internal/pkg: encode entry in custom formatOphestra
The fact that Gob serialisation is deterministic is an implementation detail. This change replaces Gob with a simple custom format. Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-02internal/pkg: implement caching for filesOphestra
This change contains primitives for validating and caching single-file artifacts. Signed-off-by: Ophestra <cat@gensokyo.uk>