summaryrefslogtreecommitdiffstats
path: root/tests/common
Commit message (Collapse)AuthorAgeFilesLines
* http: surfaces driven by live state — staleness, downgrades, deps, rebuild ↵aur-build14 days1-0/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | | (I6) Attention, the package page and the builds page now answer real questions instead of rendering empty tables: - Attention lists outdated dependencies derived from the recorded world snapshots, naming the dependency that moved, what the artifact was built against and what the index holds now; also missing dependencies and downgrades (AUR offering a lower version than we serve), which is an announcement for a human, not a build request. - The package page shows depends-on from the recipe we actually serve and needed-by from the packages whose recipes name it, plus staleness and the aur_commit timeline, each release linking into cgit at that exact commit. - Builds rows carry the version they are about, in both the live and the recently-finished table. - A manual rebuild reuses the approved source identity and mints no approval (I6); the test asserts the approval count is unchanged before and after the rebuild runs. - A paused subscription is not observed at all: detection returns Paused without polling, so pausing a broken package stops it opening reviews. - Staleness stays computed on read (§10.2). Nothing stores a stale flag, so nothing can serve a stale lie. Also: dep-client fixture added for dependency pairs.
* watch: two-stage VCS watcher — ls-remote probe, pkgver() resolution, pin ↵aur-build14 days1-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | capture (§5.2) Stage A probes every VCS source in source=() with git ls-remote, respecting #commit/#tag/#branch fragments, and returns one UpstreamPin per source. If the tip set equals the accepted release's pins, nothing can have changed and Stage B never runs — the common case costs one round trip per source and no clone. svn/hg have no cheap universal probe, so they are reported as unprobed and force Stage B rather than being silently treated as unchanged. Stage B runs only on movement: it fetches into a persistent vcs_cache (rather than re-cloning a multi-gigabyte upstream daily), runs makepkg --vercheck, and captures the pins from the clone it already has. Results are cached on (pkgbase, recipe_hash, upstream_tip) with a per-pkgbase cooldown, and a process-wide slot cap bounds concurrent resolutions. The resolved epoch:pkgver-pkgrel plus the pins go into identity_hash, so a different commit is a different thing to approve. Also fixes a misclassification the new path exposed: a VCS source's digest is its pin, so upstream movement showed up as an integrity_alert. Integrity events are now restricted to fixed downloads; VCS movement under a frozen pkgver is pin_drift, as §5.2 specifies. New fixtures git-multi (two upstreams) and git-tagged (#tag pin). 10 tests in tests/vcs.rs.
* pipeline: ten-step build machine with atomic signed publishaur-build14 days1-0/+12
| | | | | | | | | | | | | | | | | | | | | materialize -> plan -> chroot -> sources -> pkgver -> build -> collect -> verify -> ingest -> publish, each checkpointed in build_step so a worker that dies resumes at the next incomplete step without repeating the expensive one (I5). Step 0 materializes from the local mirror only and re-hashes the tree: there is no path from 'AUR moved since the review' to 'we built it anyway' (I3). Step 4 re-resolves a VCS pkgver and refuses when it no longer matches the approved identity. Publish renders the index to .tmp, fsyncs, commits release + package rows and the accepted pointer under a compare-and-swap, then renames over the served database and signs it, so a crash leaves the old index byte-for-byte intact (I4) and every index entry traces back to an approval (I1). Ingest records the world snapshot as the BUILDINFO installed set intersected with our own packages, which is what keeps staleness meaningful (I12). 17 shim-driven end-to-end tests, including kill-mid-publish and crash-resume, with no root, network, or real chroot.
* test: toolchain shims and the fake-package corpus (§16a)aur-build14 days1-0/+151
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The harness that makes the rest of this developable. Six real binaries named exactly like the tools the pipeline shells out to, sharing one shim module, driven entirely by environment so no production code path is test-only: AUR_SHIM_DIR where invocations are recorded (jsonl) AUR_SHIM_MANIFEST the fixture manifest to obey AUR_SHIM_FAIL optional tool forced to fail makechrootpkg emits real .pkg.tar.zst files with .PKGINFO and .BUILDINFO (the full chroot world, which is why §10.1 filters it), makepkg answers --printsrcinfo and --vercheck for Stage B, repo-add rebuilds a gzip'd .db with %FILENAME%/%VERSION%/%SHA256SUM% DESC entries, gpg writes a detached signature, mkarchroot creates a warm root. Each one records its invocation so tests assert on what actually ran. testcorpus/ holds 17 fixtures, each a PKGBUILD plus a manifest with the scripted outcome: plain-make, with-patch, install-hooks, skip-checksum, split-pkgbase, build-fails, check-fails, missing-dep, dep-cycle, epoch-bump, pkgrel-reset, downgrade, digest-drift, pin-drift, git-sourced, git-submodules, unresolvable. The harness commits a fixture into a real git repo standing in for AUR, materialises a local upstream git repo for VCS fixtures, and swaps payload bytes for the drift cases. Config.child_env is what puts the shims on PATH for child processes, so the pipeline runs completely unmodified under test. Part of P0 (DESIGN.md §17).
* feat: AUR mirror watcher, recipe parsing, candidate creationaur-build14 days1-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The detection path (§5.1, §5.1a, §5.3, §7.1): * git helpers, all subprocess git in one auditable place. Mirrors are cloned with --mirror and polled with git ls-remote, fetching only when the tip actually moved; --no-prune keeps history we may need forever. * .SRCINFO parsing (authoritative) with a PKGBUILD fallback, and source=() parsing that keeps VCS kind, #commit/#tag/#branch refs and the filename:: form. * recipe_hash over the whole snapshot tree, so a shipped patch is part of the recipe and cannot change silently. * source digest resolution: declared checksums are trusted-as-declared (makepkg enforces them, no bandwidth), local files are hashed from the mirror, and SKIP sources are downloaded and stream-hashed into the content-addressed source cache. Detection always re-fetches SKIP sources — answering from our own cache would defeat drift detection. * candidate creation with base = current_accepted_release, collapse in place while unviewed, supersede only once a human has looked, and a previously rejected identity is not re-raised. * non-publishable change handling (I11): unchanged version string means no review, but never silence — recipe drift and pin drift become notices, and a changed digest on a remote source with an unchanged version becomes a high-severity integrity_alert. Also vercmp + dep-string parsing with the ALPM test vectors, and the approval record with optimistic concurrency (§7.1a) that the CLI and web layers will both call. 16 detection tests against real file:// git fixtures, incl. I2 across three unattended detections and I11 for all three drift kinds. Part of P0 (DESIGN.md §17).
* feat: SQLite schema, migrations, single writer actoraur-build2026-11-171-0/+177
The §11 data model as four migrations, plus the §11a concurrency model: one writer thread owning the write connection (mutations arrive as closures over a crossbeam channel, so SQLITE_BUSY is not part of the design) and thread-local read-only connections under WAL. Invariants that are database guarantees rather than conventions: I7 partial unique index -> at most one pending_review per pkgbase I3 UNIQUE(pkgbase_id, identity_hash) -> no duplicate candidates I10 audit table rejects UPDATE and DELETE by trigger §16 current_accepted_release_id moves only by compare-and-swap Also: vercmp + dependency-string parsing (ALPM algorithm, no libalpm), hash helpers including recipe_hash over the whole AUR tree, the clock helper that stamps every write, and the config/root layout. Part of P0 (DESIGN.md §17).