Commit Graph

11 Commits

Author SHA1 Message Date
387e951b86 fix: use snack.Manager interface type for type assertions, drop coverpkg 2026-02-26 02:53:39 +00:00
b12f956e45 test: exhaustive integration tests with codecov
- Root package unit tests: Targets, TargetNames, ApplyOptions, error sentinels
- Every provider integration test now covers:
  - All Manager interface methods (positive + negative cases)
  - GetCapabilities verification (assert expected interfaces)
  - VersionQuerier: LatestVersion, ListUpgrades, UpgradeAvailable, VersionCmp
  - Holder: Hold, ListHeld, Unhold (apt, dnf)
  - Cleaner: Autoremove, Clean
  - FileOwner: FileList, Owner (+ not-found cases)
  - RepoManager: ListRepos (apt, dnf, flatpak)
  - KeyManager: ListKeys (apt, dnf)
  - Grouper: GroupList, GroupInfo (pacman, dnf)
  - NameNormalizer: NormalizeName, ParseArch table tests (apt, dpkg, dnf, rpm)
- Containertest matrix: 5 distros (debian, alpine, arch, fedora39, fedora-latest)
- CI: coverage profiles uploaded per-job, merged in codecov job
- Added .gitignore for coverage files
2026-02-26 02:50:48 +00:00
99dfc80003 fix(ci): pin fedora:39 for dnf4, fix test paths for debian/alpine
- Fedora 40+ ships dnf5 (not 41 as assumed) — pin to 39
- Debian container: /usr/bin/bash doesn't exist, use /usr/bin/dpkg
- Alpine: use busybox for LatestVersion test (always available)
2026-02-26 01:55:24 +00:00
0932da4d02 fix(ci): fix integration test failures across distros
- apk: Info test uses busybox (pre-installed) instead of curl (not installed)
- apk: LatestVersion test uses tree (installed during test)
- dpkg: Owner test uses /usr/bin/bash (not /bin/bash symlink)
- flatpak: List test checks both Name and Application ID fields
- dnf: pin Fedora to 41 (dnf4); dnf5 has incompatible output format
2026-02-26 01:52:46 +00:00
fa7bd7a79b fix: use snack.Manager interface type for capability assertions in integration tests
Type assertions require an interface type, not a concrete struct pointer.
Changed all integration tests from 'mgr := pkg.New()' to
'var mgr snack.Manager = pkg.New()' so capability checks like
mgr.(snack.VersionQuerier) compile correctly.
2026-02-26 01:47:25 +00:00
b443269594 feat: add integration tests and GitHub Actions CI
Add integration test files for all providers (apt, dpkg, pacman, apk,
dnf, rpm, flatpak, snap, pkg, detect) behind the 'integration' build
tag. Tests exercise real package operations: update, search, info,
install, verify, list, remove, and capability interfaces.

Add GitHub Actions workflow running unit tests on ubuntu-latest and
integration tests on Debian, Ubuntu, Fedora, Alpine, Arch Linux, and
Ubuntu+Flatpak containers/runners.
2026-02-26 01:42:19 +00:00
6edb79df3f fix: improve feature completeness and correctness
Pass 1 (Feature & Completeness):
- Replace apt CLI with apt-get for listUpgrades (apt CLI is unstable for scripting)
- Verify snapd daemon is running in snap Available() check
- Add ErrDaemonNotRunning sentinel error for daemon-dependent managers
- Fix staticcheck S1011: replace loop with append(keys, matches...)
- Fix staticcheck SA1012: use context.TODO() instead of nil in dpkg tests
2026-02-26 01:26:51 +00:00
e5c749558f feat(apt,dpkg): implement capability interfaces
apt: VersionQuerier, Holder, Cleaner, FileOwner, RepoManager, KeyManager, NameNormalizer
dpkg: FileOwner, NameNormalizer

All new interfaces follow the existing pattern of exported methods on
struct delegating to unexported platform-specific functions. Mutating
operations use Lock/Unlock; read-only operations do not.

Platform stubs in _other.go files return ErrUnsupportedPlatform.
Compile-time interface checks added for all implemented interfaces.
2026-02-25 20:47:44 +00:00
0d6c5d9e17 feat: add per-provider mutex and Target-aware implementations
- Add snack.Locker embed for per-provider mutex serialization
- Update all providers (pacman, apk, apt, dpkg) to use []Target
  with version pinning support (pkg=version syntax)
- Add lock/unlock to all mutating operations (Install, Remove, Purge,
  Upgrade, Update)
- Add snack.TargetNames helper and formatTargets per provider
- apt: add FromRepo (-t) and Reinstall support
- dpkg: use Target.Source for .deb file paths in Install
2026-02-25 20:35:45 +00:00
5163a948ea feat(apt,dpkg): implement apt and dpkg package manager wrappers
Implement the snack.Manager interface for both apt (Debian/Ubuntu) and
dpkg (low-level Debian package tool).

apt wraps apt-get, apt-cache, and dpkg-query for full package management.
dpkg wraps dpkg and dpkg-query for low-level .deb operations.
Upgrade and Update return ErrUnsupportedPlatform for dpkg.

Both packages include:
- Linux implementations with proper error wrapping
- Non-linux build stubs returning ErrUnsupportedPlatform
- Output parsing helpers with tests
- Functional options support (sudo, assume-yes, dry-run)
2026-02-25 20:25:19 +00:00
08514a27e1 feat: initial project scaffold
- Common Manager interface, Package type, functional options
- Sentinel errors for common package manager failures
- Sub-package stubs for: pacman, aur, apk, apt, dpkg, dnf, rpm,
  flatpak, snap, pkg (FreeBSD), ports (OpenBSD)
- detect/ package for auto-detection of system package manager
- 0BSD license
2026-02-25 20:01:51 +00:00