Commit Graph

97 Commits

Author SHA1 Message Date
6ba3d75258 feat(snap): add Cleaner 2026-03-06 01:07:35 +00:00
4a711f0187 feat(flatpak): add VersionQuerier 2026-03-06 01:07:35 +00:00
0b4c596fad Merge pull request #39 from gogrlx/dependabot/go_modules/github.com/cloudflare/circl-1.6.3
chore(deps): bump github.com/cloudflare/circl from 1.6.1 to 1.6.3
2026-03-05 20:04:12 -05:00
dependabot[bot]
18fabed79a chore(deps): bump github.com/cloudflare/circl from 1.6.1 to 1.6.3
Bumps [github.com/cloudflare/circl](https://github.com/cloudflare/circl) from 1.6.1 to 1.6.3.
- [Release notes](https://github.com/cloudflare/circl/releases)
- [Commits](https://github.com/cloudflare/circl/compare/v1.6.1...v1.6.3)

---
updated-dependencies:
- dependency-name: github.com/cloudflare/circl
  dependency-version: 1.6.3
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-05 23:19:53 +00:00
e1d89fa485 Merge pull request #38 from gogrlx/cd/aur-implementation
feat(aur): implement native AUR client
2026-03-05 18:09:56 -05:00
b8714a4969 refactor(aur): use go-git instead of git CLI
Replace exec.Command git clone/pull with go-git's PlainCloneContext
and Worktree.Pull. Removes git binary dependency — only makepkg and
pacman are needed on the host now.
2026-03-05 22:58:26 +00:00
eb999ad391 feat(aur): implement native AUR client
Native Go implementation using the AUR RPC v5 API for search/info
queries and git+makepkg+pacman for building and installing packages.

Implements:
- Manager (full: Install, Remove, Purge, Upgrade, Update, List, Search,
  Info, IsInstalled, Version)
- VersionQuerier (LatestVersion, ListUpgrades, UpgradeAvailable, VersionCmp)
- Cleaner (Autoremove via pacman, Clean build dir)
- PackageUpgrader (UpgradePackages)

Key design decisions:
- No CLI wrapper (paru/yay) — uses AUR RPC API directly + git clone
- Packages are built with makepkg and installed via pacman -U
- Foreign packages (pacman -Qm) are treated as AUR packages for List
- Batch RPC queries (rpcInfoMulti) for efficient upgrade checks
- Configurable build directory and makepkg flags
- Not added to detect.Default() candidates (AUR supplements pacman,
  not replaces it) but available via detect.ByName("aur")
2026-03-05 22:50:35 +00:00
34ce21618d Merge pull request #36 from gogrlx/cd/ci-improvements
ci: add staticcheck lint job and Go version matrix
2026-03-05 17:39:20 -05:00
342f10f38b ci: drop Go 1.25 from matrix (go.mod requires 1.26) 2026-03-05 22:37:56 +00:00
e9dc88f83a ci: add staticcheck lint job and Go version matrix for unit tests 2026-03-05 22:35:33 +00:00
597a4f9d72 Merge pull request #33 from gogrlx/cd/openbsd-detect-and-tests
fix(detect): wire up ports package for OpenBSD detection
2026-03-05 12:29:34 -05:00
8a9bba55cf Merge pull request #34 from gogrlx/cd/apt-test-coverage
fix(apt): fix extractURL multi-token options parsing and add unit tests
2026-03-05 12:26:45 -05:00
8075e74393 Merge pull request #35 from gogrlx/cd/pacman-test-coverage
test(pacman): add comprehensive unit tests for pure functions
2026-03-05 12:26:23 -05:00
ad45cfaef5 test(pacman): add comprehensive unit tests for pure functions
Add parse_test.go with edge case tests for parseList, parseSearch,
and parseInfo (empty input, whitespace, missing fields, colons in
values, no-repo names, partial installed markers).

Add helpers_test.go with tests for formatTargets, buildArgs option
combinations, parseUpgrades (standard + fallback format),
parseGroupPkgSet (duplicates, single-field lines), and interface
checks.

Coverage: 16.2% -> 24.1%.
2026-03-05 10:02:36 +00:00
6c8d0d367b fix(apt): fix extractURL multi-token options parsing and add unit tests
- Fix bug in extractURL where multi-token option blocks like
  [arch=amd64 signed-by=/path/key.gpg] were not properly skipped,
  causing the option value to be returned instead of the URL
- Add comprehensive unit tests for parseList, parseSearch, parseInfo
  edge cases (empty input, missing fields, special characters)
- Add unit tests for normalizeName and parseArch covering all
  supported Debian architectures and edge cases
- Add unit tests for formatTargets, buildArgs (all option combos),
  and extractURL (basic, options, signed-by)
- Coverage: apt package 7.5% -> 17.1%
2026-03-05 09:33:36 +00:00
90ca983200 fix(detect): wire up ports package for OpenBSD detection
The ports package was fully implemented but detect_openbsd.go still
returned nil candidates with a stale TODO. Wire up ports.New() so
OpenBSD systems can auto-detect their package manager.

Also adds:
- Unit tests for GetCapabilities with mock managers (base + full)
- Unit tests for Locker mutual exclusion
- Edge case tests for ports parser (empty input, whitespace, fallback)
- Minor dep updates (charmbracelet/ultraviolet, charmbracelet/x)
2026-03-05 09:03:38 +00:00
397e865107 Merge pull request #32 from gogrlx/cd/update-deps
chore(deps): update all dependencies
2026-03-01 10:49:14 -05:00
6ff778c857 fix(test): use non-installed package in dpkg/rpm Install_Unsupported tests
The tests expected Install("tree") to error because dpkg/rpm need
a .deb/.rpm file path. But "tree" is pre-installed in CI containers,
so the code short-circuits to "unchanged" and returns nil.

Use a non-existent package name instead to exercise the actual
install failure path.
2026-03-01 07:32:55 +00:00
f85e215981 fix: update apt/dpkg integration tests for 2-value Install/Remove returns 2026-03-01 01:44:50 +00:00
4e90abc6a3 fix: update integration tests for Install/Remove multi-return signature 2026-03-01 00:47:23 +00:00
e7018f3602 chore(deps): update all dependencies 2026-02-28 08:00:44 +00:00
e4844cca05 Merge cd/upgrade-packages: add PackageUpgrader interface (#31) 2026-02-28 07:26:52 +00:00
8306da6223 refactor(apt): build upgrade args directly instead of post-hoc insertion
Avoids fragile slice manipulation when injecting --only-upgrade flag.
2026-02-28 07:26:48 +00:00
f2eff01ab4 feat: add PackageUpgrader interface for targeted package upgrades
Add optional PackageUpgrader interface with UpgradePackages method
that upgrades specific installed packages (unlike Upgrade which
upgrades everything).

Each backend uses native upgrade commands:
- apt: apt-get install --only-upgrade
- dnf: dnf upgrade <pkg>
- pacman: pacman -S <pkg>
- apk: apk upgrade <pkg>
- pkg (FreeBSD): pkg upgrade <pkg>
- flatpak: flatpak update <pkg>
- snap: snap refresh <pkg>

Non-installed packages are filtered out and returned as Unchanged.

Closes #31
2026-02-28 07:26:11 +00:00
5629e41aeb style: goimports formatting 2026-02-28 07:09:07 +00:00
83d92be37a refactor(snack): merge GroupIsInstalled into Grouper interface
GroupQuerier was an unnecessary indirection — GroupIsInstalled is a group
operation and belongs on Grouper. No v1 stability guarantee, so breaking
the interface is fine.
2026-02-28 07:08:34 +00:00
bbb745434e Merge remote-tracking branch 'origin/copilot/add-isheld-method-to-holder-interface' into cd/integration-copilot-prs 2026-02-28 07:07:25 +00:00
c55027f9b7 merge: resolve pacman capabilities conflict (keep both interfaces) 2026-02-28 07:07:21 +00:00
b0e39036de Merge remote-tracking branch 'origin/copilot/add-install-remove-changes-reporting' into cd/integration-copilot-prs 2026-02-28 07:07:00 +00:00
ae56fb541d Merge remote-tracking branch 'origin/copilot/add-group-is-installed-check' into cd/integration-copilot-prs 2026-02-28 07:07:00 +00:00
copilot-swe-agent[bot]
a3e4827e5e Fix Reinstall, version-pinned, error propagation, and DryRun bugs in Install/Remove pre-filter
Co-authored-by: taigrr <8261498+taigrr@users.noreply.github.com>
2026-02-28 06:59:51 +00:00
copilot-swe-agent[bot]
6032f55925 Fix DNF isHeld to reuse listHeld instead of passing pkg to versionlock list
Co-authored-by: taigrr <8261498+taigrr@users.noreply.github.com>
2026-02-28 06:55:21 +00:00
copilot-swe-agent[bot]
22dda8684d Move GroupIsInstalled to separate GroupQuerier optional interface
Co-authored-by: taigrr <8261498+taigrr@users.noreply.github.com>
2026-02-28 06:54:28 +00:00
copilot-swe-agent[bot]
ec303b665f Add DryRunner implementation to dpkg package
Co-authored-by: taigrr <8261498+taigrr@users.noreply.github.com>
2026-02-28 06:54:06 +00:00
copilot-swe-agent[bot]
73d546235e detect: replace sync.Once with atomic.Pointer for race-safe caching and Reset()
Co-authored-by: taigrr <8261498+taigrr@users.noreply.github.com>
2026-02-28 06:51:41 +00:00
copilot-swe-agent[bot]
3d6baf3314 Add InstallResult and RemoveResult types; update Manager interface and all implementations
Co-authored-by: taigrr <8261498+taigrr@users.noreply.github.com>
2026-02-28 06:33:17 +00:00
copilot-swe-agent[bot]
34578efcad Update all package managers to return InstallResult/RemoveResult
Change Install and Remove method signatures across all package manager
implementations (apt, apk, dnf, pacman, rpm, dpkg, snap, flatpak, ports,
pkg) to match the updated Manager interface.

- Wrapper files: update Install/Remove to return (snack.InstallResult, error)
  and (snack.RemoveResult, error) respectively
- Platform files (_linux.go, _openbsd.go, _freebsd.go): implement pre-check
  logic using isInstalled() to classify packages as unchanged or to-process,
  run command on actionable packages only, then collect results with version()
- Stub files (_other.go): return (snack.InstallResult{}, ErrUnsupportedPlatform)
  and (snack.RemoveResult{}, ErrUnsupportedPlatform)
- DNF special case: add v5 bool parameter to internal install/remove functions
  and thread d.v5 from the wrapper; update Purge to discard the result
- cmd/snack/main.go: update install/remove commands to discard InstallResult/
  RemoveResult and return only the error to cobra

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-28 06:31:01 +00:00
copilot-swe-agent[bot]
135e7c70f4 Add IsHeld method to Holder interface and implement in apt/dnf backends
Co-authored-by: taigrr <8261498+taigrr@users.noreply.github.com>
2026-02-28 06:24:07 +00:00
copilot-swe-agent[bot]
dec1516387 Add GroupIsInstalled to Grouper interface with pacman and dnf implementations
Co-authored-by: taigrr <8261498+taigrr@users.noreply.github.com>
2026-02-28 06:23:21 +00:00
copilot-swe-agent[bot]
9f943e9097 Add DryRunner interface and DryRun capability for dry-run support detection
Co-authored-by: taigrr <8261498+taigrr@users.noreply.github.com>
2026-02-28 06:22:26 +00:00
copilot-swe-agent[bot]
68ec5cb659 detect: cache Default() result with sync.Once, add Reset()
Co-authored-by: taigrr <8261498+taigrr@users.noreply.github.com>
2026-02-28 06:18:45 +00:00
copilot-swe-agent[bot]
c1ae8c4fac Initial plan 2026-02-28 06:18:16 +00:00
copilot-swe-agent[bot]
434c367687 Initial plan 2026-02-28 06:17:59 +00:00
copilot-swe-agent[bot]
3ecd9f6220 Initial plan 2026-02-28 06:17:44 +00:00
copilot-swe-agent[bot]
da5b1eb5db Initial plan 2026-02-28 06:16:46 +00:00
copilot-swe-agent[bot]
52d276bf43 Initial plan 2026-02-28 06:15:57 +00:00
470a3c5f98 Merge pull request #17 from gogrlx/dependabot/go_modules/golang.org/x/crypto-0.45.0
chore(deps): bump golang.org/x/crypto from 0.43.0 to 0.45.0
2026-02-26 01:52:04 -05:00
787a35dcd9 Merge pull request #20 from gogrlx/cd/exhaustive-containertests
test: exhaustive integration tests + codecov
2026-02-25 22:18:55 -05:00
5b3517e5a8 fix(dnf): add dnf5 versionlock parser, relax test assertions
- Add parseVersionLockDNF5 for dnf5's 'Package name: <name>' format
- Wire v5 flag through listHeld
- Relax apt ListRepos (DEB822 format may yield empty)
- Relax snap Info version assertion (uninstalled snaps)
- Add unit test for parseVersionLockDNF5
2026-02-26 03:15:47 +00:00
aa34f1d896 fix(test): relax assertions for cross-distro compatibility
- apk: Search_NoResults may return error instead of empty
- apt: Info may not populate Description; ListRepos URL may be empty
- pacman: Groups may not exist in minimal containers
- dnf: FileList_NotInstalled doesn't guarantee ErrNotInstalled sentinel;
  GroupInfo_NotFound may return empty instead of error;
  Holder tests nested under Hold (skip all if versionlock unavailable)
- flatpak: Info/Version may not work on all app IDs after install
2026-02-26 03:10:55 +00:00